12. Find the product of matrices $A$ and $B$, if

$$
A=\left(\begin{array}{lll}
3 & 1 & 1 \\
2 & 1 & 2 \\
1 & 2 & 3
\end{array}\right), \quad B=\left(\begin{array}{rrr}
1 & 1 & -1 \\
2 & -1 & 1 \\
1 & 0 & 1
\end{array}\right)
$$
Solution. Let's find each element of the product matrix:

$$
\begin{aligned}
& c_{11}=a_{11} b_{11}+a_{12} b_{21}+a_{13} b_{31}=3 \cdot 1+1 \cdot 2+1 \cdot 1=6 \\
& c_{12}=a_{11} b_{12}+a_{12} b_{22}+a_{13} b_{32}=3 \cdot 1+1 \cdot(-1)+1 \cdot 0=2 \\
& c_{13}=a_{11} b_{13}+a_{12} b_{23}+a_{13} b_{33}=3 \cdot(-1)+1 \cdot 1+1 \cdot 1=-1 \\
& c_{21}=a_{21} b_{11}+a_{22} b_{21}+a_{23} b_{31}=2 \cdot 1+1 \cdot 2+2 \cdot 1=6 \\
& c_{22}=a_{21} b_{12}+a_{22} b_{22}+a_{23} b_{32}=2 \cdot 1+1 \cdot(-1)+2 \cdot 0=1 \\
& c_{23}=a_{21} b_{13}+a_{22} b_{23}+a_{23} b_{33}=2 \cdot(-1)+1 \cdot 1+2 \cdot 1=1 \\
& c_{31}=a_{31} b_{11}+a_{32} b_{21}+a_{33} b_{31}=1 \cdot 1+2 \cdot 2+3 \cdot 1=8 \\
& c_{32}=a_{31} b_{12}+a_{32} b_{22}+a_{33} b_{32}=1 \cdot 1+2 \cdot(-1)+3 \cdot 0=-1 \\
& c_{33}=a_{31} b_{13}+a_{32} b_{23}+a_{33} b_{33}=1 \cdot(-1)+2 \cdot 1+3 \cdot 1=4
\end{aligned}
$$

Therefore,

$$
C=\left(\begin{array}{rrr}
6 & 2 & -1 \\
6 & 1 & 1 \\
8 & -1 & 4
\end{array}\right)
$$

13-15. Find the products of the matrices: