Linear Algebra
Lesson 2 of 4 9 min +75 XP

Matrices & Multiplication

Grids of numbers and how they combine.

What you'll learn

  • Read a matrix's dimensions
  • Know when two matrices can multiply
  • Compute an entry of a product
The spreadsheet that transforms

A photo filter takes every pixel's coordinates and shifts, rotates, or stretches them. That whole operation is stored as a small grid of numbers — a matrix — and multiplying applies the same transformation to every point at once.

Rows × columns

A matrix is a rectangular grid of numbers with shape (rows × columns). To multiply A (m×n) by B (p×q) the inner dimensions must match (n = p); the result is m×q. Each entry is the dot product of a row of A with a column of B.

[1 2; 3 4] · [5; 6]
= [1·5 + 2·6; 3·5 + 4·6]
= [17; 39]
Lab · Check the shapes
  1. Write down the shape of each matrix as (rows × columns).
  2. Confirm the inner numbers match before multiplying.
  3. The answer's shape is the two outer numbers.

What you should see: A (2×3) times B (3×4) is valid because the inner 3s match, and the product is 2×4.

Knowledge Check

+20 XP / correct

1. You can multiply a 2×3 matrix by a…

2. The product of a 2×3 and a 3×4 matrix has shape…