Femtobytes
Problem type

Solve a system of linear equations by row reduction

What it solves
Solve up to four linear equations in up to four unknowns by Gauss-Jordan elimination, with every row operation worked entry by entry. The system may have one solution, none, or infinitely many, and the answer is checked in every equation.
Subject
Linear Algebra
Topic
Row reduction and systems
Also called
simultaneous equations, system of equations, augmented matrix, solve a system
Your problem

Solve this system of linear equations.

2x+y−z=8−3x−y+2z=−11−2x+y+2z=−3\begin{aligned} 2 x + y - z &= 8 \\ -3 x - y + 2 z &= -11 \\ -2 x + y + 2 z &= -3 \end{aligned}
The augmented matrix
Equations3
Unknowns3
One row per equation. The last column holds the numbers on the right of the equals signs.
Invent a new one:
The problem

Solve this system of linear equations.

2x+y−z=8−3x−y+2z=−11−2x+y+2z=−3\begin{aligned} 2 x + y - z &= 8 \\ -3 x - y + 2 z &= -11 \\ -2 x + y + 2 z &= -3 \end{aligned}
The result
(x,y,z)=(2,  3,  −1)\left( x, y, z \right) = \left( 2, \; 3, \; -1 \right)

The system has exactly one solution.

checked 56 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 6Step 1: Write the system as one block of numbers
The system, as one block of numbers
how much xhow much yhow much zequals
equation 1equation 2equation 3
2211−1-188−3-3−1-122−11-11−2-21122−3-3
The same system with the letters stripped out. Every column holds the numbers in front of one unknown, every row is one equation, and the upright rule stands where the equals signs were. Nothing has been lost: the POSITION of each number now carries what the letter used to say.
1

Write the system as one block of numbers

Why this step

While we solve, the letters x,y,zx, y, z and the == signs never change; only the numbers do. Carrying the letters through every line is pure copying, and copying is where slips happen. So we strip the system down to its numbers, keeping each number's POSITION to remember what it multiplies. That block is the augmented matrix.

2x+y−z=8−3x−y+2z=−11−2x+y+2z=−3\begin{aligned} 2 x + y - z &= 8 \\ -3 x - y + 2 z &= -11 \\ -2 x + y + 2 z &= -3 \end{aligned}
The system. Each unknown stands for a number we are trying to find; a solution is a choice of all of them that makes every equation true at once.
[21−18−3−12−11−212−3]\left[ \begin{array}{rrr|r} 2 & 1 & -1 & 8 \\ -3 & -1 & 2 & -11 \\ -2 & 1 & 2 & -3 \end{array} \right]
The augmented matrix. Column 11 holds the numbers in front of xx, column 22 those in front of yy, and so on. The upright bar stands where the equals signs were. A missing unknown is a 00.
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.

Multiply row 1 by 12\frac{1}{2}, which turns the pivot 22 into 11. Multiplying an equation through by a number that is not zero keeps it true for exactly the same values.

columnworkingnew entry
1112⋅2\frac{1}{2} \cdot 211
2212⋅1\frac{1}{2} \cdot 112\frac{1}{2}
3312⋅(−1)\frac{1}{2} \cdot \left( -1 \right)−12-\frac{1}{2}
4412⋅8\frac{1}{2} \cdot 844
Row 1, entry by entry.
[112−124−3−12−11−212−3]\left[ \begin{array}{rrr|r} \boxed{1} & \frac{1}{2} & -\frac{1}{2} & 4 \\ -3 & -1 & 2 & -11 \\ -2 & 1 & 2 & -3 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked

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

columnworkingnew entry
11−3+3⋅1-3 + 3 \cdot 100
22−1+3⋅12-1 + 3 \cdot \frac{1}{2}12\frac{1}{2}
332+3⋅(−12)2 + 3 \cdot \left( -\frac{1}{2} \right)12\frac{1}{2}
44−11+3⋅4-11 + 3 \cdot 411
Row 2, entry by entry: old entry plus the multiple of row 1.
[112−124012121−212−3]\left[ \begin{array}{rrr|r} \boxed{1} & \frac{1}{2} & -\frac{1}{2} & 4 \\ 0 & \frac{1}{2} & \frac{1}{2} & 1 \\ -2 & 1 & 2 & -3 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked

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

columnworkingnew entry
11−2+2⋅1-2 + 2 \cdot 100
221+2⋅121 + 2 \cdot \frac{1}{2}22
332+2⋅(−12)2 + 2 \cdot \left( -\frac{1}{2} \right)11
44−3+2⋅4-3 + 2 \cdot 455
Row 3, entry by entry: old entry plus the multiple of row 1.
[112−1240121210215]\left[ \begin{array}{rrr|r} \boxed{1} & \frac{1}{2} & -\frac{1}{2} & 4 \\ 0 & \frac{1}{2} & \frac{1}{2} & 1 \\ 0 & 2 & 1 & 5 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked
3

Pivot 2: column 2, 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.

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

[112−1240215012121]\left[ \begin{array}{rrr|r} 1 & \frac{1}{2} & -\frac{1}{2} & 4 \\ 0 & \boxed{2} & 1 & 5 \\ 0 & \frac{1}{2} & \frac{1}{2} & 1 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked

Multiply row 2 by 12\frac{1}{2}, which turns the pivot 22 into 11. Multiplying an equation through by a number that is not zero keeps it true for exactly the same values.

columnworkingnew entry
1112⋅0\frac{1}{2} \cdot 000
2212⋅2\frac{1}{2} \cdot 211
3312⋅1\frac{1}{2} \cdot 112\frac{1}{2}
4412⋅5\frac{1}{2} \cdot 552\frac{5}{2}
Row 2, entry by entry.
[112−124011252012121]\left[ \begin{array}{rrr|r} 1 & \frac{1}{2} & -\frac{1}{2} & 4 \\ 0 & \boxed{1} & \frac{1}{2} & \frac{5}{2} \\ 0 & \frac{1}{2} & \frac{1}{2} & 1 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked

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

columnworkingnew entry
111−12⋅01 - \frac{1}{2} \cdot 011
2212−12⋅1\frac{1}{2} - \frac{1}{2} \cdot 100
33−12−12⋅12-\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{2}−34-\frac{3}{4}
444−12⋅524 - \frac{1}{2} \cdot \frac{5}{2}114\frac{11}{4}
Row 1, entry by entry: old entry minus the multiple of row 2.
[10−34114011252012121]\left[ \begin{array}{rrr|r} 1 & 0 & -\frac{3}{4} & \frac{11}{4} \\ 0 & \boxed{1} & \frac{1}{2} & \frac{5}{2} \\ 0 & \frac{1}{2} & \frac{1}{2} & 1 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked

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

columnworkingnew entry
110−12⋅00 - \frac{1}{2} \cdot 000
2212−12⋅1\frac{1}{2} - \frac{1}{2} \cdot 100
3312−12⋅12\frac{1}{2} - \frac{1}{2} \cdot \frac{1}{2}14\frac{1}{4}
441−12⋅521 - \frac{1}{2} \cdot \frac{5}{2}−14-\frac{1}{4}
Row 3, entry by entry: old entry minus the multiple of row 2.
[10−341140112520014−14]\left[ \begin{array}{rrr|r} 1 & 0 & -\frac{3}{4} & \frac{11}{4} \\ 0 & \boxed{1} & \frac{1}{2} & \frac{5}{2} \\ 0 & 0 & \frac{1}{4} & -\frac{1}{4} \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked
4

Pivot 3: column 3, row 3

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.

Multiply row 3 by 44, which turns the pivot 14\frac{1}{4} into 11. Multiplying an equation through by a number that is not zero keeps it true for exactly the same values.

columnworkingnew entry
114⋅04 \cdot 000
224⋅04 \cdot 000
334⋅144 \cdot \frac{1}{4}11
444⋅(−14)4 \cdot \left( -\frac{1}{4} \right)−1-1
Row 3, entry by entry.
[10−34114011252001−1]\left[ \begin{array}{rrr|r} 1 & 0 & -\frac{3}{4} & \frac{11}{4} \\ 0 & 1 & \frac{1}{2} & \frac{5}{2} \\ 0 & 0 & \boxed{1} & -1 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked

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

columnworkingnew entry
111+34⋅01 + \frac{3}{4} \cdot 011
220+34⋅00 + \frac{3}{4} \cdot 000
33−34+34⋅1-\frac{3}{4} + \frac{3}{4} \cdot 100
44114+34⋅(−1)\frac{11}{4} + \frac{3}{4} \cdot \left( -1 \right)22
Row 1, entry by entry: old entry plus the multiple of row 3.
[1002011252001−1]\left[ \begin{array}{rrr|r} 1 & 0 & 0 & 2 \\ 0 & 1 & \frac{1}{2} & \frac{5}{2} \\ 0 & 0 & \boxed{1} & -1 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked

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

columnworkingnew entry
110−12⋅00 - \frac{1}{2} \cdot 000
221−12⋅01 - \frac{1}{2} \cdot 011
3312−12⋅1\frac{1}{2} - \frac{1}{2} \cdot 100
4452−12⋅(−1)\frac{5}{2} - \frac{1}{2} \cdot \left( -1 \right)33
Row 2, entry by entry: old entry minus the multiple of row 3.
[10020103001−1]\left[ \begin{array}{rrr|r} 1 & 0 & 0 & 2 \\ 0 & 1 & 0 & 3 \\ 0 & 0 & \boxed{1} & -1 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked
5

Read the answer off the reduced matrix

Why this step

The reduced matrix is the same system written in its plainest form, so now we turn the numbers back into equations and simply read them. Three things can happen, and the matrix shows at a glance which one: an impossible row, a pivot for every unknown, or an unknown left without a pivot.

[10020103001−1]\left[ \begin{array}{rrr|r} 1 & 0 & 0 & 2 \\ 0 & 1 & 0 & 3 \\ 0 & 0 & 1 & -1 \end{array} \right]
The reduced matrix: every pivot is 11, each pivot is the only non-zero entry in its column, and the pivots step down to the right. checked

Every unknown has a pivot, so every row names one unknown outright. Reading the rows:

x=2y=3z=−1\begin{aligned} x &= 2 \\ y &= 3 \\ z &= -1 \end{aligned}
The solution.
6

Check the answer in every original equation

Why this step

Row reduction involves dozens of small calculations, and one wrong sign anywhere gives a confident, wrong answer. The check costs little and is decisive: put the answer into the ORIGINAL equations, not the reduced ones. If every one balances, no slip can have survived.

2⋅2+3−(−1)=82 \cdot 2 + 3 - \left( -1 \right) = 8
Equation 1, with each unknown replaced by its value. checked
−3⋅2−3+2(−1)=−11-3 \cdot 2 - 3 + 2 \left( -1 \right) = -11
Equation 2, with each unknown replaced by its value. checked
−2⋅2+3+2(−1)=−3-2 \cdot 2 + 3 + 2 \left( -1 \right) = -3
Equation 3, with each unknown replaced by its value. checked