Math ยท Linear algebra
Compute products of two matrices and compare
Multiply the matrices and in both orders ( and ), and explain why .
- A
- [[1, 2], [3, 4]]
- B
- [[0, 1], [1, 0]]
- Number recomputed
Recomputed from the given data. (AB)_11: 1*0 + 2*1 = 2 matches. (AB)_12: 1*1 + 2*0 = 1 matches. (AB)_21: 3*0 + 4*1 = 4 matches. (AB)_22: 3*1 + 4*0 = 3 matches. (BA)_11: 0*1 + 1*3 = 3 matches. (BA)_12: 0*2 + 1*4 = 4 matches. (BA)_21: 1*1 + 0*3 = 1 matches. (BA)_22: 1*2 + 0*4 = 2 matches. - Steps not machine-checked
The computer algebra check could not read the formulas of this solution (words, units, or equations to solve are not checked). - A second model agrees
A second model solved it without seeing the first answer and got the same numbers: The dimensionless products are AB = [[2, 1], [4, 3]] and BA = [[3, 4], [1, 2]], so AB โ BA because their corresponding entries differ.
Solution
By the definition of matrix multiplication, each entry of the product is the dot product of row of with column of . Multiplying on the right by the permutation matrix swaps the columns of .
(1)Using the same row-by-column rule for the reverse order , each entry is the dot product of row of with column of . Multiplying on the left by the permutation matrix swaps the rows of .
(2)Comparing the corresponding entries of the two products shows that because matrix multiplication is not commutative in general: in the rows of pair with the columns of (swapping the columns of ), whereas in the rows of pair with the columns of (swapping the rows of ).
(3)
Answer
The products are AB = [[2, 1], [4, 3]] and BA = [[3, 4], [1, 2]], which are unequal because matrix multiplication is non-commutative (right-multiplying by B swaps the columns of A, while left-multiplying by B swaps the rows of A).