Matrix Multiplication is NOT Commutative
AB and BA can give different matrices — even when both products exist.
Equation
y = x * (1*1 - 2*1)
Graph
Table
| x | y |
|---|---|
| 0 | 0 |
| 1 | -1 |
| 2 | -2 |
| 3 | -3 |
| 4 | -4 |
| 5 | -5 |
What this lesson covers
What you do
You shape the function y = x * (b*f - e*c) and watch the graph answer.
Challenges to clear
- Make AB ≠ BA: set b = 3, f = 2, e = 1, c = 2 — the gap (bf − ec) = 4, so the products differ. Check x = 1.
- A real, growing difference: at x = 2 the gap doubles to 8. Order MATTERS in matrix multiplication.
- Set the first product: b = 4 and f = 3, so bf is 12.
- Now choose e and c so the gap at x = 1 is exactly 8. AB and BA are different matrices — order MATTERS.
Check yourself
Why did the difference y stay at 0 for all slider values?
- Because the top-left entry calculation involves only scalar multiplication, which is commutative (a*d = d*a). — correct
- Because matrix multiplication is always commutative.
- Because the matrices A and B are identical.
- Because the function is broken.
Think about it
- (AB)₁₁ − (BA)₁₁ works out to b·f − e·c. Can you make it NON-zero?