Skip to main content

Applied Mathematics

Section 2.4 Elementary Matrices

In ChapterΒ 1, linear systems and solutions were introduced. The standard way to solve these is to use elementary row operations as were shown in SectionΒ 1.3. In this section, we learn that we can write all of the row operations as matrix products.
We will denote by the matrix \(E\) any matrix that performs an elementary row operations. For example,
\begin{equation*} E_1 = \begin{bmatrix} 1 \amp 0 \amp 0 \amp 0 \\ 0 \amp 0 \amp 0 \amp 1 \\ 0 \amp 0 \amp 1 \amp 0 \\ 0 \amp 1 \amp 0 \amp 0 \end{bmatrix} \end{equation*}
will swap rows 2 and 4 in a \(4 \times 4\) matrix. The matrix
\begin{equation*} E_2 = \begin{bmatrix} 2 \amp 0 \amp 0 \\ 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 1 \end{bmatrix} \end{equation*}
will multiply the first row of a 3 by 3 matrix by 2. The matrix
\begin{equation*} E_3 = \begin{bmatrix} 1 \amp 0 \amp 0 \amp 0\\ 0 \amp 1 \amp 0 \amp 0 \\ -2 \amp 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 0 \amp 1\end{bmatrix} \end{equation*}
is the operation that multiplies the first row of a 4 by 4 matrix by \(-2\) and add to the third row.

Definition 2.4.1. Elementary Matrices and Row Operations.

Let \(E\) be a \(n \times n \) matrix. The matrix \(E\) is an elementary matrix is the result of applying one row operation to \(I_n\text{,}\) the \(n \times n\) identity matrix.
An elementary matrix that involves switching rows is also called a permutation matrix .
Although we have examples above, here are the specifics of the related row operations and the elementary matrix.
\(R_i \leftrightarrow R_j\)
\(E_{ i \leftrightarrow j} \) is the identity matrix with rows \(i\) and \(j\) switched.
\(c R_i \)
\(E_{cR_i}\) is the identity matrix where the element is row \(i\text{,}\) column \(i\) is replaced with \(c\text{.}\)
\(c R_i + R_j\)
\(E_{cR_i + R_j}\) is the identity matrix with the element in row \(j\text{,}\) column \(i\) has the number \(c\text{.}\)

Example 2.4.2.

Consider \(4 \times 4\) elementary matrices. Find the following:
  1. \(\displaystyle E_{1 \leftrightarrow 3}\)
  2. \(\displaystyle E_{-2 R_2 + R_4}\)
  3. \(\displaystyle E_{7 R_3}\)
Solution.
\(E_{1 \leftrightarrow 3}\)
\begin{equation*} \begin{bmatrix} 0 \amp 0 \amp 1 \amp 0 \\ 0 \amp 1 \amp 0 \amp 0 \\ 1 \amp 0 \amp 0 \amp 0 \\ 0 \amp 0 \amp 0 \amp 1 \end{bmatrix} \end{equation*}
\(E_{-2 R_2 + R_4}\)
\begin{equation*} \begin{bmatrix} 1 \amp 0 \amp 0 \amp 0 \\ 0 \amp 1 \amp 0 \amp 0 \\ 0 \amp 0 \amp 1 \amp 0 \\ 0 \amp -2 \amp 0 \amp 1 \end{bmatrix} \end{equation*}
\(E_{7 R_3}\)
\begin{equation*} \begin{bmatrix} 1 \amp 0 \amp 0 \amp 0 \\ 0 \amp 1 \amp 0 \amp 0 \\ 0 \amp 0 \amp 7 \amp 0 \\ 0 \amp 0 \amp 0 \amp 1 \end{bmatrix} \end{equation*}
There are a lot of nice properties of elementary matrices. We now show that all elementary matrices are invertible.

Example 2.4.4.

Find the inverses of the following elementary matrices and the determine the row operation the inverse represents
  • \begin{equation*} \begin{bmatrix} 1 \amp 0 \amp 0 \\ -2 \amp 1 \amp 0 \\ 0 \amp 0 \amp 1 \end{bmatrix} \end{equation*}
  • \begin{equation*} \begin{bmatrix} 1 \amp 0 \amp 0 \amp 0 \\ 0 \amp 3 \amp 0 \amp 0 \\ 0 \amp 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 0 \amp 1 \end{bmatrix} \end{equation*}
  • \begin{equation*} \begin{bmatrix} 0 \amp 0 \amp 1 \\ 0 \amp 1 \amp 0 \\ 1 \amp 0 \amp 0 \end{bmatrix} \end{equation*}
Solution.
  • Note that this represents the operation \(-2R_1+R_2\text{,}\) so the inverse is \(E_{2R_1+R_2}\) or
    \begin{equation*} \begin{bmatrix} 1 \amp 0 \amp 0 \\ 2 \amp 1 \amp 0 \\ 0 \amp 0 \amp 1 \end{bmatrix} \end{equation*}
  • This is the operation \(3R_2\) so the inverse is \(E_{(1/3) R_2}\) or
    \begin{equation*} \begin{bmatrix} 1 \amp 0 \amp 0 \amp 0 \\ 0 \amp 1/3 \amp 0 \amp 0 \\ 0 \amp 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 0 \amp 1 \end{bmatrix} \end{equation*}
  • This is the operation \(R_1 \leftrightarrow R_3\text{,}\) so the inverse is also the matrix \(E_{1 \leftrightarrow 3}\) or
    \begin{equation*} \begin{bmatrix} 0 \amp 0 \amp 1 \\ 0 \amp 1 \amp 0 \\ 1 \amp 0 \amp 0 \end{bmatrix} \end{equation*}

Subsection 2.4.1 Matrices as Products of Elementary Matrices

The last idea of this section is that of a writing a matrix as a product of elementary matrices. As we will see here, this is possible, if the matrix \(A\) is invertible.
Let’s find the inverse of
\begin{equation*} A = \begin{bmatrix} 1 \amp 2 \amp 0 \\ 0 \amp -2 \amp 2 \\ 3 \amp 0 \amp 1 \end{bmatrix} \end{equation*}
using elementary row operations using the techniques in SectionΒ 2.3.
\begin{equation*} \begin{aligned} \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp 2 \amp 0 \amp 1 \amp 0 \amp 0\\ 0 \amp -2 \amp 2 \amp 0 \amp 1 \amp 0\\ 3 \amp 0 \amp 1 \amp 0 \amp 0 \amp 1\\ \end{array} \right] \\ -3R_1 + R_3 \to R_3 \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp 2 \amp 0 \amp 1 \amp 0 \amp 0\\ 0 \amp -2 \amp 2 \amp 0 \amp 1 \amp 0\\ 0 \amp -6 \amp 1 \amp -3 \amp 0 \amp 1\\ \end{array} \right] \\ \begin{array}{r} -3R_2 + R_3 \to R_3, \\ R_2 + R_1 \to R_1 \end{array} \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp 0 \amp 2 \amp 1 \amp 1 \amp 0\\ 0 \amp -2 \amp 2 \amp 0 \amp 1 \amp 0\\ 0 \amp 0 \amp -5 \amp -3 \amp -3 \amp 1\\ \end{array} \right] \\ -\frac{1}{5} R_3 \to R_3 \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp 0 \amp 2 \amp 1 \amp 1 \amp 0\\ 0 \amp -2 \amp 2 \amp 0 \amp 1 \amp 0\\ 0 \amp 0 \amp 1 \amp 3/5 \amp 3/5 \amp -1/5\\ \end{array} \right] \\ \begin{array}{r} -2R_3 + R_2 \to R_2, \\ -2R_3 + R_1 \to R_1 \end{array} \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp 0 \amp 0 \amp -1/5 \amp -1/5 \amp 2/5\\ 0 \amp -2 \amp 0 \amp -6/5 \amp -1/5 \amp 2/5\\ 0 \amp 0 \amp 1 \amp 3/5 \amp 3/5 \amp -1/5\\ \end{array} \right] \\ -\frac{1}{2} R_2 \to R_2 \amp \qquad \left[\begin{array}{rrr|rrr} 1 \amp 0 \amp 0 \amp -1/5 \amp -1/5 \amp 2/5\\ 0 \amp 1 \amp 0 \amp 3/5 \amp 1/10 \amp -1/5\\ 0 \amp 0 \amp 1 \amp 3/5 \amp 3/5 \amp -1/5\\ \end{array} \right] \end{aligned} \end{equation*}
The important parts here are the row operations. If we let
\begin{equation*} \begin{aligned} E_1 \amp = E_{-3R_1+R_3} \amp E_2 \amp = E_{-3R_2+R_3} \amp E_3 \amp = E_{R_2+R_1} \\ E_4 \amp = E_{(-1/5)R_3} \amp E_5 \amp = E_{-2R_3+R_2} \amp E_6 \amp = E_{-2R_3+R_1} \\ E_7 \amp = E_{(-1/2)R_2} \end{aligned} \end{equation*}
then applying the row operations using the matrices above, leads to:
\begin{equation*} I = E_7 E_6 E_5 E_4 E_3 E_2 E_1 A \end{equation*}
or reversing everything
\begin{equation*} E_1^{-1}E_2^{-1}E_3^{-1}E_4^{-1}E_5^{-1}E_6^{-1}E_7^{-1} I = A \end{equation*}

Checkpoint 2.4.5.

Find the inverses of \(E_1, E_2, \ldots, E_7\text{,}\) find the product and show that the result is \(A\text{.}\)
Solution.
\begin{equation*} \begin{aligned} E_1^{-1} = E_{3R_1+R_3} = \amp \begin{bmatrix} 1 \amp 0 \amp 0 \\ 0 \amp 1 \amp 0 \\ 3 \amp 0 \amp 1 \end{bmatrix} \\ E_2^{-1} = E_{3R_2 +R_3} = \amp \begin{bmatrix} 1 \amp 0 \amp 0 \\ 0 \amp 1 \amp 0 \\ 0 \amp 3 \amp 1 \end{bmatrix} \\ E_3^{-1} = E_{-R_2+R_1} = \amp \begin{bmatrix} 1 \amp -1 \amp 0 \\ 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 1 \end{bmatrix} \\ E_4^{-1} = E_{5R_3} = \amp \begin{bmatrix} 1 \amp 0 \amp 0 \\ 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 5 \end{bmatrix} \\ E_5^{-1} = E_{2R_3+R_2} = \amp \begin{bmatrix} 1 \amp 0 \amp 0 \\ 0 \amp 1 \amp 2 \\ 0 \amp 0 \amp 1 \end{bmatrix} \\ E_6^{-1} = E_{2R_3+R_1} = \amp \begin{bmatrix} 1 \amp 0 \amp 2 \\ 0 \amp 1 \amp 0 \\ 0 \amp 0 \amp 1 \end{bmatrix} \\ E_7^{-1} = E_{-2R_2} = \amp \begin{bmatrix} 1 \amp 0 \amp 0 \\ 0 \amp -2 \amp 0 \\ 0 \amp 0 \amp 1 \end{bmatrix} \end{aligned} \end{equation*}
and performed the operation \(E_1^{-1}E_2^{-1}E_3^{-1}E_4^{-1}E_5^{-1}E_6^{-1}E_7^{-1} \) results in \(A\text{.}\) It’s a good idea to check this using some software.
\begin{equation*} \end{equation*}
Let’s do another example.

Example 2.4.7.

Consider the matrix
\begin{equation*} A = \begin{bmatrix} 1 \amp 2 \amp 0 \amp 2 \\ 0 \amp -2 \amp 1 \amp 2 \\ 1 \amp 3 \amp 0 \amp 1 \\ 0 \amp 1 \amp -1 \amp 0 \end{bmatrix} \end{equation*}
Find all elementary matrices to write \(A = E_1 E_2 \cdots E_k \)
Solution.
We’ll find the inverse of the matrix using row operations on the matrix \([A ~ | ~ I]\)
\begin{equation*} \begin{aligned} \amp \qquad \left[\begin{array}{rrrr|rrrr} 1 \amp 2 \amp 0 \amp 2 \amp 1 \amp 0 \amp 0 \amp 0\\ 0 \amp -2 \amp 1 \amp 2 \amp 0 \amp 1 \amp 0 \amp 0\\ 1 \amp 3 \amp 0 \amp 1 \amp 0 \amp 0 \amp 1 \amp 0\\ 0 \amp 1 \amp -1 \amp 0 \amp 0 \amp 0 \amp 0 \amp 1\\ \end{array} \right] \\ -R_1+R_3 \to R_3 \amp \qquad \left[\begin{array}{rrrr|rrrr} 1 \amp 2 \amp 0 \amp 2 \amp 1 \amp 0 \amp 0 \amp 0\\ 0 \amp -2 \amp 1 \amp 2 \amp 0 \amp 1 \amp 0 \amp 0\\ 0 \amp 1 \amp 0 \amp -1 \amp -1 \amp 0 \amp 1 \amp 0\\ 0 \amp 1 \amp -1 \amp 0 \amp 0 \amp 0 \amp 0 \amp 1\\ \end{array} \right] \\ R_2 \leftrightarrow R_3 \amp \qquad \left[\begin{array}{rrrr|rrrr} 1 \amp 2 \amp 0 \amp 2 \amp 1 \amp 0 \amp 0 \amp 0\\ 0 \amp 1 \amp 0 \amp -1 \amp -1 \amp 0 \amp 1 \amp 0\\ 0 \amp -2 \amp 1 \amp 2 \amp 0 \amp 1 \amp 0 \amp 0\\ 0 \amp 1 \amp -1 \amp 0 \amp 0 \amp 0 \amp 0 \amp 1\\ \end{array} \right] \\ \begin{array}{r} -2R_2 + R_1 \to R_1, \\ 2R_2 + R_3 \to R_3, \\ -R_2 + R_4 \to R_4 \end{array} \amp \qquad \left[\begin{array}{rrrr|rrrr} 1 \amp 0 \amp 0 \amp 4 \amp 3 \amp 0 \amp -2 \amp 0\\ 0 \amp 1 \amp 0 \amp -1 \amp -1 \amp 0 \amp 1 \amp 0\\ 0 \amp 0 \amp 1 \amp 0 \amp -2 \amp 1 \amp 2 \amp 0\\ 0 \amp 0 \amp -1 \amp 1 \amp 1 \amp 0 \amp -1 \amp 1\\ \end{array} \right] \\ R_3 + R_4 \to R_4 \amp \qquad \left[\begin{array}{rrrr|rrrr} 1 \amp 0 \amp 0 \amp 4 \amp 3 \amp 0 \amp -2 \amp 0\\ 0 \amp 1 \amp 0 \amp -1 \amp -1 \amp 0 \amp 1 \amp 0\\ 0 \amp 0 \amp 1 \amp 0 \amp -2 \amp 1 \amp 2 \amp 0\\ 0 \amp 0 \amp 0 \amp 1 \amp -1 \amp 1 \amp 1 \amp 1\\ \end{array} \right] \\ \begin{array}{r} R_4 + R_2 \to R_2 \\ -4R_4 + R_1 \to R_1 \end{array} \amp \qquad \left[\begin{array}{rrrr|rrrr} 1 \amp 0 \amp 0 \amp 0 \amp 7 \amp -4 \amp -6 \amp -4\\ 0 \amp 1 \amp 0 \amp 0 \amp -2 \amp 1 \amp 2 \amp 1\\ 0 \amp 0 \amp 1 \amp 0 \amp -2 \amp 1 \amp 2 \amp 0\\ 0 \amp 0 \amp 0 \amp 1 \amp -1 \amp 1 \amp 1 \amp 1\\ \end{array} \right] \end{aligned} \end{equation*}
We need to find the elementary matrices of each of these row operations and then the inverses.
\begin{equation*} \begin{aligned} E_1 \amp = E_{-R_1+R_3} \amp E_2 \amp = E_{R_2 \leftrightarrow R_3} \amp E_3 \amp = E_{(-2R_2+R_1)} \\ E_4 \amp = E_{2R_2 + R_3} \amp E_5 \amp = E_{2R_2 + R_3} \amp E_6 \amp = E_{-R_2 + R_4} \\ E_7 \amp = E_{R_3 + R_4} \amp E_8 \amp = E_{R_4 + R_2} \amp E_9 \amp = E_{-4R_4+R_1} \end{aligned} \end{equation*}
Note: the above lemma works only for invertible matrices. There are some ways of writing a matrix as the product of other matrices like this. This is called factorization and we will see more details of this in ChapterΒ 5. In fact, this notation above leads directly to \(LU\)-factorization.