๐Ÿงฎ Linear Algebra Kingdom ยท Linear Algebra

Linear Systems in Matrix Form

A system of equations rewritten as one matrix equation: build the augmented matrix, read a matrix back as a system, solve two and three unknowns by elimination, and decide from the reduced form whether there is one solution, none at all, or a whole line of them.

In short

  • A system becomes an augmented matrix: one row per equation, one column per unknown in a fixed order, and the constants past the bar. A missing term is a 0 and still needs its column.
  • The three row operations are reversible, so reducing a matrix never changes the collection of solutions it describes.
  • A row of zeros beside a number that is not zero means no solution; a row of zeros beside a zero means nothing at all.
  • With no contradiction row, pivots equal to unknowns gives exactly one solution, and fewer pivots than unknowns gives infinitely many, one for each value of each free unknown.

The equals signs were never doing any work

Look at a system of equations and ask what is actually carrying the information.

2x + 3y = 12 x - y = 1

The letters x and y appear in every line, always in the same order, always in the same place. So do the plus signs and the equals signs. Cross all of that out and what is left is six numbers in a rectangle:

[[2, 3 | 12], [1, -1 | 1]]

That is the augmented matrix of the system. One row per equation. One column per unknown, in a fixed order that never changes. The bar is where the equals sign used to be, and the column past it holds the constants.

Three rules make this reliable, and every one of them is the source of a classic slip.

One column per unknown, even when a term is missing. The equation x + 2z = 5, in three unknowns, is the row [1, 0, 2 | 5]. A missing term is a coefficient of 0, and its column still has to be there holding that 0. Leave it out and every column to its right shifts one place left and now means something else.

Nothing crosses the bar. The bar is a record of where the equals sign was, not an instruction to move anything. The constant 12 stays 12; it does not become -12 on the way in. This is worth saying out loud, because so much of algebra is about moving terms across an equals sign that the hand does it by habit.

Rows read left to right, never columns downward. The first row of the matrix is the whole of the first equation, in order. Reading down a column collects the coefficients of one unknown across every equation, which is a useful thing but is not an equation.

The trip runs both ways. Handed the matrix [[1, 0, -4 | 7], [0, 1, 2 | -3]] with unknowns x, y, z, you read off x - 4z = 7 and y + 2z = -3.

Reduce it, then read the answer off

A matrix is not the point. Being able to change it without changing what it says is the point.

Three operations do that, and all three are reversible:

  • swap two rows
  • multiply a row by a number that is not zero
  • add a multiple of one row to another row

Reversible matters. Each one can be undone by another operation of the same kind, so the collection of solutions after the operation is exactly the collection before it. Nothing is gained and nothing is lost.

Aim them all at one target: get a 1 at the front of each row you use, with 0s above and below it, working left to right. The 1 is called a pivot. When no more progress is possible the matrix is in reduced row echelon form, and it looks like this:

[[1, 0 | 3], [0, 1 | -2]]

which reads x = 3, y = -2. The answer is simply sitting there, past the bar.

Here is the small mercy of this craft: you cannot get lost. Substitution asks you to choose which equation to rearrange and which variable to isolate, and a bad choice costs a page of algebra. Row reduction asks nothing. Clear the first column, then the second, then the third. When the columns run out, so does the work.

Fractions may appear halfway through and that is normal. In this craft the systems are built so that every unknown comes out whole at the end, so a fraction in the middle is a sign you are working, not a sign you are lost.

One solution, none at all, or a whole line of them

Two straight lines in a plane cross once, run parallel and never meet, or lie exactly on top of each other. Those are the only three things a linear system can do, in any number of unknowns, and the reduced matrix says which one plainly.

Look for a contradiction row first. A row of nothing but zeros with a number that is not zero beside it โ€”

[0, 0, 0 | 5]

reads 0 = 5. No choice of the unknowns makes that true, so the system has no solution, and that is the end of the matter no matter how tidy the other rows look.

Two things about such a row catch people out. First, a row that reads 0 = 0 is not a contradiction: it is a repeat of what the other rows already said, and it can be ignored. Second, a contradiction row holds no pivot in the coefficient part, so it adds nothing to the pivot count either.

If there is no contradiction, count pivots against unknowns. Every unknown whose column holds a pivot is pinned to one value. Any unknown whose column holds no pivot is free: it may take any value at all.

  • pivots = unknowns: exactly one solution
  • pivots fewer than unknowns: infinitely many solutions

There is no fourth ending. A linear system never has exactly two solutions, and the reason is worth keeping: if two different points both solve it, then every point on the line between them solves it as well. Two solutions immediately means infinitely many.

Describing infinitely many, and finding one of them

"Infinitely many" is an answer, but it is not a useful one on its own. Say which infinitely many.

Take the reduced matrix

[[1, 2, 0 | 5], [0, 0, 1 | -1]]

in the unknowns x, y, z. Pivots sit in the x column and the z column. The y column has none, so y is free. Reading the rows: x + 2y = 5 and z = -1, so

x = 5 - 2y, y = anything, z = -1

That is the whole solution set, written in terms of the free unknown. Every value of y gives one point, and together they trace a line through space.

A particular solution is one point off that line, and the cheapest one to name is the point you get by setting every free unknown to 0. Here that gives x = 5, y = 0, z = -1, or (5, 0, -1).

Two habits make this reliable. Write out a value for every unknown, the free ones included โ€” a free unknown set to 0 still takes its place in the list, and dropping it gives an answer with the wrong number of entries. And match each constant to the column its pivot sits in, not to the row it arrived in: in the matrix above the second row's constant belongs to z, not to y.

The count of free unknowns has its own name, and it is worth being exact about: it is the number of columns before the bar that hold no pivot. The column past the bar is never an unknown, and the number of rows never enters the count.

A word problem is a system wearing a coat

Blending two powders, counting carts through a junction, balancing a reaction: all three end up as the same rectangle of numbers, and the modelling is always three steps.

Name the unknowns. Say what each letter counts, in words, before writing anything else. "Let p be the bags of pale dust" is a step, not a formality โ€” half the mistakes in word problems are a letter quietly changing meaning halfway down the page.

One equation per fact. A batch of 14 bags gives p + d = 14. A cost of 62 gold at 6 and 3 gold a bag gives 6p + 3d = 62. At a junction, what arrives in an hour equals what leaves in that hour, once per junction. In a reaction, the count of each element on the left equals its count on the right, once per element.

Stack them and reduce. Nothing about the story survives into the matrix, which is exactly why the method is worth having: [[1, 1 | 14], [6, 3 | 62]] does not care whether it came from dust or from carts.

Then check the answer against the story before writing it down. Bags come in whole numbers and cannot be negative; a count of carts cannot be negative either. An answer that the arithmetic allows but the story does not is a signal to look again at the second step, where the facts became equations.

Worked examples

Example 1

Solve the system by elimination: 2x + 3y = 12, x - y = 1. Give the pair (x, y).

  1. Write the augmented matrix, one row per equation: [[2, 3 | 12], [1, -1 | 1]].
  2. Swap the rows so the leading 1 is at the top: [[1, -1 | 1], [2, 3 | 12]].
  3. Take 2 times the first row from the second to clear the x column: [[1, -1 | 1], [0, 5 | 10]].
  4. Divide the second row by 5: [[1, -1 | 1], [0, 1 | 2]], so y = 2.
  5. Add the second row to the first to clear the y column: [[1, 0 | 3], [0, 1 | 2]].
  6. Reading it off, x = 3 and y = 2. The answer is (3, 2).

Example 2

Row reduction leaves the augmented matrix [[1, 0, 2 | 4], [0, 1, -3 | 1], [0, 0, 0 | 6]]. How many solutions does the system have?

  1. Check for a contradiction row first. The third row is [0, 0, 0 | 6].
  2. That row reads 0x + 0y + 0z = 6, which is 0 = 6.
  3. No values of x, y and z can make that true, so nothing else in the matrix matters.
  4. The system has no solution.

Example 3

The reduced augmented matrix [[1, 4, 0 | 7], [0, 0, 1 | -2]] describes a system in x, y, z. Set the free unknown to 0 and give the solution that comes out.

  1. Find the pivots: a leading 1 in the x column and a leading 1 in the z column.
  2. The y column holds no pivot, so y is the free unknown.
  3. Set y = 0. The first row reads x + 4(0) = 7, so x = 7.
  4. The second row reads z = -2.
  5. Writing every unknown, including the free one: (7, 0, -2).

Practice problems, with solutions

Three problems of increasing difficulty, each with the full working. In the game these are generated fresh every time; these three are fixed so this page always shows the same ones.

Problem 1

Difficulty 1 of 5

Pivot Hall files every system as one rectangle of numbers. 4x + 2y = 17 4x + 3y = 18 Which augmented matrix stands for this system? The bar marks where the equals sign was.

  1. [[4, 4 | 17], [2, 3 | 18]]
  2. [[17, 4 | 2], [18, 4 | 3]]
  3. [[4, 2 | -17], [4, 3 | -18]]
  4. [[4, 2 | 17], [4, 3 | 18]]

Answer: D. [[4, 2 | 17], [4, 3 | 18]]

  1. 4x + 2y = 17 becomes the row [4, 2 | 17].
  2. 4x + 3y = 18 becomes the row [4, 3 | 18].
  3. Stacking the rows gives [[4, 2 | 17], [4, 3 | 18]].

Problem 2

Difficulty 3 of 5

Solve this system by elimination. x = 5 3x + y = 9 The augmented matrix of that system is [[1, 0 | 5], [3, 1 | 9]]. Give your answer as the pair (x, y).

Answer: (5, -6)

  1. Augmented matrix: [[1, 0 | 5], [3, 1 | 9]].
  2. Scale row 1 by 3 and row 2 by 1, then subtract, so that the x-column clears.
  3. That leaves y = -6, so y = -6.
  4. Substitute y = -6 into x = 5 to get x = 5.
  5. Solution: (5, -6).

Problem 3

Difficulty 4 of 5

A survey of the lattice returns three readings at once. x + 3z = 4 -2x - 5z = -8 -4x + y - 9z = -8 The augmented matrix is [[1, 0, 3 | 4], [-2, 0, -5 | -8], [-4, 1, -9 | -8]]. What is y? Give the one number.

Answer: 8

  1. Augmented matrix: [[1, 0, 3 | 4], [-2, 0, -5 | -8], [-4, 1, -9 | -8]].
  2. Clear the first column using row 1, then the second column using row 2, then the third using row 3.
  3. The reduced form is [[1, 0, 0 | 4], [0, 1, 0 | 8], [0, 0, 1 | 0]].
  4. So x = 4, y = 8 and z = 0.
  5. The question asked for y, which is 8.

Common mistakes

  • Changing the sign of a constant as it crosses the bar. The bar records where the equals sign was; the constant is already on the right-hand side and stays exactly as written.
  • Leaving out the column of a term that does not appear in an equation. A missing term has coefficient 0, and dropping its place shifts every column after it.
  • Reading a row of zeros beside a 0 as a contradiction. It only repeats what the other rows said; a contradiction needs a constant that is not zero.
  • Counting the column past the bar among the unknowns when counting free unknowns. Only the coefficient columns belong to unknowns.
  • Giving a particular solution with the free unknowns left out. Every unknown needs a value in the answer, and a free one set to 0 still takes its place in the list.

What you should be able to do

  • Write a system as an augmented matrix, and read an augmented matrix back as a system.
  • Solve a system of two or three equations by row reduction.
  • Decide from a reduced matrix whether a system has one solution, no solution, or infinitely many.
  • Describe an infinite solution set with a free variable, and find the value that makes a system inconsistent.

Where this fits in the curriculum

Common Core

  • HSA-REI.C.8

    High school โ€” Represent a system of linear equations as a single matrix equation in a vector variable.

    HSA-REI.C.8 is a (+) standard โ€” beyond the college- and career-ready threshold, i.e. precalculus rather than Algebra II.

  • HSA-REI.C.9

    High school โ€” Find the inverse of a matrix if it exists and use it to solve systems of linear equations (using technology for matrices of dimension 3 ร— 3 or greater).

    HSA-REI.C.9 is a (+) standard โ€” beyond the college- and career-ready threshold, i.e. precalculus rather than Algebra II.

Learn these first

This leads on to