Part I. Highlights of Linear Algebra
Matrix-Matrix Multiplication AB
Four correct ways to compute AB. One of them (columns times rows) is the one the rest of the book is built on, because it writes a matrix as a sum of rank-one pieces.
The one idea
AB can be computed four different ways, all giving the same matrix:
- Entry by entry: row
iofAdotted with columnjofB. The version you were taught, and the least useful here. - Column by column: each column of
ABisAtimes the corresponding column ofB. This is just I.1 applied repeatedly. - Row by row: each row of
ABis the corresponding row ofAtimesB. - Columns times rows: the one that matters:
AB = a₁b₁ᵀ + a₂b₂ᵀ + ⋯ + aₙbₙᵀ
where aₖ is column k of A and bₖᵀ is row k of B.
Read that last one carefully. Each term aₖbₖᵀ is a column times a row, which
produces a full-size matrix of rank one. So AB is not one indivisible
object; it is a sum of rank-one layers, and there are only as many layers as
the inner dimension.
Why it matters later
This decomposition is the skeleton of the whole book.
- The SVD (I.8) writes
A = σ₁u₁v₁ᵀ + σ₂u₂v₂ᵀ + ⋯. That is exactly the columns-times-rows form, with the layers ordered so the most important comes first. - Eckart-Young (I.9) then says: keep the first
klayers and you have the best possible rank-kapproximation. “Best” is only a meaningful claim because you already understand a matrix as a stack of rank-one pieces you can truncate. - Randomized multiplication (II.4) samples a subset of those
nlayers instead of computing all of them. That only makes sense if you seeABas a sum you could sample from. - Low-rank updates (III.1) modify a matrix by adding one such layer.
If you take one thing from Part I into Part III, take the habit of seeing a matrix as a sum of rank-one terms.
What to actually do
- Take two
3×2and2×3matrices. ComputeABthe standard way. Then compute it asa₁b₁ᵀ + a₂b₂ᵀand confirm you get the same3×3result. - Look at the rank of what you produced. Two rank-one matrices were added and
the result is at most rank 2, even though it is a
3×3matrix. Convince yourself why it can never be 3. - Count multiplications for an
m×ntimesn×pproduct. You should getmnp, and you should get the same count whichever of the four ways you use. Same work, different bookkeeping.
Check yourself
- Why is
aₖbₖᵀalways rank one, no matter how large the vectors are? - If
Aism×nandBisn×p, how many rank-one layers are in the sum, and what upper bound does that put onrank(AB)? - Which of the four ways is most natural if
Bhas only one column? IfAhas only one row?
Common sticking points
Mixing up aᵀb and abᵀ. The first is an inner product, a single number.
The second is an outer product, a whole matrix. They are written almost
identically and mean entirely different things. When you see a transpose in
this book, check which side it is on before reading further.
Assuming rank adds. rank(A + B) is at most rank(A) + rank(B), but it can
be less, and for products rank(AB) ≤ min(rank A, rank B). Multiplying can only
lose rank, never create it. This is why low-rank structure survives through
long chains of matrix operations, a fact Part III leans on heavily.
This is the second of the three sections MIT publishes in full. Read Strang’s version, then do step 1 above by hand. The columns-times-rows identity is worth being able to write from memory.