Skip to main content

Section 2.1 Matrix Operations

Handout 2.1 Matrix Operations

Definition 2.1. Zero Matrix.

A zero matrix is any matrix whose every entry is zero.
\begin{equation*} 0_{2\times 3}= \begin{bmatrix} 0 \amp 0 \amp 0\\ 0 \amp 0 \amp 0 \end{bmatrix}, \qquad 0_{2\times 1}= \begin{bmatrix} 0\\ 0 \end{bmatrix}. \end{equation*}

Definition 2.2. Identity Matrix.

The \(n\times n\) identity matrix has ones on the main diagonal and zeros elsewhere.
\begin{equation*} I_2= \begin{bmatrix} 1 \amp 0\\ 0 \amp 1 \end{bmatrix}, \qquad I_3= \begin{bmatrix} 1 \amp 0 \amp 0\\ 0 \amp 1 \amp 0\\ 0 \amp 0 \amp 1 \end{bmatrix}. \end{equation*}
Note: Any matrix with dimensions \(n\times n\) is square. Zero matrices need not be square; identity matrices must be square.
Suppose \(A\in\mathbb{R}^{m\times n}\text{,}\) and \(a_{i,j}\) is the element of \(A\) in row \(i\) and column \(j\text{.}\)
  1. If \(A\) and \(B\) are \(m\times n\) matrices, then the elements of \(A+B\) are \(a_{i,j}+b_{i,j}\text{.}\)
  2. If \(c\in\mathbb{R}\text{,}\) then the elements of \(cA\) are \(c\,a_{i,j}\text{.}\)

Example 2.3.

\begin{equation*} \begin{bmatrix} 1 \amp 2 \amp 3\\ 4 \amp 5 \amp 6 \end{bmatrix} + c \begin{bmatrix} 7 \amp 4 \amp 7\\ 0 \amp 0 \amp k \end{bmatrix} = \begin{bmatrix} 15 \amp 10 \amp 17\\ 4 \amp 5 \amp 16 \end{bmatrix}, \end{equation*}
what are the values of \(c\) and \(k\text{?}\)
Scalar multiples and matrix addition have the expected properties. If \(r,s\in\mathbb{R}\) are scalars and \(A,B,C\) are \(m\times n\) matrices, then:
  1. \(\displaystyle A + 0_{m\times n} = A\)
  2. \(\displaystyle (A+B)+C = A+(B+C)\)
  3. \(\displaystyle r(A+B)=rA+rB\)
  4. \(\displaystyle (r+s)A = rA + sA\)
  5. \(\displaystyle r(sA) = (rs)A\)

Definition 2.4. Matrix Product via Columns.

Let \(A\) be an \(m\times n\) matrix and \(B\) be an \(n\times p\) matrix. The product \(AB\) is an \(m\times p\) matrix, given by
\begin{equation*} AB = A \begin{bmatrix} \vec b_1 \amp \cdots \amp \vec b_p \end{bmatrix} = \begin{bmatrix} A\vec b_1 \amp \cdots \amp A\vec b_p \end{bmatrix}. \end{equation*}
Note: The dimensions of \(A\) and \(B\) determine whether \(AB\) is defined, and what its dimensions will be.
Diagram showing how matrix dimensions match in a product.
A visual guide to when \(AB\) is defined based on inner dimensions.

Example 2.6.

Compute the following using the row-column method.
\begin{equation*} C=AB= \begin{bmatrix} 2 \amp 0\\ 1 \amp -1 \end{bmatrix} \begin{bmatrix} 3 \amp 0 \amp 1\\ 4 \amp 5 \amp 6 \end{bmatrix}. \end{equation*}
The associative property is \((AB)C = A(BC)\text{.}\) If \(C=\vec x\text{,}\) then:
\begin{equation*} (AB)\vec x = A(B\vec x). \end{equation*}
Schematically:
Flow diagram comparing two ways to multiply matrices.
Diagram showing two ways of getting from \(\vec x\) to \(AB\vec x\text{,}\) either by \(\vec x \mapsto B\vec x \mapsto AB\vec x\) or by direct multiplication by \(\vec x \mapsto AB\vec x\text{.}\)
The product \(AB\vec x\) can be obtained either by multiplying by \(AB\text{,}\) or by multiplying by \(B\) and then by \(A\text{.}\) This corresponds to composition of linear transformations.

Example 2.8.

\begin{equation*} A= \begin{bmatrix} 1 \amp 1\\ 0 \amp 0 \end{bmatrix}. \end{equation*}
Give an example of a \(2\times 2\) matrix \(B\) such that \(AB\neq BA\text{.}\)

Definition 2.9. Transpose.

The transpose \(A^T\) is the matrix whose columns are the rows of \(A\text{.}\)

Example 2.10.

Compute:
\begin{equation*} A = \begin{bmatrix} 1 \amp 2 \amp 3 \amp 4 \amp 5\\ 0 \amp 1 \amp 0 \amp 2 \amp 0 \end{bmatrix}^T \end{equation*}

Example 2.12.

Define
\begin{equation*} A= \begin{bmatrix} 1 \amp 0\\ 0 \amp 0 \end{bmatrix}, \qquad B= \begin{bmatrix} 1 \amp 0 \amp 0\\ 0 \amp 0 \amp 8 \end{bmatrix}, \qquad C= \begin{bmatrix} 1 \amp 0 \amp 0\\ 0 \amp 2 \amp 0\\ 0 \amp 0 \amp 2 \end{bmatrix}. \end{equation*}
Which of these operations are defined, and what are the dimensions of the result?
For any \(n\times n\) matrix and positive integer \(k\text{,}\) \(A^k\) is the product of \(k\) copies of \(A\text{.}\)
\begin{equation*} A^k = AA\cdots A. \end{equation*}

Example 2.13.

Compute \(A^2\) for
\begin{equation*} A = \begin{bmatrix} 3 \amp -2 \\ 5 \amp 1 \end{bmatrix} \end{equation*}

Example 2.14.

Compute \(B^8\) for
\begin{equation*} B= \begin{bmatrix} 1 \amp 0 \amp 0\\ 0 \amp 2 \amp 0\\ 0 \amp 0 \amp 2 \end{bmatrix}. \end{equation*}

Example 2.15.

True or False. If false, explain briefly.
(a)
Let \(n \in \mathbb{R}\text{.}\) Then for any \(n \times n\) matrix \(\text{,}\) we have \((I_n + A)(I_n - A) = I_n - A^2\text{.}\)
(b)
Let \(n \in \mathbb{R}\text{.}\) For any \(n \times n\) matrices \(A\) and \(B\text{,}\) we have \((A+B)^2 = A^2 + B^2 + 2AB\text{.}\)