Femtobytes
Problem type

Reduced row echelon form of a matrix

What it solves
Reduce any matrix of up to four rows and six columns to reduced row echelon form, with every row operation worked entry by entry, and read off its rank, pivot columns and free columns.
Subject
Linear Algebra
Topic
Row reduction and systems
Also called
Gaussian elimination, rref, reduced row echelon, echelon form, row reduce
Your problem

Reduce this matrix to reduced row echelon form.

[12−132410−1−22−5]\left[ \begin{array}{rrrr} 1 & 2 & -1 & 3 \\ 2 & 4 & 1 & 0 \\ -1 & -2 & 2 & -5 \end{array} \right]
The matrix
Rows3
Columns4
Whole numbers or fractions. Up to 4 rows and 6 columns.
Invent a new one:
The problem

Reduce this matrix to reduced row echelon form.

[12−132410−1−22−5]\left[ \begin{array}{rrrr} 1 & 2 & -1 & 3 \\ 2 & 4 & 1 & 0 \\ -1 & -2 & 2 & -5 \end{array} \right]
The result
[12−132410−1−22−5]  ∼  [1201001−20000]\left[ \begin{array}{rrrr} 1 & 2 & -1 & 3 \\ 2 & 4 & 1 & 0 \\ -1 & -2 & 2 & -5 \end{array} \right] \;\sim\; \left[ \begin{array}{rrrr} 1 & 2 & 0 & 1 \\ 0 & 0 & 1 & -2 \\ 0 & 0 & 0 & 0 \end{array} \right]

The rank is 22. The sign ∼\sim means "can be turned into, by row operations".

checked 26 lines of this solution were evaluated with exact arithmetic before it was shown to you. A solution with a false line is never served.
Picture 1 of 4Step 1: Say what the target looks like, and which moves are allowed
The matrix we start from
1122−1-13322441100−1-1−2-222−5-5
Every number in its own place. Row reduction never moves a number to a different column; it only changes what the numbers ARE, using the three legal moves, until the pivots step down the matrix like a staircase and each pivot is the only number left in its column.
1

Say what the target looks like, and which moves are allowed

Why this step

Row reduction is not a bag of tricks; it is a journey to one specific destination using three legal moves. Knowing the destination precisely is what tells us, at every moment, which move to make next, so we state it before touching a number.

[12−132410−1−22−5]\left[ \begin{array}{rrrr} 1 & 2 & -1 & 3 \\ 2 & 4 & 1 & 0 \\ -1 & -2 & 2 & -5 \end{array} \right]
The matrix we start from. It has 33 rows and 44 columns.
2

Pivot 1: column 1, row 1

Why this step

We work one column at a time, left to right. The goal for a column is a single 11 (the pivot) with zeros everywhere else in it. A column in that state says something very plain: its variable appears in exactly one equation, with nothing in front of it. Each cleared column is one variable pinned down.

Replace row 2 by R2−2R1R_{2} - 2 R_{1}. The multiplier is chosen so that the entry under attack, 22, is cancelled exactly by the pivot: 2−2⋅1=02 - 2 \cdot 1 = 0.

columnworkingnew entry
112−2⋅12 - 2 \cdot 100
224−2⋅24 - 2 \cdot 200
331−2⋅(−1)1 - 2 \cdot \left( -1 \right)33
440−2⋅30 - 2 \cdot 3−6-6
Row 2, entry by entry: old entry minus the multiple of row 1.
[12−13003−6−1−22−5]\left[ \begin{array}{rrrr} \boxed{1} & 2 & -1 & 3 \\ 0 & 0 & 3 & -6 \\ -1 & -2 & 2 & -5 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked

Replace row 3 by R3+R1R_{3} + R_{1}. The multiplier is chosen so that the entry under attack, −1-1, is cancelled exactly by the pivot: −1+1⋅1=0-1 + 1 \cdot 1 = 0.

columnworkingnew entry
11−1+1⋅1-1 + 1 \cdot 100
22−2+1⋅2-2 + 1 \cdot 200
332+1⋅(−1)2 + 1 \cdot \left( -1 \right)11
44−5+1⋅3-5 + 1 \cdot 3−2-2
Row 3, entry by entry: old entry plus the multiple of row 1.
[12−13003−6001−2]\left[ \begin{array}{rrrr} \boxed{1} & 2 & -1 & 3 \\ 0 & 0 & 3 & -6 \\ 0 & 0 & 1 & -2 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked
3

Pivot 2: column 3, row 2

Why this step

The same job for the next column. Working left to right matters: the rows we use now already have zeros in the earlier pivot columns, so clearing this column cannot spoil the columns already finished. That is why the method never has to go back. (Column 2 has nothing but zeros at or below row 2, so no pivot can be made there and we move on. Such a column will belong to a free variable.)

Swap row 2 and row 3, to bring the entry 11 up to the pivot position. Swapping two equations changes nothing about what they say together.

[12−13001−2003−6]\left[ \begin{array}{rrrr} 1 & 2 & -1 & 3 \\ 0 & 0 & \boxed{1} & -2 \\ 0 & 0 & 3 & -6 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked

Replace row 1 by R1+R2R_{1} + R_{2}. The multiplier is chosen so that the entry under attack, −1-1, is cancelled exactly by the pivot: −1+1⋅1=0-1 + 1 \cdot 1 = 0.

columnworkingnew entry
111+1⋅01 + 1 \cdot 011
222+1⋅02 + 1 \cdot 022
33−1+1⋅1-1 + 1 \cdot 100
443+1⋅(−2)3 + 1 \cdot \left( -2 \right)11
Row 1, entry by entry: old entry plus the multiple of row 2.
[1201001−2003−6]\left[ \begin{array}{rrrr} 1 & 2 & 0 & 1 \\ 0 & 0 & \boxed{1} & -2 \\ 0 & 0 & 3 & -6 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked

Replace row 3 by R3−3R2R_{3} - 3 R_{2}. The multiplier is chosen so that the entry under attack, 33, is cancelled exactly by the pivot: 3−3⋅1=03 - 3 \cdot 1 = 0.

columnworkingnew entry
110−3⋅00 - 3 \cdot 000
220−3⋅00 - 3 \cdot 000
333−3⋅13 - 3 \cdot 100
44−6−3⋅(−2)-6 - 3 \cdot \left( -2 \right)00
Row 3, entry by entry: old entry minus the multiple of row 2.
[1201001−20000]\left[ \begin{array}{rrrr} 1 & 2 & 0 & 1 \\ 0 & 0 & \boxed{1} & -2 \\ 0 & 0 & 0 & 0 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked
4

Confirm the form and read off the rank

Why this step

Reaching the reduced form is only useful if we then read it. The count of pivots is the single most important number attached to a matrix, because it says how many of its rows carry genuinely new information.

[1201001−20000]\left[ \begin{array}{rrrr} 1 & 2 & 0 & 1 \\ 0 & 0 & 1 & -2 \\ 0 & 0 & 0 & 0 \end{array} \right]
The reduced row echelon form. All four conditions of the definition hold; the software checks them again here, independently of the steps above. checked