Maths WorkshopMaths problems with full solutions
Exercise 508Linear algebra › Matrices and linear systemsHigh schoolAdded 3 Nov 2026

Matrix multiplication

#matrix multiplication#non-commutativity

Statement

Let
A=(1234),B=(201−1).A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, \qquad B = \begin{pmatrix} 2 & 0 \\ 1 & -1 \end{pmatrix}.
Compute ABAB and BABA. Are they equal?

Hint

The entry (i,j)(i,j) of ABAB is the dot product of row ii of AA with column jj of BB.

Show solutionHide solution

Solution

Product ABAB.
AB=(1⋅2+2⋅11⋅0+2⋅(−1)3⋅2+4⋅13⋅0+4⋅(−1))=(4−210−4).AB = \begin{pmatrix} 1\cdot2+2\cdot1 & 1\cdot0+2\cdot(-1) \\ 3\cdot2+4\cdot1 & 3\cdot0+4\cdot(-1) \end{pmatrix} = \begin{pmatrix} 4 & -2 \\ 10 & -4 \end{pmatrix}.

Product BABA.
BA=(2⋅1+0⋅32⋅2+0⋅41⋅1+(−1)⋅31⋅2+(−1)⋅4)=(24−2−2).BA = \begin{pmatrix} 2\cdot1+0\cdot3 & 2\cdot2+0\cdot4 \\ 1\cdot1+(-1)\cdot3 & 1\cdot2+(-1)\cdot4 \end{pmatrix} = \begin{pmatrix} 2 & 4 \\ -2 & -2 \end{pmatrix}.

Conclusion. AB≠BAAB \neq BA: matrix multiplication is not commutative.