Write a Matrix in Reduced Row Echelon Form
We present the definitions of a matrix in row echelon form (REF) and a matrix in reduced row echelon form (RREF). We then solve examples on how to write a given matrix in REF and RREF using the three elementary row operations. Practice questions with detailed solutions are also included.
Matrix in Row Echelon Form (REF)
Rules for Row Echelon Form
A matrix is in row echelon form if it satisfies all of the following:
- In every nonzero row, the first nonzero entry (the pivot, or leading 1) is \( 1 \).
- For any two successive nonzero rows, the pivot of the lower row is strictly to the right of the pivot of the upper row.
- Any row consisting entirely of zeros is located at the bottom of the matrix.
Example 1 — Identifying Row Echelon Form
For each matrix, use the rules above to determine whether it is in REF.
a) \[ \begin{bmatrix} 1 & 1 & -1 & -3 \\ 0 & 0 & 1 & 2 \\ 0 & 1 & -6 & -12 \end{bmatrix} \]
b) \[ \begin{bmatrix} 1 & -1 & 2 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & -9 \end{bmatrix} \]
c) \[ \begin{bmatrix} 1 & 1 & 3 & -7 \\ 0 & 1 & 0 & -2 \\ 0 & 0 & 1 & 6 \end{bmatrix} \]
d) \[ \begin{bmatrix} 0 & 0 & 0 & 0 \\ 0 & 1 & -4 & 0 \\ 1 & 6 & -1 & -1 \\ 0 & 0 & 0 & 0 \end{bmatrix} \]
e) \[ \begin{bmatrix} 1 & 3 & -2 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 \end{bmatrix} \]
Solution
- a) Not in REF. Rule 2 is violated: the pivot in row 3 (column 2) is to the left of the pivot in row 2 (column 3).
- b) Not in REF. Rule 3 is violated: row 2 is entirely zeros and is not at the bottom.
- c) Is in REF.
- d) Not in REF. Rules 2 and 3 are violated: the top row is all zeros (should be at the bottom), and the pivot of row 3 (column 1) is left of the pivot of row 2 (column 2).
- e) Is in REF. Pivots are at columns 1, 3, 4 — strictly increasing — and the zero row is at the bottom.
Matrix in Reduced Row Echelon Form (RREF)
Rules for Reduced Row Echelon Form
A matrix is in reduced row echelon form if it satisfies all the conditions for REF and:
- Every pivot is the only nonzero entry in its column (zeros both above and below the pivot).
Example 2 — Identifying Reduced Row Echelon Form
Which of the following matrices are in REF? Which are in RREF?
a) \[ \begin{bmatrix} 1 & 1 & 0 & -3 \\ 0 & 1 & 0 & -12 \\ 0 & 0 & 1 & 2 \end{bmatrix} \]
b) \[ \begin{bmatrix} 1 & 0 & 0 & 5 \\ 0 & 1 & 0 & -2 \\ 0 & 0 & 1 & 0 \end{bmatrix} \]
c) \[ \begin{bmatrix} 1 & 0 & 0 & 1 \\ 0 & 1 & 0 & 2 \\ 0 & 1 & 0 & 2 \end{bmatrix} \]
d) \[ \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 2 \\ 0 & 0 & 1 & -2 \end{bmatrix} \]
Solution
- In REF: (a), (b), and (d).
- In RREF: (b) and (d) only.
- (a) is in REF but not RREF: the entry (1, 2) = 1 sits above the pivot of row 2 (column 2).
- (c) is not in REF: rows 2 and 3 have pivots in the same column (column 2).
Row Operations
We use elementary row operations to rewrite a matrix into REF or RREF:
- Interchange two rows.
- Add a multiple of one row to another row.
- Multiply a row by a nonzero constant.
Example 3 — Applying Basic Row Operations
Use row operations to write the matrices from Example 1 parts a), b), and d) in row echelon form.
a) Interchange row 2 and row 3:
\[ \begin{bmatrix} 1 & 1 & -1 & -3 \\ 0 & 1 & -6 & -12 \\ 0 & 0 & 1 & 2 \end{bmatrix} \]
b) Interchange row 2 and row 3:
\[ \begin{bmatrix} 1 & -1 & 2 & 0 \\ 0 & 0 & 1 & -9 \\ 0 & 0 & 0 & 0 \end{bmatrix} \]
d) Interchange row 1 and row 3:
\[ \begin{bmatrix} 1 & 6 & -1 & -1 \\ 0 & 1 & -4 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \end{bmatrix} \]
Step-by-Step Example: RREF
Use elementary row operations to write the following matrix in reduced row echelon form (RREF).
\[ \begin{bmatrix} 3 & 0 & -3 & 6 \\ 2 & 0 & -4 & 2 \\ 0 & 1 & 1 & 3 \\ 1 & 1 & -2 & 1 \end{bmatrix} \]
Part 1 — Rewrite into Row Echelon Form (REF)
We proceed column by column, starting from the left.
Step 1. Create a pivot in column 1 and zero out the entries below it.
First, scale row 1 so that its pivot is 1:
\[ \begin{bmatrix} 3 & 0 & -3 & 6 \\ 2 & 0 & -4 & 2 \\ 0 & 1 & 1 & 3 \\ 1 & 1 & -2 & 1 \end{bmatrix} \xrightarrow{\tfrac{1}{3}R_1} \begin{bmatrix} 1 & 0 & -1 & 2 \\ 2 & 0 & -4 & 2 \\ 0 & 1 & 1 & 3 \\ 1 & 1 & -2 & 1 \end{bmatrix} \]
Now zero out below using \( R_2 \leftarrow R_2 - 2 R_1 \) and \( R_4 \leftarrow R_4 - R_1 \):
\[ \begin{bmatrix} 1 & 0 & -1 & 2 \\ 2 & 0 & -4 & 2 \\ 0 & 1 & 1 & 3 \\ 1 & 1 & -2 & 1 \end{bmatrix} \longrightarrow \begin{bmatrix} 1 & 0 & -1 & 2 \\ 0 & 0 & -2 & -2 \\ 0 & 1 & 1 & 3 \\ 0 & 1 & -1 & -1 \end{bmatrix} \]
Step 2. Create a pivot in column 2 and zero out below it.
Swap rows 2 and 4 to bring the leading entry \( 1 \) to the pivot position:
\[ \begin{bmatrix} 1 & 0 & -1 & 2 \\ 0 & 0 & -2 & -2 \\ 0 & 1 & 1 & 3 \\ 0 & 1 & -1 & -1 \end{bmatrix} \xrightarrow{R_2 \leftrightarrow R_4} \begin{bmatrix} 1 & 0 & -1 & 2 \\ 0 & 1 & -1 & -1 \\ 0 & 1 & 1 & 3 \\ 0 & 0 & -2 & -2 \end{bmatrix} \]
Zero out column 2 of row 3 using \( R_3 \leftarrow R_3 - R_2 \):
\[ \begin{bmatrix} 1 & 0 & -1 & 2 \\ 0 & 1 & -1 & -1 \\ 0 & 1 & 1 & 3 \\ 0 & 0 & -2 & -2 \end{bmatrix} \longrightarrow \begin{bmatrix} 1 & 0 & -1 & 2 \\ 0 & 1 & -1 & -1 \\ 0 & 0 & 2 & 4 \\ 0 & 0 & -2 & -2 \end{bmatrix} \]
Step 3. Create a pivot in column 3 and zero out below it.
Zero out column 3 of row 4 using \( R_4 \leftarrow R_4 + R_3 \):
\[ \begin{bmatrix} 1 & 0 & -1 & 2 \\ 0 & 1 & -1 & -1 \\ 0 & 0 & 2 & 4 \\ 0 & 0 & -2 & -2 \end{bmatrix} \longrightarrow \begin{bmatrix} 1 & 0 & -1 & 2 \\ 0 & 1 & -1 & -1 \\ 0 & 0 & 2 & 4 \\ 0 & 0 & 0 & 2 \end{bmatrix} \]
Scale rows 3 and 4 to make pivots equal to 1:
\[ \xrightarrow{\tfrac{1}{2}R_3,\; \tfrac{1}{2}R_4} \begin{bmatrix} 1 & 0 & -1 & 2 \\ 0 & 1 & -1 & -1 \\ 0 & 0 & 1 & 2 \\ 0 & 0 & 0 & 1 \end{bmatrix} \]
The matrix is now in Row Echelon Form (REF).
Part 2 — Rewrite into Reduced Row Echelon Form (RREF)
We now create zeros above each pivot, working from the rightmost pivot leftwards.
Step 4. Eliminate entries above the pivot of row 4:
\[ \begin{bmatrix} 1 & 0 & -1 & 2 \\ 0 & 1 & -1 & -1 \\ 0 & 0 & 1 & 2 \\ 0 & 0 & 0 & 1 \end{bmatrix} \xrightarrow{R_1 - 2R_4,\; R_2 + R_4,\; R_3 - 2R_4} \begin{bmatrix} 1 & 0 & -1 & 0 \\ 0 & 1 & -1 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \]
Step 5. Eliminate entries above the pivot of row 3:
\[ \begin{bmatrix} 1 & 0 & -1 & 0 \\ 0 & 1 & -1 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \xrightarrow{R_1 + R_3,\; R_2 + R_3} \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \]
The matrix is now in Reduced Row Echelon Form.
Want to verify your work? Use our Row Reduce Augmented Matrix Calculator.
Practice Questions & Solutions
Question Set 1 — Identify Matrix Forms
a) Which matrices below are not in row echelon form? Explain why.
b) Among those that are in REF, which are not in reduced row echelon form? Explain why.
-
\[ \begin{bmatrix} 1 & -1 & 0 & 0 & -1 \\ 0 & 1 & 2 & -3 & 1 \\ 0 & 0 & 1 & 0 & -1 \\ 0 & 1 & 0 & 1 & -2 \end{bmatrix} \]
-
\[ \begin{bmatrix} 1 & -1 & 2 & -1 \\ 0 & 1 & 2 & 1 \\ 0 & 0 & 1 & -1 \end{bmatrix} \]
-
\[ \begin{bmatrix} 1 & 0 & -3 \\ 1 & 1 & 2 \end{bmatrix} \]
-
\[ \begin{bmatrix} 1 & 0 & 0 & 0 & -2 \\ 0 & 1 & 0 & 0 & 3 \\ 0 & 0 & 1 & 0 & -1 \\ 0 & 0 & 0 & 1 & -4 \end{bmatrix} \]
-
\[ \begin{bmatrix} 1 & 0 & 0 & -9 \\ 0 & 1 & 1 & -2 \\ 0 & 0 & 1 & 0 \end{bmatrix} \]
-
\[ \begin{bmatrix} 1 & 0 & -2 \\ 0 & 1 & 2 \end{bmatrix} \]
Solutions to Set 1
a) Matrices 1 and 3 are not in REF.
- Matrix 1: the pivot in row 4 (column 2) is not strictly to the right of the pivot in row 3 (column 3).
- Matrix 3: the pivot in row 2 (column 1) is not strictly to the right of the pivot in row 1 (column 1).
b) Matrices 2 and 5 are in REF but not in RREF.
- Matrix 2: entries in column 3 above the pivot of row 3 are nonzero (row 1 col 3 = 2, row 2 col 3 = 2).
- Matrix 5: entry (2, 3) = 1 is above the pivot of row 3 (column 3).
Question Set 2 — Perform RREF Reductions
Rewrite each matrix in reduced row echelon form.
Matrix 1
\[ \begin{bmatrix} 2 & 4 & 2 \\ -1 & 2 & 0 \end{bmatrix} \]
Solution.
\[ \xrightarrow{\tfrac{1}{2}R_1} \begin{bmatrix} 1 & 2 & 1 \\ -1 & 2 & 0 \end{bmatrix} \xrightarrow{R_2 + R_1} \begin{bmatrix} 1 & 2 & 1 \\ 0 & 4 & 1 \end{bmatrix} \xrightarrow{\tfrac{1}{4}R_2} \begin{bmatrix} 1 & 2 & 1 \\ 0 & 1 & \tfrac{1}{4} \end{bmatrix} \xrightarrow{R_1 - 2R_2} \begin{bmatrix} 1 & 0 & \tfrac{1}{2} \\ 0 & 1 & \tfrac{1}{4} \end{bmatrix} \]
Matrix 2
\[ \begin{bmatrix} -1 & 2 & 1 & 0 \\ 2 & 1 & 0 & -1 \\ 5 & 0 & -2 & 6 \end{bmatrix} \]
Solution.
\[ \xrightarrow{-R_1} \begin{bmatrix} 1 & -2 & -1 & 0 \\ 2 & 1 & 0 & -1 \\ 5 & 0 & -2 & 6 \end{bmatrix} \xrightarrow{R_2 - 2R_1,\; R_3 - 5R_1} \begin{bmatrix} 1 & -2 & -1 & 0 \\ 0 & 5 & 2 & -1 \\ 0 & 10 & 3 & 6 \end{bmatrix} \]
\[ \xrightarrow{\tfrac{1}{5}R_2} \begin{bmatrix} 1 & -2 & -1 & 0 \\ 0 & 1 & \tfrac{2}{5} & -\tfrac{1}{5} \\ 0 & 10 & 3 & 6 \end{bmatrix} \xrightarrow{R_3 - 10R_2} \begin{bmatrix} 1 & -2 & -1 & 0 \\ 0 & 1 & \tfrac{2}{5} & -\tfrac{1}{5} \\ 0 & 0 & -1 & 8 \end{bmatrix} \xrightarrow{-R_3} \begin{bmatrix} 1 & -2 & -1 & 0 \\ 0 & 1 & \tfrac{2}{5} & -\tfrac{1}{5} \\ 0 & 0 & 1 & -8 \end{bmatrix} \]
\[ \xrightarrow{R_1 + R_3,\; R_2 - \tfrac{2}{5}R_3} \begin{bmatrix} 1 & -2 & 0 & -8 \\ 0 & 1 & 0 & 3 \\ 0 & 0 & 1 & -8 \end{bmatrix} \xrightarrow{R_1 + 2R_2} \begin{bmatrix} 1 & 0 & 0 & -2 \\ 0 & 1 & 0 & 3 \\ 0 & 0 & 1 & -8 \end{bmatrix} \]
Matrix 3
\[ \begin{bmatrix} -1 & 2 & 0 & 1 & 1 \\ 1 & -2 & -1 & 2 & 3 \\ 0 & 1 & 2 & -2 & 1 \\ -1 & 3 & 4 & 2 & 0 \end{bmatrix} \]
Solution.
\[ \xrightarrow{-R_1} \begin{bmatrix} 1 & -2 & 0 & -1 & -1 \\ 1 & -2 & -1 & 2 & 3 \\ 0 & 1 & 2 & -2 & 1 \\ -1 & 3 & 4 & 2 & 0 \end{bmatrix} \xrightarrow{R_2 - R_1,\; R_4 + R_1} \begin{bmatrix} 1 & -2 & 0 & -1 & -1 \\ 0 & 0 & -1 & 3 & 4 \\ 0 & 1 & 2 & -2 & 1 \\ 0 & 1 & 4 & 1 & -1 \end{bmatrix} \]
\[ \xrightarrow{R_2 \leftrightarrow R_3,\; R_4 - R_3} \begin{bmatrix} 1 & -2 & 0 & -1 & -1 \\ 0 & 1 & 2 & -2 & 1 \\ 0 & 0 & -1 & 3 & 4 \\ 0 & 0 & 2 & 3 & -2 \end{bmatrix} \]
\[ \xrightarrow{-R_3,\; R_4 + 2R_3} \begin{bmatrix} 1 & -2 & 0 & -1 & -1 \\ 0 & 1 & 2 & -2 & 1 \\ 0 & 0 & 1 & -3 & -4 \\ 0 & 0 & 0 & 9 & 6 \end{bmatrix} \xrightarrow{\tfrac{1}{9}R_4} \begin{bmatrix} 1 & -2 & 0 & -1 & -1 \\ 0 & 1 & 2 & -2 & 1 \\ 0 & 0 & 1 & -3 & -4 \\ 0 & 0 & 0 & 1 & \tfrac{2}{3} \end{bmatrix} \]
\[ \xrightarrow{R_1 + R_4,\; R_2 + 2R_4,\; R_3 + 3R_4} \begin{bmatrix} 1 & -2 & 0 & 0 & -\tfrac{1}{3} \\ 0 & 1 & 2 & 0 & \tfrac{7}{3} \\ 0 & 0 & 1 & 0 & -2 \\ 0 & 0 & 0 & 1 & \tfrac{2}{3} \end{bmatrix} \xrightarrow{R_2 - 2R_3} \begin{bmatrix} 1 & -2 & 0 & 0 & -\tfrac{1}{3} \\ 0 & 1 & 0 & 0 & \tfrac{19}{3} \\ 0 & 0 & 1 & 0 & -2 \\ 0 & 0 & 0 & 1 & \tfrac{2}{3} \end{bmatrix} \]
\[ \xrightarrow{R_1 + 2R_2} \begin{bmatrix} 1 & 0 & 0 & 0 & \tfrac{37}{3} \\ 0 & 1 & 0 & 0 & \tfrac{19}{3} \\ 0 & 0 & 1 & 0 & -2 \\ 0 & 0 & 0 & 1 & \tfrac{2}{3} \end{bmatrix} \]