AB and BA can differ
Matrix multiplication is not commutative.
Number rules
For numbers, 2 × 3 = 3 × 2, and ab = 0 means a = 0 or b = 0.
Do these rules hold for matrices?
What this lesson covers
The idea
Even when AB and BA are both defined, AB need not equal BA; and the product of two non-zero matrices can be the zero matrix, unlike real numbers.
Number rules
For numbers, 2 × 3 = 3 × 2, and ab = 0 means a = 0 or b = 0.
Do these rules hold for matrices?
- Both hold
- Neither always holds
- Only the first holds
Two surprises
Compare AB with BA.
Now multiply two non-zero matrices.
Not like numbers
Even when AB and BA are both defined, AB need not equal BA. And the product of two non-zero matrices can be the zero matrix.
This does not mean AB ≠ BA always: for the diagonal matrices [[1, 0], [0, 2]] and [[3, 0], [0, 4]], AB = BA = [[3, 0], [0, 8]].
Notes
AB ≠ BA in general, and AB = O does not force A = O or B = O.
Check yourself
A is 2 × 3 and B is 3 × 2. Which is true?
AB = O. What can you conclude?
For which pair is AB = BA guaranteed?
- AB = BA. AB is 2 × 2 but BA is 3 × 3.
- AB is 2 × 2 and BA is 3 × 3, so AB ≠ BA — correct. Right. They even have different orders.
- Only AB is defined. BA is (3 × 2)(2 × 3) = 3 × 3, also defined.
- A = O or B = O. That is true for numbers, not for matrices.
- A = B. There is no such rule.
- Nothing: A and B may both be non-zero — correct. Right, as the second toy showed.
- Two diagonal matrices of the same order — correct. Yes. Diagonal matrices of the same order commute.
- Any two square matrices. The first toy showed two square matrices with AB ≠ BA.
- Any A and B with AB defined. BA may not even be defined.