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.

−x−z=22x+2y+z=63x+2y+z=6\begin{aligned} -x - z &= 2 \\ 2 x + 2 y + z &= 6 \\ 3 x + 2 y + z &= 6 \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.

−x−z=22x+2y+z=63x+2y+z=6\begin{aligned} -x - z &= 2 \\ 2 x + 2 y + z &= 6 \\ 3 x + 2 y + z &= 6 \end{aligned}
The result
(x,y,z)=(0,  4,  −2)\left( x, y, z \right) = \left( 0, \; 4, \; -2 \right)

The system has exactly one solution.

checked 49 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 2Step 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
−1-100−1-1222222116633221166
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.

−x−z=22x+2y+z=63x+2y+z=6\begin{aligned} -x - z &= 2 \\ 2 x + 2 y + z &= 6 \\ 3 x + 2 y + z &= 6 \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.
[−10−1222163216]\left[ \begin{array}{rrr|r} -1 & 0 & -1 & 2 \\ 2 & 2 & 1 & 6 \\ 3 & 2 & 1 & 6 \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 −1-1, which turns the pivot −1-1 into 11. Multiplying an equation through by a number that is not zero keeps it true for exactly the same values.

columnworkingnew entry
11−1⋅(−1)-1 \cdot \left( -1 \right)11
22−1⋅0-1 \cdot 000
33−1⋅(−1)-1 \cdot \left( -1 \right)11
44−1⋅2-1 \cdot 2−2-2
Row 1, entry by entry.
[101−222163216]\left[ \begin{array}{rrr|r} \boxed{1} & 0 & 1 & -2 \\ 2 & 2 & 1 & 6 \\ 3 & 2 & 1 & 6 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked

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
222−2⋅02 - 2 \cdot 022
331−2⋅11 - 2 \cdot 1−1-1
446−2⋅(−2)6 - 2 \cdot \left( -2 \right)1010
Row 2, entry by entry: old entry minus the multiple of row 1.
[101−202−1103216]\left[ \begin{array}{rrr|r} \boxed{1} & 0 & 1 & -2 \\ 0 & 2 & -1 & 10 \\ 3 & 2 & 1 & 6 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked

Replace row 3 by R3−3R1R_{3} - 3 R_{1}. 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
113−3⋅13 - 3 \cdot 100
222−3⋅02 - 3 \cdot 022
331−3⋅11 - 3 \cdot 1−2-2
446−3⋅(−2)6 - 3 \cdot \left( -2 \right)1212
Row 3, entry by entry: old entry minus the multiple of row 1.
[101−202−11002−212]\left[ \begin{array}{rrr|r} \boxed{1} & 0 & 1 & -2 \\ 0 & 2 & -1 & 10 \\ 0 & 2 & -2 & 12 \end{array} \right]
The matrix now. The boxed entry is the pivot being worked on. checked
3

Pivot 2: column 2, row 2

4

Pivot 3: column 3, row 3

5

Read the answer off the reduced matrix

6

Check the answer in every original equation