Matrix Multiplication
Simple Explanation
Multiplying two matrices is not done entry-by-entry like addition. Instead, each entry of the product AB comes from "dotting" a row of A with a column of B β multiplying corresponding entries and adding the results. Matrix multiplication is only defined when the number of columns of A equals the number of rows of B.
Why Do We Need It?
Matrix multiplication is the operation behind solving systems of equations, transforming coordinates (rotations, scalings), and combining sequences of linear operations β genuinely different, and far more powerful, than simply multiplying corresponding entries.
Formula
Matrix Multiplication
(AB)α΅’β±Ό = Ξ£β Aα΅’β Β· Bββ±Ό (row i of A "dotted" with column j of B)
Each entry of the product matrix AB comes from multiplying corresponding entries of a row of A with a column of B, and adding the results β matrix multiplication requires the number of columns of A to equal the number of rows of B.
- (AB)α΅’β±Ό
- β the entry of the product AB in row i, column j
- Aα΅’β
- β the entries along row i of matrix A
- Bββ±Ό
- β the entries down column j of matrix B
When to use it: Whenever two compatible matrices (columns of the first = rows of the second) need to be multiplied together.
Worked Example
Multiply two 2Γ2 matrices
Find AB, where A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]].
Why Does This Work?
This "row-dotted-with-column" rule is defined precisely because it mirrors how a system of linear equations transforms one set of variables into another β each output entry combines a full row's worth of one matrix's coefficients with a full column's worth of the other's values, exactly matching how substituting one linear expression into another combines terms.
Real-Life Example
Combining ingredient costs across recipes
One matrix lists how much of each ingredient several recipes need; another lists the cost of each ingredient. Multiplying them gives the total cost of each recipe.
Each recipe's total cost is exactly a "row dotted with a column" β quantities matched with costs and summed β precisely matrix multiplication.
Practice
For A = [[2, 0], [1, 3]] and B = [[4, 1], [2, 5]], find the (1,1) entry of AB.
HardCommon mistake
Multiplying matrices entry-by-entry (like addition) instead of using the row-times-column rule β matrix multiplication is a fundamentally different operation from addition, not just "addition with Γ instead of +."
Quick Review
- (AB)α΅’β±Ό = row i of A "dotted" with column j of B.
- Only defined when columns of A = rows of B.
- AB generally does NOT equal BA β matrix multiplication is not commutative.