Matrix Multiplication
Check Dimensions #
- Inner two numbers must match1
- Outer two numbers = answer’s dimensions
Multiply #
Dot product2 each row in the 1st matrix with every column in the 2nd matrix.
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}\\\]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}\\\]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}\\\]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