# How do you multiply ((2, 1, 0, 0), (3, 4, 2, 1), (-1, 0, 0, 1), (0, 1, 0, 0)) and ((1, 0, 0, 0), (0, 0, 1, 1), (1, 1, -1, 0), (1, 2, 3, 0))?

Jun 2, 2016

$\left(\begin{matrix}2 & 1 & 0 & 0 \\ 3 & 4 & 2 & 1 \\ - 1 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0\end{matrix}\right) \cdot \left(\begin{matrix}1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 1 & 1 & - 1 & 0 \\ 1 & 2 & 3 & 0\end{matrix}\right) = \left(\begin{matrix}2 & 0 & 1 & 1 \\ 6 & 4 & 5 & 4 \\ 0 & 2 & 3 & 0 \\ 0 & 0 & 1 & 1\end{matrix}\right)$.

#### Explanation:

The matrix multiplication is done raws by column. An example is better than thousand words.

Consider the first raw of the first matrix $\left(2 , 1 , 0 , 0\right)$ and the first column of the second matrix
$\left(\begin{matrix}1 \\ 0 \\ 1 \\ 1\end{matrix}\right)$

we multiply them element by element and we sum everything

$2 \cdot 1 + 1 \cdot 0 + 0 \cdot 1 + 0 \cdot 1 = 2$
This is the first element of our final matrix.
Now we repeat the same for each raw of the first matrix and each column of the second matrix.

$2 \cdot 0 + 1 \cdot 0 + 0 \cdot 1 + 0 \cdot 2 = 0$ (first raw, second column)
$2 \cdot 0 + 1 \cdot 1 + 0 \cdot \left(- 1\right) + 0 \cdot 3 = 1$ (first raw, third column)
$2 \cdot 0 + 1 \cdot 1 + 0 \cdot 0 + 0 \cdot 0 = 1$ (first raw, fourth column)

Then the first raw of the final matrix will read $\left(2 , 0 , 1 , 1\right)$

Second raw

$3 \cdot 1 + 4 \cdot 0 + 2 \cdot 1 + 1 \cdot 1 = 6$ (second raw, first column)
$3 \cdot 0 + 4 \cdot 0 + 2 \cdot 1 1 \cdot 2 = 4$ (second raw, second column)
$3 \cdot 0 + 4 \cdot 1 + 2 \cdot \left(- 1\right) + 1 \cdot 3 = 5$ (second raw, third column)
$3 \cdot 0 + 4 \cdot 1 + 2 \cdot 0 + 1 \cdot 0 = 4$ (second raw, fourth column)

The second raw of the final matrix will read $\left(6 , 4 , 5 , 4\right)$

Third raw

$- 1 \cdot 1 + 0 \cdot 0 + 0 \cdot 1 + 1 \cdot 1 = 0$ (third raw, first column)
$- 1 \cdot 0 + 0 \cdot 0 + 0 \cdot 1 + 1 \cdot 2 = 2$ (third raw, second column)
$- 1 \cdot 0 + 0 \cdot 1 + 0 \cdot \left(- 1\right) + 1 \cdot 3 = 3$ (third raw, third column)
$- 1 \cdot 0 + 0 \cdot 1 + 0 \cdot 0 + 1 \cdot 0 = 0$ (third raw, fourth column)

The third raw of the final matrix will read $\left(0 , 2 , 3 , 0\right)$

Fourth raw

$0 \cdot 1 + 1 \cdot 0 + 0 \cdot 1 + 0 \cdot 1 = 0$ (fourth raw, first column)
$0 \cdot 0 + 1 \cdot 0 + 0 \cdot 1 + 0 \cdot 2 = 0$ (fourth raw, second column)
$0 \cdot 0 + 1 \cdot 1 + 0 \cdot \left(- 1\right) + 0 \cdot 3 = 1$ (fourth raw, third column)
$0 \cdot 0 + 1 \cdot 1 + 0 \cdot 0 + 0 \cdot 0 = 1$ (fourth raw, fourth column)

The fourth raw of the final matrix will read $\left(0 , 0 , 1 , 1\right)$.

The product is then

$\left(\begin{matrix}2 & 1 & 0 & 0 \\ 3 & 4 & 2 & 1 \\ - 1 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0\end{matrix}\right) \cdot \left(\begin{matrix}1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 1 \\ 1 & 1 & - 1 & 0 \\ 1 & 2 & 3 & 0\end{matrix}\right) = \left(\begin{matrix}2 & 0 & 1 & 1 \\ 6 & 4 & 5 & 4 \\ 0 & 2 & 3 & 0 \\ 0 & 0 & 1 & 1\end{matrix}\right)$.