Matrix Multiplication
Check Dimensions1 #
- Inner two numbers must match
- Outer two numbers = answer’s dim
Multiply #
Dot product2 each row in the 1st matrix with every column in the 2nd matrix.
First row, first column.
\[\begin{bmatrix} \color{red}{1} & \color{red}{2} & \color{red}{3} \\ 4 & 5 & 6 \end{bmatrix} \times \begin{bmatrix} \color{blue}{7} & 8 \\ \color{blue}{9} & 10 \\ \color{blue}{11} & 12 \\ \end{bmatrix} = \begin{bmatrix} \color{purple}{58} & ~~~~~ \\ ~~~ & \\ \end{bmatrix}\\\]First row, second column.
\[\begin{bmatrix} \color{red}{1} & \color{red}{2} & \color{red}{3} \\ 4 & 5 & 6 \end{bmatrix} \times \begin{bmatrix} 7 & \color{blue}{8} \\ 9 & \color{blue}{10} \\ 11 & \color{blue}{12} \\ \end{bmatrix} = \begin{bmatrix} 58 & \color{purple}{64} \\ ~~~ & \\ \end{bmatrix}\\\]Second row, first column.
\[\begin{bmatrix} 1 & 2 & 3 \\ \color{red}{4} & \color{red}{5} & \color{red}{6} \\ \end{bmatrix} \times \begin{bmatrix} \color{blue}{7} & 8 \\ \color{blue}{9} & 10 \\ \color{blue}{11} & 12 \\ \end{bmatrix} = \begin{bmatrix} 58 & 64 \\ \color{purple}{139} & \\ \end{bmatrix}\\\]Second row, second column.
\[\begin{bmatrix} 1 & 2 & 3 \\ \color{red}{4} & \color{red}{5} & \color{red}{6} \\ \end{bmatrix} \times \begin{bmatrix} 7 & \color{blue}{8} \\ 9 & \color{blue}{10} \\ 11 & \color{blue}{12} \\ \end{bmatrix} = \begin{bmatrix} 58 & 64 \\ 139 & \color{purple}{154} \\ \end{bmatrix}\\\]
Note: Dot product of red row and blue col = purple num