Tutorials › Linear Algebra › Elementary Matrices for the Three Row Operations

Elementary Matrices and Inverses · Tutorial 87 of 1000

Elementary Matrices for the Three Row Operations

Build the elementary matrices for row swaps, nonzero row scalings, and row replacements by changing the corresponding rows of the identity matrix.

Beginner 9 min read

What You'll Learn

  • Define elementary matrices by applying one row operation to an identity matrix.
  • Determine the required identity-matrix order from the row indices in the operation.
  • Construct matrices for row swaps, nonzero row scalings, and row replacements.
  • Read the changed rows and entries from each construction.
  • Identify errors involving invalid indices, zero scaling factors, and wrong replacement rows.

From a Row Operation to a Matrix

An elementary matrix is built by making one permitted row operation on an identity matrix. This turns a description such as “swap rows 1 and 3” into a specific matrix with a specific order. The construction is direct: first write the identity matrix, then change exactly the row or rows named by the operation. The identity matrix must have enough rows for every index used.

All matrices and scalars in this tutorial are over \(\mathbb{R}\). For \(n\in\mathbb{N}\), the identity matrix \(\mathbf{I}_n\) has order \(n\), and its \(k\)th row is \(\mathbf{e}_k^{\top}\), where \(\mathbf{e}_k\) is the \(k\)th standard basis column in \(\mathbb{R}^n\). Thus, for example, the rows of \(\mathbf{I}_3\) are \((1,0,0)\), \((0,1,0)\), and \((0,0,1)\).

The three elementary row operations are: swapping two distinct rows \(R_i\) and \(R_j\); scaling a row \(R_i\) by a nonzero scalar \(c\); and replacing one row \(R_i\) by \(R_i+cR_j\), where \(i\ne j\) and \(c\in\mathbb{R}\). The indices name rows, not the number of rows in the matrix. Consequently, the order \(n\) must be at least as large as the greatest row index named by the operation. For instance, an operation involving row 3 requires an identity matrix of order at least 3.

Definition: An elementary matrix of order \(n\) is the matrix obtained by applying exactly one elementary row operation to \(\mathbf{I}_n\). To construct it, make the specified change to the rows of \(\mathbf{I}_n\) and leave every other row unchanged.

The Three Row Patterns

The definition gives a simple way to describe every row of an elementary matrix. A row not named by the operation stays equal to its row in the identity matrix. A named row is changed according to the operation. In the swap case, both named rows change places.

Theorem: Fix \(n\in\mathbb{N}\). The elementary matrix for each permitted operation on \(\mathbf{I}_n\) has the following rows:
  • For \(R_i\leftrightarrow R_j\), with \(i\ne j\), row \(i\) becomes \(\mathbf{e}_j^{\top}\), row \(j\) becomes \(\mathbf{e}_i^{\top}\), and every other row \(k\) remains \(\mathbf{e}_k^{\top}\).
  • For \(R_i\to cR_i\), with \(c\ne0\), row \(i\) becomes \(c\mathbf{e}_i^{\top}\), and every other row remains \(\mathbf{e}_k^{\top}\).
  • For \(R_i\to R_i+cR_j\), with \(i\ne j\), row \(i\) becomes \(\mathbf{e}_i^{\top}+c\mathbf{e}_j^{\top}\), and every other row remains \(\mathbf{e}_k^{\top}\).

Proof. The \(k\)th row of \(\mathbf{I}_n\) is \(\mathbf{e}_k^{\top}\). A swap interchanges the original rows \(i\) and \(j\), so those rows become \(\mathbf{e}_j^{\top}\) and \(\mathbf{e}_i^{\top}\), respectively; all other rows are untouched. Scaling row \(i\) multiplies its original row \(\mathbf{e}_i^{\top}\) by \(c\), while leaving every other row untouched. For a replacement, the original row \(i\) is \(\mathbf{e}_i^{\top}\) and the original row \(j\) is \(\mathbf{e}_j^{\top}\), so the new row \(i\) is \(\mathbf{e}_i^{\top}+c\mathbf{e}_j^{\top}\); the other rows are untouched. These descriptions specify every row, so in each case they determine exactly one matrix. \(\square\)

The replacement condition \(i\ne j\) matters: the row being changed and the row being added must be different. The scaling condition \(c\ne0\) also matters. Multiplying a row by zero is not one of the permitted elementary row operations.

Proposition: In the elementary matrix for \(R_i\to R_i+cR_j\), the only entries that can differ from those of \(\mathbf{I}_n\) are in row \(i\): entry \((i,i)\) remains \(1\), and entry \((i,j)\) becomes \(c\). For \(R_i\to cR_i\), only entry \((i,i)\) changes, from \(1\) to \(c\).

Proof. In a replacement, row \(i\) is \(\mathbf{e}_i^{\top}+c\mathbf{e}_j^{\top}\). Since \(i\ne j\), the \(i\)th component of this row is \(1+0=1\), and its \(j\)th component is \(0+c=c\). Every other component is zero, and every other row remains an identity row. In a scaling, row \(i\) is \(c\mathbf{e}_i^{\top}\), whose \(i\)th component is \(c\) and whose other components are zero; all other rows remain unchanged. This proves both entry descriptions. \(\square\)

Worked Constructions

Worked Example: Swapping Rows 1 and 3

Construct the elementary matrix for \(R_1\leftrightarrow R_3\). The greatest row index named is 3, so choose an identity matrix of order 3. Its rows, in order, are \((1,0,0)\), \((0,1,0)\), and \((0,0,1)\). Swap the first and third rows, leaving the second row unchanged:

$$ \mathbf{I}_3= \begin{bmatrix} 1&0&0\\ 0&1&0\\ 0&0&1 \end{bmatrix} \quad\longrightarrow\quad \begin{bmatrix} 0&0&1\\ 0&1&0\\ 1&0&0 \end{bmatrix}. $$

The result is the elementary matrix for the specified swap. Its first row is the original third row, its third row is the original first row, and its second row is unchanged. These row-by-row checks confirm that the stated operation was applied to \(\mathbf{I}_3\).

Worked Example: Scaling Row 2 by \(-2\)

Construct the elementary matrix for \(R_2\to -2R_2\). Row 2 is the greatest index named, so order 2 is sufficient. Start with \(\mathbf{I}_2\), whose rows are \((1,0)\) and \((0,1)\). Multiply the second row by \(-2\):

$$ \begin{bmatrix} 1&0\\ 0&1 \end{bmatrix} \quad\longrightarrow\quad \begin{bmatrix} 1&0\\ 0&-2 \end{bmatrix}. $$

The first row remains \((1,0)\), and the second row is \(-2(0,1)=(0,-2)\). The new row therefore has the required entries, and the scaling factor is nonzero as required for an elementary row operation.

Worked Example: Adding a Multiple of Another Row

Construct the elementary matrix for \(R_1\to R_1+3R_2\). Both indices are at most 2, so begin with \(\mathbf{I}_2\). The original first row is \((1,0)\), and the original second row is \((0,1)\). The new first row is

$$ (1,0)+3(0,1)=(1,0)+(0,3)=(1,3). $$

The second row is unchanged, giving

$$ \begin{bmatrix} 1&0\\ 0&1 \end{bmatrix} \quad\longrightarrow\quad \begin{bmatrix} 1&3\\ 0&1 \end{bmatrix}. $$

Checking the rows against the instruction, row 1 is \((1,3)\), exactly the sum calculated above, and row 2 is still \((0,1)\). No other row is present to change.

Worked Example: A Replacement with a Negative Fraction

Construct the elementary matrix for \(R_3\to R_3-\tfrac12R_1\). The greatest row index named is 3, so use \(\mathbf{I}_3\). The original rows 1 and 3 are \((1,0,0)\) and \((0,0,1)\). Calculate the new third row using those identity rows:

$$ (0,0,1)-\frac12(1,0,0) = \left(-\frac12,0,1\right). $$

Rows 1 and 2 are unchanged. Therefore the elementary matrix is

$$ \begin{bmatrix} 1&0&0\\ 0&1&0\\ -\frac12&0&1 \end{bmatrix}. $$

Its third row has \(-\tfrac12\) in column 1 and \(1\) in column 3, as the replacement calculation requires. Its first and second rows are still the corresponding identity rows.

Common Mistakes and Practical Checks

Using an identity matrix with too few rows. A tempting but invalid construction for \(R_1\leftrightarrow R_3\) is to start with \(\mathbf{I}_2\) and attempt to swap its first and third rows. The matrix \(\mathbf{I}_2\) has only rows 1 and 2, so row 3 does not exist and the operation cannot be performed. The correction is to use \(\mathbf{I}_3\), since the order must be at least the greatest named row index, 3. The corrected result is \(\begin{bmatrix}0&0&1\\0&1&0\\1&0&0\end{bmatrix}\).

Changing the wrong row in a replacement. For \(R_1\to R_1+3R_2\), changing row 2 instead would produce \(\begin{bmatrix}1&0\\3&1\end{bmatrix}\), which corresponds to \(R_2\to R_2+3R_1\), not the requested operation. The replacement changes the row on the left of the arrow; the row on the right is used as the added row and stays unchanged.

Allowing a zero scaling factor. Replacing \(R_i\to cR_i\) with \(c=0\) would erase row \(i\). For example, scaling row 2 of \(\mathbf{I}_2\) by zero gives \(\begin{bmatrix}1&0\\0&0\end{bmatrix}\), but this is not an elementary matrix for a permitted scaling operation: the scaling factor must be nonzero.

Before accepting a construction, check the order, the changed row or rows, and the entries in those rows. A swap must exchange exactly two identity rows; a scaling must alter exactly the specified row; and a replacement must alter the target row by adding the stated multiple of a different row. These checks make the construction mechanical and help prevent index errors.

Check Your Understanding

For each item, state a suitable order and write the elementary matrix by applying the operation to the identity matrix.

  1. Construct the elementary matrix for \(R_2\leftrightarrow R_4\). Why is order 2 not sufficient?
  2. Construct the elementary matrix for \(R_1\to 5R_1\) using the smallest suitable order.
  3. Construct the elementary matrix for \(R_2\to R_2-2R_1\) using order 3.
  4. Which row changes in \(R_3\to R_3+\tfrac14R_2\), and which row remains unchanged?
  5. Explain why \(R_1\to 0R_1\) is not one of the three permitted elementary row operations.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon