Linear Algebra · Beginner · 9 min read
Gaussian Elimination and RREF: A Step-by-Step Guide
Almost every computation in introductory linear algebra, from solving equations to finding rank and inverses, is Gaussian elimination in disguise. This guide explains the three row operations, the goal of each stage, and how to read the result.
The three row operations
Gaussian elimination rewrites a system or a matrix using only three moves, each of which can be undone and none of which changes the solution set: swap two rows, multiply a row by a non-zero number, and add a multiple of one row to another. The art lies in choosing them so that, column by column from the left, you create a staircase of leading entries with zeros below them.
Row echelon form and reduced row echelon form
A matrix is in row echelon form (REF) when all zero rows are at the bottom and each leading entry (pivot) lies to the right of the pivot above it. It is in reduced row echelon form (RREF) when, in addition, every pivot equals 1 and is the only non-zero entry in its column. A REF is not unique, but the RREF of a matrix is, which is why it is the standard way to compare matrices and read off answers.
Reading the result
The number of pivots is the rank. For an augmented matrix [A | b], a row of the form (0 … 0 | c) with c not zero means the system has no solution. If there are no such rows and the rank is smaller than the number of unknowns, the unpivoted columns are free variables and the system has infinitely many solutions. If the rank equals the number of unknowns, the solution is unique.
A habit that prevents errors
Write every row operation next to the row it changes, for example R₃ ← R₃ − 2R₁, and carry out one operation at a time. Check each new row by substituting a known solution, or by confirming that column sums behave as you expect. Fractions are normal in elimination; resist the urge to switch to decimals, which hide exact zeros.
Key formulas
Row operations: Rᵢ ↔ Rⱼ, Rᵢ ← kRᵢ (k ≠ 0), Rᵢ ← Rᵢ + kRⱼrank(A) = number of pivots in the echelon formConsistent ⇔ rank(A) = rank([A | b]); unique solution ⇔ that rank also equals the number of unknowns
Solved example
Solve x + y + z = 6, 2y + 5z = −4, 2x + 5y − z = 27
- Augmented matrix: rows (1, 1, 1 | 6), (0, 2, 5 | −4), (2, 5, −1 | 27).
- Eliminate below the first pivot: R₃ ← R₃ − 2R₁ gives (0, 3, −3 | 15).
- Eliminate below the second pivot (2): R₃ ← R₃ − (3/2)R₂ gives (0, 0, −3 − 15/2 | 15 + 6) = (0, 0, −21/2 | 21).
- Back-substitute: −(21/2)z = 21 gives z = −2. Then 2y + 5(−2) = −4 gives y = 3, and x + 3 − 2 = 6 gives x = 5.
- Check in the original equations: 5 + 3 − 2 = 6; 2·3 + 5·(−2) = −4; 2·5 + 5·3 − (−2) = 27. All three hold.
Practice questions
Try each question first, then open the answer.
1. What is the rank of the matrix with rows (1, 2, 3), (2, 4, 6) and (1, 0, 1)?
Rank 2. The second row is twice the first, so only two rows are independent.
2. Solve x + y = 3 and x − y = 1.
Adding the equations gives 2x = 4, so x = 2 and y = 1.
3. Are the vectors (1, 2) and (2, 4) linearly independent?
No. (2, 4) = 2·(1, 2), so the matrix with these columns has rank 1, not 2.