Matrix Multiplication is Not Commutative
What You'll Learn
You'll discover that changing the order of matrices in multiplication usually changes the result—a surprising difference from multiplying ordinary numbers.
The Core Idea
When you multiply two numbers, order doesn't matter: 3 × 5 = 5 × 3 = 15. This property is called commutativity. However, with matrices, order matters tremendously. In general, if A and B are matrices, then AB ≠ BA. Sometimes AB exists but BA doesn't (due to incompatible dimensions), and even when both products exist, they're usually different matrices!
Example 1: Different Results
Let:
A = [1 2] B = [5 6]
[3 4] [7 8]
Computing AB:
AB = [1·5+2·7 1·6+2·8] = [19 22]
[3·5+4·7 3·6+4·8] [43 50]
Computing BA:
BA = [5·1+6·3 5·2+6·4] = [23 34]
[7·1+8·3 7·2+8·4] [31 46]
Notice: AB ≠ BA! The entries are completely different.
Example 2: One Product Exists, the Other Doesn't
If A is 2×3 and B is 3×2:
- AB exists (result is 2×2)
- BA exists (result is 3×3)
- They're different sizes, so certainly not equal!
Why It Happens
Matrix multiplication involves combining rows of the first matrix with columns of the second. Reversing the order means you're pairing different rows with different columns—essentially performing a completely different calculation.
Key Takeaway: Matrix multiplication is not commutative: AB ≠ BA in general. Always pay careful attention to the order when multiplying matrices.