Section 2.2 Matrix Multiplication
Subsection 2.2.1 Matrix Multiplication
If \(A=\left[a_{i j}\right]\) is an \(m \times \mathbf{n}\) matrix and \(B=\left[b_{i j}\right]\) is an \(\mathbf{n} \times p\) matrix, then the product \(A B\) is an \(m \times p\) matrix \(A B=\left[c_{i j}\right]\text{,}\) where
\begin{align*}
c_{i j} \amp=\sum_{k=1}^{n} a_{i k} b_{k j} \\
\amp=a_{i 1} b_{1 j}+a_{i 2} b_{2 j}+a_{i 3} b_{3 j}+\cdots+a_{i n} b_{n j}
\end{align*}
Let
\begin{equation*}
A = \begin{pmatrix}
2 \amp -8 \amp 8 \\
-2 \amp 1 \amp 0 \\
0 \amp -5 \amp 10
\end{pmatrix}
\end{equation*}
and
\begin{equation*}
B = \begin{pmatrix}
0 \amp 3 \amp -6 \amp 6 \amp 4 \amp -5 \\
3 \amp -7 \amp 8 \amp -5 \amp 8 \amp 9 \\
3 \amp -9 \amp 12 \amp -9 \amp 6 \amp 15
\end{pmatrix}\text{.}
\end{equation*}
Compute \(AB\text{.}\)
Exercise: If I ask you only to find \((AB)_{23}\text{.}\) Write a code to do it.
Subsection 2.2.2 \(AB\neq BA\)
For linear algebra, the most inconvinence is noncommutativity, that is, \(AB\neq BA\) in general. Let check it!
Example Let
\begin{equation*}
A = \begin{pmatrix}
3 \amp 4 \\
7 \amp 8
\end{pmatrix},
B = \begin{pmatrix}
5 \amp 3\\
2 \amp 1
\end{pmatrix}.
\end{equation*}
Show that \(AB\neq BA\text{.}\)
For this moment, it looks bad to fail the commutativity of matrix multiplication. The failure of the commutative law is actually a good thing, because it enables matrices to represent other things that do not commute, such as rotations in space.