maths.freeLinear Algebra › Matrix multiplication

Matrix multiplication

Rows times columns, entry by entry.

Entry (i, j) of AB is row i of A dotted with column j of B, which is why the inner dimensions must match. Every entry is computed in the open below. Matrix multiplication is composition of transformations, which is why it is not commutative.

Worked example: [[1,2],[3,4]] * [[5,6],[7,8]]

[[1,2],[3,4]] * [[5,6],[7,8]]

\left[\begin{matrix}1 & 2\\3 & 4\end{matrix}\right] \left[\begin{matrix}5 & 6\\7 & 8\end{matrix}\right]

Step by step

  1. \left[\begin{matrix}1 & 2\\3 & 4\end{matrix}\right] \left[\begin{matrix}5 & 6\\7 & 8\end{matrix}\right]

    A 2×2 times a 2×2 gives a 2×2 matrix. Entry (i, j) is row i of A dotted with column j of B.

  2. c_{11} = (1)(5) + (2)(7) = 19

  3. c_{12} = (1)(6) + (2)(8) = 22

  4. c_{21} = (3)(5) + (4)(7) = 43

  5. c_{22} = (3)(6) + (4)(8) = 50

  6. AB = \left[\begin{matrix}19 & 22\\43 & 50\end{matrix}\right]

Reveal the answer
AB = \left[\begin{matrix}19 & 22\\43 & 50\end{matrix}\right]

Try your own

More in Linear Algebra