Matrix Multiplication

Digital Handwritten Lesson

Matrix Multiplication | Grade 9 Optional Mathematics | NMA
  • Any whole, natural, rational, irrational, or integer numbers can be multiplied with any other number.
  • The same is NOT true with matrices — not every pair of matrices can be multiplied.
  • Only compatible matrices can be multiplied together.

So, how do we know which matrices are compatible?

Activity

Consider the following two matrices:

\[ A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}_{3\times3} \qquad B = \begin{bmatrix} 10 & 12 \\ 11 & 13 \\ 14 & 15 \end{bmatrix}_{3\times2} \]
  • Matrix \(A\) has 3 columns
  • Matrix \(B\) has 3 rows

∴ No. of columns in \(A\) = No. of rows in \(B\)  (both = 3)

\(A\)
\(3 \times \mathbf{3}\)
3 columns
✓ MATCH
\(B\)
\(\mathbf{3} \times 2\)
3 rows
→ Product
\(AB\)
\(3 \times 2\)
Conclusion

Since no. of columns of \(A\) equals no. of rows of \(B\), the product \(AB\) exists. Hence \(A\) and \(B\) are compatible matrices for the product \(AB\).

Definition — Compatible Matrices

Two matrices which can be multiplied together are called Compatible Matrices.

Compatibility Condition:

\[ \text{No. of columns in the } 1^{\text{st}} \text{ matrix} = \text{No. of rows in the } 2^{\text{nd}} \text{ matrix} \]

Order of the Product Matrix:

Rows of \(A\)
from 1st matrix
×
Cols of \(B\)
from 2nd matrix
=
Order of \(AB\)
product matrix
Example Multiplication of \(1\times1\) Matrices \(1\times1 \;\times\; 1\times1 \;\to\; 1\times1\)
\[ A = [1],\quad B = [2] \] \[ AB = [1] \times [2] = [1\times2] = [2]_{1\times1} \]
Example Multiplication of \(2\times2\) Matrices \(2\times2 \;\times\; 2\times2 \;\to\; 2\times2\)
\[ A = \begin{bmatrix}1 & 2\\3 & 4\end{bmatrix}_{2\times2} \qquad B = \begin{bmatrix}4 & 5\\6 & 7\end{bmatrix}_{2\times2} \qquad AB = \begin{bmatrix}ab_{11} & ab_{12}\\ab_{21} & ab_{22}\end{bmatrix}_{2\times2} \]

Finding each element (row of A · column of B):

  • \(ab_{11}\) = \(1^{\text{st}}\) row of \(A\) · \(1^{\text{st}}\) col of \(B\) \(= 1\times4 + 2\times6 = 4+12 = \mathbf{16}\)
  • \(ab_{12}\) = \(1^{\text{st}}\) row of \(A\) · \(2^{\text{nd}}\) col of \(B\) \(= 1\times5 + 2\times7 = 5+14 = \mathbf{19}\)
  • \(ab_{21}\) = \(2^{\text{nd}}\) row of \(A\) · \(1^{\text{st}}\) col of \(B\) \(= 3\times4 + 4\times6 = 12+24 = \mathbf{36}\)
  • \(ab_{22}\) = \(2^{\text{nd}}\) row of \(A\) · \(2^{\text{nd}}\) col of \(B\) \(= 3\times5 + 4\times7 = 15+28 = \mathbf{43}\)
\[ AB = \begin{bmatrix}4+12 & 5+14\\12+24 & 15+28\end{bmatrix} = \begin{bmatrix}16 & 19\\36 & 43\end{bmatrix}_{2\times2} \]
Example Multiplication of \(2\times2\) and \(2\times1\) \(2\times2 \;\times\; 2\times1 \;\to\; 2\times1\)
\[ A = \begin{bmatrix}1 & 2\\3 & 4\end{bmatrix}_{2\times2} \qquad B = \begin{bmatrix}5\\6\end{bmatrix}_{2\times1} \qquad AB = \begin{bmatrix}ab_{11}\\ab_{21}\end{bmatrix}_{2\times1} \]
  • \(ab_{11} = 1\times5 + 2\times6 = 5+12 = \mathbf{17}\)
  • \(ab_{21} = 3\times5 + 4\times6 = 15+24 = \mathbf{39}\)
\[ AB = \begin{bmatrix}1\times5+2\times6\\3\times5+4\times6\end{bmatrix} = \begin{bmatrix}17\\39\end{bmatrix}_{2\times1} \]
Example Multiplication of \(3\times1\) and \(1\times3\) \(3\times1 \;\times\; 1\times3 \;\to\; 3\times3\)
\[ A = \begin{bmatrix}1\\2\\3\end{bmatrix}_{3\times1} \qquad B = \begin{bmatrix}4 & 5 & 6\end{bmatrix}_{1\times3} \]
  • \(ab_{11}=1\times4=4,\quad ab_{12}=1\times5=5,\quad ab_{13}=1\times6=6\)
  • \(ab_{21}=2\times4=8,\quad ab_{22}=2\times5=10,\quad ab_{23}=2\times6=12\)
  • \(ab_{31}=3\times4=12,\quad ab_{32}=3\times5=15,\quad ab_{33}=3\times6=18\)
\[ AB = \begin{bmatrix}4&5&6\\8&10&12\\12&15&18\end{bmatrix}_{3\times3} \]
Example Multiplication of \(1\times2\) and \(2\times1\) \(1\times2 \;\times\; 2\times1 \;\to\; 1\times1\)
\[ A = \begin{bmatrix}4 & 6\end{bmatrix}_{1\times2} \qquad B = \begin{bmatrix}5\\6\end{bmatrix}_{2\times1} \]
\[ AB = \begin{bmatrix}4 & 6\end{bmatrix}\begin{bmatrix}5\\6\end{bmatrix} = [4\times5 + 6\times6] = [20+36] = [56]_{1\times1} \]
Example Multiplication of \(1\times2\) and \(2\times2\) \(1\times2 \;\times\; 2\times2 \;\to\; 1\times2\)
\[ A = \begin{bmatrix}6 & 7\end{bmatrix}_{1\times2} \qquad B = \begin{bmatrix}1 & 2\\4 & 5\end{bmatrix}_{2\times2} \]
\[ AB = \begin{bmatrix}6\times1+7\times4 & 6\times2+7\times5\end{bmatrix} = \begin{bmatrix}6+28 & 12+35\end{bmatrix} = \begin{bmatrix}34 & 47\end{bmatrix}_{1\times2} \]
1
Matrix Multiplication is NOT Commutative ✗ Does NOT hold
\(AB \neq BA\) in general
\[ A = \begin{bmatrix}1&2\\3&4\end{bmatrix} \qquad B = \begin{bmatrix}5&6\\7&8\end{bmatrix} \]
Compute \(AB\)
\[ AB = \begin{bmatrix}1\times5+2\times7 & 1\times6+2\times8\\3\times5+4\times7 & 3\times6+4\times8\end{bmatrix} = \begin{bmatrix}19&22\\43&50\end{bmatrix} \]
Compute \(BA\)
\[ BA = \begin{bmatrix}5\times1+6\times3 & 5\times2+6\times4\\7\times1+8\times3 & 7\times2+8\times4\end{bmatrix} = \begin{bmatrix}23&34\\31&46\end{bmatrix} \]
Conclusion
\[ AB = \begin{bmatrix}19&22\\43&50\end{bmatrix} \neq \begin{bmatrix}23&34\\31&46\end{bmatrix} = BA \]

∴ \(AB \neq BA\) — Matrix multiplication is NOT commutative.

2
Matrix Multiplication is Associative ✓ Holds
\(A(BC) = (AB)C\)
\[ A = \begin{bmatrix}1&2\\3&4\end{bmatrix} \qquad B = \begin{bmatrix}5&6\\7&8\end{bmatrix} \qquad C = \begin{bmatrix}4&8\\6&7\end{bmatrix} \]
1
Find \(BC\)
\[ BC = \begin{bmatrix}5\times4+6\times6 & 5\times8+6\times7\\7\times4+8\times6 & 7\times8+8\times7\end{bmatrix} = \begin{bmatrix}56&82\\76&112\end{bmatrix} \]
2
Find \(A(BC)\)
\[ A(BC) = \begin{bmatrix}1&2\\3&4\end{bmatrix}\begin{bmatrix}56&82\\76&112\end{bmatrix} = \begin{bmatrix}208&306\\472&694\end{bmatrix} \]
3
Find \(AB\) (from Property 1)
\[ AB = \begin{bmatrix}19&22\\43&50\end{bmatrix} \]
4
Find \((AB)C\)
\[ (AB)C = \begin{bmatrix}19&22\\43&50\end{bmatrix}\begin{bmatrix}4&8\\6&7\end{bmatrix} = \begin{bmatrix}208&306\\472&694\end{bmatrix} \]
Conclusion
\[ \therefore\; A(BC) = (AB)C = \begin{bmatrix}208&306\\472&694\end{bmatrix} \]

Matrix multiplication satisfies the Associative Property.

3
Matrix Multiplication is Distributive ✓ Holds
\(A(B+C) = AB + AC\)
\[ A = \begin{bmatrix}1&2\\3&4\end{bmatrix} \qquad B = \begin{bmatrix}5&6\\7&8\end{bmatrix} \qquad C = \begin{bmatrix}4&8\\6&7\end{bmatrix} \]
LHS — Find \(A(B+C)\)
\[ B+C = \begin{bmatrix}9&14\\13&15\end{bmatrix} \] \[ A(B+C) = \begin{bmatrix}1&2\\3&4\end{bmatrix}\begin{bmatrix}9&14\\13&15\end{bmatrix} = \begin{bmatrix}35&44\\79&102\end{bmatrix} \]
RHS — Find \(AB + AC\)
\[ AB = \begin{bmatrix}19&22\\43&50\end{bmatrix},\quad AC = \begin{bmatrix}16&22\\36&52\end{bmatrix} \] \[ AB+AC = \begin{bmatrix}35&44\\79&102\end{bmatrix} \]
Conclusion
\[ \therefore\; A(B+C) = AB+AC = \begin{bmatrix}35&44\\79&102\end{bmatrix} \]

Matrix multiplication satisfies the Distributive Property.

4
Multiplicative Identity ✓ Holds
\(AI = IA = A\)
\[ A = \begin{bmatrix}1&2\\3&4\end{bmatrix} \qquad I = \begin{bmatrix}1&0\\0&1\end{bmatrix} \]
Compute \(AI\)
\[ AI = \begin{bmatrix}1\times1+2\times0 & 1\times0+2\times1\\3\times1+4\times0 & 3\times0+4\times1\end{bmatrix} = \begin{bmatrix}1&2\\3&4\end{bmatrix} \]
Compute \(IA\)
\[ IA = \begin{bmatrix}1\times1+0\times3 & 1\times2+0\times4\\0\times1+1\times3 & 0\times2+1\times4\end{bmatrix} = \begin{bmatrix}1&2\\3&4\end{bmatrix} \]
Conclusion

\(AI = IA = A\)
The Identity Matrix \(I\) acts like the number 1 in ordinary multiplication.

5
Transpose of a Product (Reversal Rule) ✓ Holds
\((AB)^t = B^t A^t\)
\[ A = \begin{bmatrix}1&2\\3&4\end{bmatrix} \qquad B = \begin{bmatrix}5&6\\7&8\end{bmatrix} \]
1
Find \((AB)^t\)
\[ AB = \begin{bmatrix}19&22\\43&50\end{bmatrix} \implies (AB)^t = \begin{bmatrix}19&43\\22&50\end{bmatrix} \]
2
Find \(B^t A^t\)
\[ A^t = \begin{bmatrix}1&3\\2&4\end{bmatrix} \qquad B^t = \begin{bmatrix}5&7\\6&8\end{bmatrix} \] \[ B^t A^t = \begin{bmatrix}5&7\\6&8\end{bmatrix}\begin{bmatrix}1&3\\2&4\end{bmatrix} = \begin{bmatrix}5+14 & 15+28\\6+16 & 18+32\end{bmatrix} = \begin{bmatrix}19&43\\22&50\end{bmatrix} \]
Conclusion
\[ \therefore\; (AB)^t = B^t A^t = \begin{bmatrix}19&43\\22&50\end{bmatrix} \]

The Reversal Rule for Transpose is verified.

Property Statement Holds?
Commutative \(AB = BA\) ✗ No
Associative \(A(BC) = (AB)C\) ✓ Yes
Distributive \(A(B+C) = AB+AC\) ✓ Yes
Multiplicative Identity \(AI = IA = A\) ✓ Yes
Transpose (Reversal) \((AB)^t = B^t A^t\) ✓ Yes
⚠️ Key Takeaway: Matrix multiplication is not commutative — always check whether \(AB\) and \(BA\) are even defined before computing. The compatibility condition must be verified for each product separately.

New Millennium Academy  ·  Pokhara-17, Birauta, Kaski  ·  Grade 9 Optional Mathematics, 2082 B.S.

Matrix Multiplication  |  Unit: Matrices

← Return to Chapter

Course material curated by Mr. Nripendraswar Acharya