Matrix matrix multiplication is an extension of matrix vector multiplication in the following way. As long as the number of columns of \(A\) matches the number of rows of \(C\text{,}\) the product \(AC\) can be computed.
Definition2.1.1.Matrix-matrix multiplication.
Given matrices \(A\) and \(C\text{,}\) we form their product \(AC\) by first writing \(C\) in terms of its columns
Suppose \(A\) has 3 rows and \(C \) has 2 columns. Then
\begin{equation*}
AC = \left[\begin{array}{rrrr}
A\cvec_1 \amp A\cvec_2
\end{array}\right].
\end{equation*}
Since each column of the product \(AC\) is a matrix vector product, we can also view \(AC\) in terms of dot products. That is letting by viewing rows of the matrix \(A\) as vectors; call the first row \(\rvec_1\text{,}\) and the second row \(\rvec_2\text{.}\) We have that the matrix vector product \(A\cvec_1=\left[\begin{array}{r}\rvec_1 \cdot \cvec_1 \\ \rvec_2\cdot \cvec_1 \\ \rvec_3 \cdot \cvec_1 \\ \end{array}\right]\) Similarly the matrix vector product \(A\cvec_2=\left[\begin{array}{r}\rvec_1 \cdot \cvec_2 \\ \rvec_2\cdot \cvec_2 \\ \rvec_3 \cdot \cvec_2 \\ \end{array}\right]\)
Since
\begin{equation*}
AC = \left[\begin{array}{rrrr}
A\cvec_1 \amp A\cvec_2
\end{array}\right].
\end{equation*}
Therefore in terms of dot products, the entry in the first row, first column of \(AC\) is the dot product \(\rvec_1\cdot \cvec_1\text{,}\) the entry in the second row, first column is the dot product \(\rvec_2\cdot \cvec_1\text{,}\) the entry in the 3rd row first column is the dot product \(\rvec_3\cdot \cvec_1\text{.}\) Moving to the second column, we have the entry in the the first row second column is the the dot product \(\rvec_1\cdot \cvec_2\text{,}\) the entry in the second row, second column is the dot product \(\rvec_2\cdot \cvec_2\text{,}\) the entry in the 3rd row second column is just the dot product \(\rvec_3\cdot \cvec_2\text{.}\)
Before computing, first explain why the shapes of \(A\) and \(C\) enable us to form the product \(AC\text{.}\) Then describe the shape of \(AC\text{.}\)
Compute the product \(AC\text{.}\)
Sage can multiply matrices using the * operator. Define the matrices \(A\) and \(B\) in the Sage cell below and check your work by computing \(AB\text{.}\)
Are we able to form the matrix product \(BA\text{?}\) If so, use the Sage cell above to find \(BA\text{.}\) Is it generally true that \(AB = BA\text{?}\)
Compute the folowing produts by hand: \(AB\text{,}\)\(BA\text{,}\)\(AC\text{,}\)\(CA\text{,}\)\(CB\text{,}\)\(BC\text{,}\)\(CC\text{,}\) and \(CCC\text{.}\) Use Sage to checck your answers
Compare the results of evaluating \(A(BC)\) and \((AB)C\) and state your finding as a general principle.
When we are dealing with real numbers, we know if \(a\neq 0\) and \(ab = ac\text{,}\) then \(b=c\text{.}\) Define matrices
and compute \(AB\text{.}\) If \(AB = 0\text{,}\) is it necessarily true that either \(A=0\) or \(B=0\text{?}\)
Answer.
The product \(AB\) exists because the number of columns of \(A\) equals the number of rows of \(B\text{.}\) The dimensions of \(AB\) are \(2\times 2\text{.}\)
We have \(AB =
\left[\begin{array}{rr}
2 \amp 4 \\
-3 \amp 9
\end{array}\right]
\text{.}\)
It is not generally true that \(B=C\) if \(AB=AC\text{.}\)
It is not generally true that \(A=0\) or \(B=0\) if \(AB=0\text{.}\)
Solution.
The product \(AB\) exists because the number of columns of \(A\) equals the number of rows of \(B\text{.}\) The dimensions of \(AB\) are \(2\times 2\text{.}\)
We have \(AB =
\left[\begin{array}{rr}
2 \amp 4 \\
-3 \amp 9
\end{array}\right]
\text{.}\)
Yes, we can form the product \(BA\) because the number of columns of \(B\) equals the number of rows of \(A\text{.}\) This product \(AB\) will be \(3\times3\text{,}\) however, so it must be true that \(AB\neq BA\text{.}\)
We find that \(A(B+C)=AB + AC\text{.}\)
We find that \(A(BC) = (AB)C\text{.}\)
It is not generally true that \(B=C\) if \(AB=AC\text{,}\) as illustrated by this example.
It is not generally true that \(A=0\) or \(B=0\) if \(AB=0\text{,}\) as illustrated by this example.