Learn
Lesson · Systems and Matrices · Matrices

Gaussian Elimination

Row reduction drives any augmented matrix into one shape, working a column at a time from the left. The procedure never has to guess which variable to eliminate, and the number of solutions is read off the result rather than deduced.

each pivot is 1 and alone in its column reduced row echelon form a pivot in every variable column exactly one solution a variable column with no pivot that variable is free a row 0 0 0 | k with k ≠ 0 no solution
Reading the answer off the shape

Core ideas

What this lesson establishes

One shape, one procedure for reaching it, and one reading of the result. The reading is the part worth memorising.

1

Echelon form is a shape, not an answer

Pivots step to the right as you go down, and everything below a pivot in its column is zero. Getting there is mechanical: take the leftmost column that still needs work and clear it.

2

The three cases are read off, not worked out

Count pivots. A pivot in the constant column means no solution. Otherwise, variable columns without a pivot are the free ones, and no free variable means exactly one solution.

3

The reduced form is unique

Two people reducing the same matrix by different routes pass through different intermediate matrices and arrive at the same reduced row echelon form. The route is a matter of taste; the destination is not.

The material

Row reduction, from any matrix to one shape

Two forms, one algorithm, and what the result says in each of the three cases.

Definition · Leading entry, row echelon form

The leading entry or pivot of a nonzero row is its first nonzero entry, reading left to right. A matrix is in row echelon form when every all-zero row lies below every nonzero row, and each pivot lies strictly to the right of the pivot in the row above it.

The staircase shape has a consequence worth stating separately: everything below a pivot, in that pivot's column, is zero. That is what "the variable has been eliminated from the equations below" looks like once the letters are gone.

Definition · Reduced row echelon form

A matrix in row echelon form is in reduced row echelon form when, in addition, every pivot is 1 and is the only nonzero entry in its column.

Row echelon form is enough to finish by back-substitution. The reduced form finishes the back-substitution for you: the answer is sitting in the constant column.

Theorem · Uniqueness of the reduced form

Every matrix is row equivalent to exactly one matrix in reduced row echelon form. Row echelon form is not unique — the route changes it — but the reduced form does not depend on the operations chosen.

The proof belongs to a linear algebra course. What it buys here is practical: two people who disagree about a reduced form have an arithmetic error between them, not a difference of method.

The algorithm

  1. Find the leftmost column that is not entirely zero in the rows still being worked on. That is the pivot column.
  2. If its top entry (in the first unworked row) is zero, swap a row from below into that position. If the whole column is zero, move right.
  3. Divide the pivot row by its pivot, making the pivot 1. Keep the result in exact fractions.
  4. Clear the column: for every other row, subtract that row's entry in the pivot column times the pivot row.
  5. Cover the pivot row and repeat on the rows below. When no columns are left, the matrix is in reduced row echelon form.

Clearing only the entries below each pivot gives row echelon form, and the system is then finished by back-substitution from the bottom row upward — this is Gaussian elimination in its narrow sense. Clearing above as well gives the reduced form directly, and is called Gauss-Jordan elimination. The arithmetic totals are close; use whichever you can carry out without errors.

Fractions arrive at step 3 and are not a sign that anything has gone wrong. A pivot of 3 produces thirds immediately. Keep them exact: −1/3 written as −0.33 moves the final answer by about a hundredth, and there is nothing in the method that flags which digit went bad.

Reading the answer

  • A row 0 0 … 0 | k with k ≠ 0. That row says 0 = k, so the system has no solution. Stop; nothing further will improve it.
  • A pivot in every variable column. Exactly one solution, and in reduced form it is the constant column read off directly.
  • A variable column with no pivot. That variable is free: give it a parameter and express the pivot variables in terms of it. The solution set is infinite, with one parameter for each free variable.
Example · A free variable, written out

x + 2y + 3z = 5 and 2x + 4y + 8z = 14 reduce to the rows 1 2 0 | −1 and 0 0 1 | 2. Column two has no pivot, so y is free: put y = t.

Then x + 2t = −1 and z = 2, so the solution set is {(−1 − 2t, t, 2)}. At t = 1 the triple is (−3, 1, 2), and −3 + 2 + 6 = 5 with −6 + 4 + 16 = 14.

Example · An inconsistent pair

x + y = 2 and 2x + 2y = 5. One operation, R2 − 2R1, produces the row 0 0 | 1, which reads 0x + 0y = 1.

No pair satisfies that, so the system has no solution. Reducing further is possible and pointless: the question has been answered.

The final check is a substitution into the original equations. A reduced matrix is self-consistent by construction — it agrees with whatever arithmetic produced it — so it cannot detect an error made on the way down.

Interactive

Gauss-Jordan, every operation printed

The reduced row echelon form, and the rank two independent algorithms agree on

Matrix
every operation, in orderrank, by two algorithms

Method

Row reducing a matrix

Four moves, repeated. There is no decision in them beyond which row to swap up.

1

Work the columns left to right

One pivot per column at most, and once a column is cleared it is never revisited. Jumping about is how entries that were already zero become nonzero again.

2

Get a nonzero entry into the pivot position, then make it 1

Swap a row up if the entry is zero. Divide the pivot row once, at the pivot, and keep the fractions exact from that point on.

3

Clear the rest of the column

Every other row loses its entry in that column: Ri − (that entry) · Rpivot. When the step is done the column holds a single 1 and zeros.

4

Stop when the shape is right, then read

Look first for a row 0 0 … 0 | k with k ≠ 0. Then count pivots, name the free variables, and write the solution set — a triple, or a parameter form, or the empty set.

Row reduction

Score 0 / 0

Reducing the matrix from “Systems in Three Variables” to the answer

The same system once more, carried all the way to reduced row echelon form. Compare the first two operations with “Matrices and Row Operations” and the whole of it with “Systems in Three Variables”.

1 1 1 | 6 2 −1 3 | 9 −1 2 4 | 15 R2 − 2R1 → R2 1 1 1 | 6 R3 + R1 → R3 0 −3 1 | −3 0 3 5 | 21 R3 + R2 → R3 1 1 1 | 6 0 −3 1 | −3 0 0 6 | 18 (−1/3)R2 → R2 1 1 1 | 6 (1/6)R3 → R3 0 1 −1/3 | 1 0 0 1 | 3 R1 − R2 → R1 1 0 4/3 | 5 0 1 −1/3 | 1 0 0 1 | 3 R1 − (4/3)R3 → R1 1 0 0 | 1 R2 + (1/3)R3 → R2 0 1 0 | 2 0 0 1 | 3 x = 1, y = 2, z = 3

The −1/3 in the middle row is not a mistake and is not worth avoiding: it cancels two steps later. Replacing it with −0.33 sends the final row for y to 1.99 and the row for x to 1.01, and the matrix looks exactly as convincing as the correct one.

Every pivot column ends with a single 1, so all three variables are pivot variables, none is free, and there is exactly one solution. That reading was available three stages earlier, the moment the third row read 0 0 6 | 18: three pivots for three variables, and no row of zeros.

Faded rehearsal: begin with rows 1 2 −1 | 3, 0 1 4 | 2, 0 0 0 | 0. The first pivot is already in place. Clear the 2 above the second pivot, name the free variable before assigning it a parameter, and write the full family of solutions rather than one convenient triple.

Common mistakes

1
Reducing past an inconsistent rowOnce 0 0 0 | 4 has appeared the system has no solution. Continuing produces a tidy matrix that means nothing, and tidy matrices are persuasive.
2
Rounding a pivotDividing by 3 gives thirds, and 0.33 is not a third. The error grows with every operation that follows, and the final matrix carries no sign of it — which is the reason this course insists on exact fractions.
3
Treating a free variable as zeroA column without a pivot means that variable is unrestricted, not that it equals 0. Setting it to zero reports one triple out of infinitely many and hides the shape of the answer entirely.

Check your understanding

✓
Finish when you reduce without deciding anything.

The algorithm contains no choices beyond which row to swap upward: leftmost column, pivot, clear, move on. Carry a 3 × 4 augmented matrix to reduced row echelon form in exact fractions, and name which of the three cases you are in before writing any solution down.

Note: “Matrix Products” leaves systems for a moment and asks what else can be done with a matrix: added, scaled, and multiplied. The product is what lets a whole system be written Ax = b, and “Determinants and Cramer's Rule” and “Inverse Matrices” answer the question this lesson leaves open — which coefficient matrices give exactly one solution, and whether the answer can be had in one step instead of ten.

Kept in this browser only, for you. Nothing is sent anywhere and nothing checks it. Carry it to another device.

Feedback and recommendations

Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.

No recommendations yet for this lesson.