Matrix Multiplication: Rows Times Columns
Problem
Compute AB for A = [[1,2],[3,4]] and B = [[5,6],[7,8]]. Show each entry as a row-column dot product.
Explanation
The rule
For of size and of size , the product has size , with entries
In words: is the dot product of row of with column of .
The "inner dimension" must match — otherwise the product is undefined.
Step-by-step
Setup: , . Both , product is .
Compute each entry:
= row 1 of · column 1 of :
= row 1 of · column 2 of :
= row 2 of · column 1 of :
= row 2 of · column 2 of :
Matrix multiplication is NOT commutative
In general . They can even have different shapes (e.g. is , is : is , but is ).
Properties (what IS true)
- Associative: .
- Distributive: and .
- Identity: with the appropriately-sized identity matrix.
- Transpose swap: .
Geometric interpretation
Matrix represents a linear transformation. The product represents the composition — first apply , then apply . This naturally explains why matrix multiplication is associative (composition is) but not commutative (order of transformations matters).
Common mistakes
- Row-times-row or column-times-column. The rule is row (of ) times column (of ), period.
- Assuming . Matrix multiplication rarely commutes.
- Ignoring shape mismatches. A times a is not defined — inner dimensions ( and ) don't match.
- Claiming or . False in general: two nonzero matrices can multiply to zero (they're "zero divisors").
Try it in the visualization
The row of and the column of highlight as each entry of is computed. Their element-wise products add up live to produce each output entry.
Interactive Visualization
Parameters
Got your own math or physics problem?
Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.