Example 1
Question: Let \[A = \begin{bmatrix} 2 & 1 & 0 \\ 0 & 3 & 1 \\ 1 & 0 & 2 \end{bmatrix}, \quad B = \begin{bmatrix} 1 & 0 & 2 \\ 3 & 1 & 0 \\ 0 & 2 & 1 \end{bmatrix}.\] Show that \( AB \ne BA \).
Solution: We compute AB first. Row 1 of A times columns of B: Entry (1,1): \( 2(1) + 1(3) + 0(0) = 2 + 3 + 0 = 5 \) Entry (1,2): \( 2(0) + 1(1) + 0(2) = 0 + 1 + 0 = 1 \) Entry (1,3): \( 2(2) + 1(0) + 0(1) = 4 + 0 + 0 = 4 \) Row 2 of A times columns of B: Entry (2,1): \( 0(1) + 3(3) + 1(0) = 0 + 9 + 0 = 9 \) Entry (2,2): \( 0(0) + 3(1) + 1(2) = 0 + 3 + 2 = 5 \) Entry (2,3): \( 0(2) + 3(0) + 1(1) = 0 + 0 + 1 = 1 \) Row 3 of A times columns of B: Entry (3,1): \( 1(1) + 0(3) + 2(0) = 1 + 0 + 0 = 1 \) Entry (3,2): \( 1(0) + 0(1) + 2(2) = 0 + 0 + 4 = 4 \) Entry (3,3): \( 1(2) + 0(0) + 2(1) = 2 + 0 + 2 = 4 \) Therefore: \[AB = \begin{bmatrix} 5 & 1 & 4 \\ 9 & 5 & 1 \\ 1 & 4 & 4 \end{bmatrix}\] Now we compute BA. Row 1 of B times columns of A: Entry (1,1): \( 1(2) + 0(0) + 2(1) = 2 + 0 + 2 = 4 \) Entry (1,2): \( 1(1) + 0(3) + 2(0) = 1 + 0 + 0 = 1 \) Entry (1,3): \( 1(0) + 0(1) + 2(2) = 0 + 0 + 4 = 4 \) Row 2 of B times columns of A: Entry (2,1): \( 3(2) + 1(0) + 0(1) = 6 + 0 + 0 = 6 \) Entry (2,2): \( 3(1) + 1(3) + 0(0) = 3 + 3 + 0 = 6 \) Entry (2,3): \( 3(0) + 1(1) + 0(2) = 0 + 1 + 0 = 1 \) Row 3 of B times columns of A: Entry (3,1): \( 0(2) + 2(0) + 1(1) = 0 + 0 + 1 = 1 \) Entry (3,2): \( 0(1) + 2(3) + 1(0) = 0 + 6 + 0 = 6 \) Entry (3,3): \( 0(0) + 2(1) + 1(2) = 0 + 2 + 2 = 4 \) Therefore: \[BA = \begin{bmatrix} 4 & 1 & 4 \\ 6 & 6 & 1 \\ 1 & 6 & 4 \end{bmatrix}\] Comparing the (1,1) entries: the entry in AB is 5, while the entry in BA is 4. Since \( 5 \ne 4 \), the matrices AB and BA differ. Hence \( AB \ne BA \).
Answer: \[AB = \begin{bmatrix} 5 & 1 & 4 \\ 9 & 5 & 1 \\ 1 & 4 & 4 \end{bmatrix} \ne \begin{bmatrix} 4 & 1 & 4 \\ 6 & 6 & 1 \\ 1 & 6 & 4 \end{bmatrix} = BA\]
Example 2
Question: Let \[P = \begin{bmatrix} 0 & 1 & 2 \\ 1 & 0 & 3 \\ 2 & 1 & 0 \end{bmatrix}, \quad Q = \begin{bmatrix} 1 & 2 & 0 \\ 0 & 1 & 3 \\ 1 & 0 & 2 \end{bmatrix}.\] Show that \( PQ \ne QP \).
Solution: We first compute PQ. Row 1 of P times columns of Q: Entry (1,1): \( 0(1) + 1(0) + 2(1) = 0 + 0 + 2 = 2 \) Entry (1,2): \( 0(2) + 1(1) + 2(0) = 0 + 1 + 0 = 1 \) Entry (1,3): \( 0(0) + 1(3) + 2(2) = 0 + 3 + 4 = 7 \) Row 2 of P times columns of Q: Entry (2,1): \( 1(1) + 0(0) + 3(1) = 1 + 0 + 3 = 4 \) Entry (2,2): \( 1(2) + 0(1) + 3(0) = 2 + 0 + 0 = 2 \) Entry (2,3): \( 1(0) + 0(3) + 3(2) = 0 + 0 + 6 = 6 \) Row 3 of P times columns of Q: Entry (3,1): \( 2(1) + 1(0) + 0(1) = 2 + 0 + 0 = 2 \) Entry (3,2): \( 2(2) + 1(1) + 0(0) = 4 + 1 + 0 = 5 \) Entry (3,3): \( 2(0) + 1(3) + 0(2) = 0 + 3 + 0 = 3 \) Therefore: \[PQ = \begin{bmatrix} 2 & 1 & 7 \\ 4 & 2 & 6 \\ 2 & 5 & 3 \end{bmatrix}\] Now we compute QP. Row 1 of Q times columns of P: Entry (1,1): \( 1(0) + 2(1) + 0(2) = 0 + 2 + 0 = 2 \) Entry (1,2): \( 1(1) + 2(0) + 0(1) = 1 + 0 + 0 = 1 \) Entry (1,3): \( 1(2) + 2(3) + 0(0) = 2 + 6 + 0 = 8 \) Row 2 of Q times columns of P: Entry (2,1): \( 0(0) + 1(1) + 3(2) = 0 + 1 + 6 = 7 \) Entry (2,2): \( 0(1) + 1(0) + 3(1) = 0 + 0 + 3 = 3 \) Entry (2,3): \( 0(2) + 1(3) + 3(0) = 0 + 3 + 0 = 3 \) Row 3 of Q times columns of P: Entry (3,1): \( 1(0) + 0(1) + 2(2) = 0 + 0 + 4 = 4 \) Entry (3,2): \( 1(1) + 0(0) + 2(1) = 1 + 0 + 2 = 3 \) Entry (3,3): \( 1(2) + 0(3) + 2(0) = 2 + 0 + 0 = 2 \) Therefore: \[QP = \begin{bmatrix} 2 & 1 & 8 \\ 7 & 3 & 3 \\ 4 & 3 & 2 \end{bmatrix}\] Comparing entry (1,3): in PQ it is 7, while in QP it is 8. Since \( 7 \ne 8 \), we conclude \( PQ \ne QP \).
Answer: \[PQ = \begin{bmatrix} 2 & 1 & 7 \\ 4 & 2 & 6 \\ 2 & 5 & 3 \end{bmatrix} \ne \begin{bmatrix} 2 & 1 & 8 \\ 7 & 3 & 3 \\ 4 & 3 & 2 \end{bmatrix} = QP\]