# How do you multiply matrices A =((1, 2, 1), (-1, -1, 2), (-1, 1, -2)) and B=((1, -1), (0, -1), (-1, 1))?

Sep 23, 2016

"A X B" = ((" "0,-2),(-3, " "4),(" "1,-2))

#### Explanation:

Before you can multiply matrices, you have to check that they are compatible, Matrices are named according to the number of rows (horizontal) and columns (vertical).

A is a $3 \times 3$ matrix read as "3 by 3"
and B is a $3 \times 2$ matrix - "3 by 2"

$A \times B$ means $\textcolor{b l u e}{3} \times \textcolor{red}{3}$ and $\textcolor{red}{3} \times \textcolor{b l u e}{2}$

This is only possible if the middle 2 numbers are the same
- in this case shown in $\textcolor{red}{\text{red}}$

The answer will be a $\textcolor{b l u e}{3 \times 2}$ matrix - (the outer numbers)

Each ROW in A must be multiplied by each COLUMN in B.
This involves multiplying the elements in the row by the elements in B and adding them together to get a single answer.

$\text{A X B} = \left(\begin{matrix}1 & 2 & 1 \\ - 1 & - 1 & 2 \\ - 1 & 1 & - 2\end{matrix}\right) \left(\begin{matrix}1 & - 1 \\ 0 & - 1 \\ - 1 & 1\end{matrix}\right)$

$\left(1 , 2 , 1\right) \text{ must be multiplied by } \left(1 , 0 , - 1\right)$
This gives: $1 + 0 - 1 = 0 \text{ } \leftarrow$ 1st row, 1st column .

$\left(- 1 , - 1 , 2\right) \text{ multiplied by } \left(1 , 0 , - 1\right)$
This gives $- 1 + 0 - 2 = - 3 \text{ } \leftarrow$ 2nd row, 1st column

$\left(- 1 , 1 , - 2\right) \text{ multiplied by } \left(1 , 0 , - 1\right)$
This gives $- 1 + 0 + 2 = 1 \text{ } \leftarrow$ 3rd row, 1st column

$\left(1 , 2 , 1\right) \text{ multiplied by } \left(- 1 , - 1 , 1\right)$
This gives $- 1 - 2 + 1 = - 2 \text{ } \leftarrow$1st row 2nd column

(-1,-1,2) " multiplied by " (-1,-1,1
This gives $1 + 1 + 2 = 4 \text{ } \leftarrow$ 2nd row 2nd column

$\left(- 1 , 1 , - 2\right) \text{ multiplied by } \left(- 1 , - 1 , 1\right)$
This gives $1 - 1 - 2 = - 2 \text{ } \leftarrow$ 3rd row 2nd column

"A X B" = ((" "0,-2),(-3, " "4),(" "1,-2))