Matrix Multiplication

Check Dimensions #

  1. Inner two numbers must match1
  2. Outer two numbers = answer’s dimensions
\[(\underbrace{2 \times \underbrace{3) \times (3}_{\text{must match}} \times 2}_{\text{answer's dimensions}})\]

Multiply #

Dot product2 each row in the 1st matrix with every column in the 2nd matrix.

  1. First row, first column.
    \[\begin{bmatrix} \color{#c2620a}{1} & \color{#c2620a}{2} & \color{#c2620a}{3} \\ 4 & 5 & 6 \end{bmatrix} \times \begin{bmatrix} \color{#3b82f6}{7} & 8 \\ \color{#3b82f6}{9} & 10 \\ \color{#3b82f6}{11} & 12 \\ \end{bmatrix} = \begin{bmatrix} \color{#8b5cf6}{58} & ~~~~~ \\ ~~~ & \\ \end{bmatrix}\\\]

  2. First row, second column.
    \[\begin{bmatrix} \color{#c2620a}{1} & \color{#c2620a}{2} & \color{#c2620a}{3} \\ 4 & 5 & 6 \end{bmatrix} \times \begin{bmatrix} 7 & \color{#3b82f6}{8} \\ 9 & \color{#3b82f6}{10} \\ 11 & \color{#3b82f6}{12} \\ \end{bmatrix} = \begin{bmatrix} 58 & \color{#8b5cf6}{64} \\ ~~~ & \\ \end{bmatrix}\\\]

  3. Second row, first column.
    \[\begin{bmatrix} 1 & 2 & 3 \\ \color{#c2620a}{4} & \color{#c2620a}{5} & \color{#c2620a}{6} \\ \end{bmatrix} \times \begin{bmatrix} \color{#3b82f6}{7} & 8 \\ \color{#3b82f6}{9} & 10 \\ \color{#3b82f6}{11} & 12 \\ \end{bmatrix} = \begin{bmatrix} 58 & 64 \\ \color{#8b5cf6}{139} & \\ \end{bmatrix}\\\]

  4. Second row, second column.
    \[\begin{bmatrix} 1 & 2 & 3 \\ \color{#c2620a}{4} & \color{#c2620a}{5} & \color{#c2620a}{6} \\ \end{bmatrix} \times \begin{bmatrix} 7 & \color{#3b82f6}{8} \\ 9 & \color{#3b82f6}{10} \\ 11 & \color{#3b82f6}{12} \\ \end{bmatrix} = \begin{bmatrix} 58 & 64 \\ 139 & \color{#8b5cf6}{154} \\ \end{bmatrix}\\\]

Note: Dot product of orange row and blue col = purple num


  1. Dimension = \((\#\text{rows}, \#\text{columns})\)  ↩︎

  2. Dot product formula ↩︎


July 25, 2020
categories: Math
tags: Matrix, Dimensions