Skip to main content

Section 3.2 Matrix Multiplication

Subsection 3.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 3.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.

Subsection 3.2.3 The \(n\)-th Power of a matrix

Let \(A\) be a square matrix. In this course, computing \(A^{n}\) is important. We can use SageMath to find the pattern, then give a conjecture. If possible, you may provide a proof by mathematical induction. Let us begin.
Example Find the conjecture of \(A^{n}\text{,}\) where
\begin{equation*} A = \begin{pmatrix} 1 \amp 1\\ 0 \amp 1 \end{pmatrix} \end{equation*}
Exercise: Find the conjecture of \(X^{n}\text{,}\) where \(X=\begin{pmatrix} 2 \amp 1\\ 0 \amp 2 \end{pmatrix}\)
Solution.
\(\begin{pmatrix} 2 \amp 1\\ 0 \amp 2 \end{pmatrix}^{n}=\begin{pmatrix} 2^{n} \amp 2^{n-1}\cdot n\\ 0 \amp 2^{n} \end{pmatrix}\)
Exercise: Find the conjecture of \(X^{n}\text{,}\) where \(X=\begin{pmatrix} 3 \amp 1\\ 0 \amp 3 \end{pmatrix}\)
Solution.
\(\begin{pmatrix} 2 \amp 1\\ 0 \amp 2 \end{pmatrix}^{n}=\begin{pmatrix} 3^{n} \amp 3^{n-1}\cdot k\\ 0 \amp 3^{n} \end{pmatrix}\)
Exercise: Compute \(X^{n}\) for \(n=2,3,4,5\) and \(n=2023\text{,}\) where \(X=\begin{pmatrix} 0 \amp 1 \amp 0 \amp 0 \amp 0 \\ 0 \amp 0 \amp 1 \amp 0 \amp 0 \\ 0 \amp 0 \amp 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 0 \amp 0 \amp 1 \\ 0 \amp 0 \amp 0 \amp 0 \amp 0 \end{pmatrix}\)
Exercise: Compute \(X^{n}\) for \(n=2,3,4,5,6\) and \(n=2023\text{,}\) where \(X=\begin{pmatrix} 0 \amp 1 \amp 0 \amp 0 \amp 0 \amp 0 \\ 0 \amp 0 \amp 1 \amp 0 \amp 0 \amp 0 \\ 0 \amp 0 \amp 0 \amp 1 \amp 0 \amp 0 \\ 0 \amp 0 \amp 0 \amp 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 0 \amp 0 \amp 0 \amp 1 \\ 0 \amp 0 \amp 0 \amp 0 \amp 0 \amp 0 \end{pmatrix}\)