Take the lines and . Where do these lines intersect? We find a point that satisfies both equations. In algebra, you learned a couple of methods by which you can find this point. You may solve one of the equations for and substitute it back into the second equation (the substitution method). Or you may multiply equations by a scalar and add them together so that the coefficient on one of the variables becomes zero (the elimination method).
Another method, which largely relies on the elimination method, is to consolidate the numbers involved in the system into what is called an augmented matrix. We ignore the and —who cares what the variables are?—and write the system as follows:
Arrays of numbers like this one have the valuable property that computer programs really, really like them. The more ones and zeroes we can put onto the left side of the bar, the simpler our system becomes and the easier it is to read its solution.
Reduced row echelon form
An augmented matrix that has been simplified as much as possible is said to be in reduced row echelon form and has the following three properties.
- The first nonzero entry in each row, called a pivot, is 1.
- Each pivot occurs strictly to the left of each pivot below it.
- Each pivot is the only nonzero entry in its column.
We will render the example matrix into reduced row echelon form and see how easy the corresponding system is to read. To make the first entry in the first row a one, we divide the row by 4. This is fine because it corresponds to dividing the first equation by 4, and as we know, it’s fine to multiply both sides of an equation by the same number.
We can also add multiples of rows to each other, just like you can add equations together. To make the first 1 in the second row a zero, we can just subtract the first row from the second one.
Now the first column satisfies the rules of reduced row echelon form: its first entry is a 1, and all other entries are 0. We move to the right and down (since the pivot in the first row must occur to the left of all lower pivots); the must be turned into a 1. How? We divide by , or, multiply by .
We have made the first nonzero entry in the second row into a one, but it is not the only nonzero entry in its column. We must make the into a zero. That will be accomplished by multiplying the second row by and subtracting it from the first row.
This matrix is in reduced row echelon form. Most importantly, we can translate it back into a system of equations. That system is now
or, simpler, and . If you plug back into the original two equations, you will see that this is a solution.
Infinitely many solutions
A system of equations has infinitely many solutions when, loosely speaking, there is not enough information to nail down the value of each variable. Algebraically speaking, there are too few independent equations in the system. We’ll delve further into the idea of linear independence later on, but for a list of equations to be independent, it must be impossible to build one equation out of the others. Let’s see an example. Let’s find the intersection of the planes
Can’t see it? The third equation is the difference between the second and third. When we code the system into an augmented matrix
and whittle it into reduced row echelon form
it reveals to us that one of our equations was but a straw puppet, held aloft by the other two. (In other words: nothing to see here.) The row of all zeroes signals a redundant equation. How do we read this solution, then? Remember that this corresponds to the equations
You already knew, perhaps from calculus, that the intersection of two planes is a single line. This line is given by the column vector
(which you used to write with angle brackets in multivariable calculus!) or, even better, the parametric equation
which was broken up using the rules of addition and scalar multiplication of vectors from calculus. The parametric equation is a useful representation of the line. The constant vector is where the line “starts” (think about the -intercept of a two-dimensional line), and the vector multiplied by is the direction the line travels in (its slope).
This example illustrates that when your system has infinitely many solutions, as in this case, as many variables as necessary are free (like the ) to take all appropriate values (usually all real numbers) and the rest are expressed in terms of the free variables (like the and here).
Sometimes your system will not have a solution. The lines and do not intersect, as they are parallel. Therefore something should go wrong when we try to row-reduce the augmented matrix
which, translating our equations back from the augmented matrix, seems to say (in the second equation) that . Of course, , not . If a system has no solution, or is inconsistent, row reduction will illuminate that with a contradiction.
Given a system of linear equations in variables, there are three outcomes. If and all equations are independent, i.e. one cannot be built out of the others through addition and subtraction of multiples, then there will be a single solution to the system. The left-hand side of the augmented matrix may be manipulated into a matrix with ones on the diagonal and zeros everywhere else.
If the system is redundant, row-reduction will reveal this by making one or more of the rows into a row of all zeros. In that case, not every variable can be assigned a unique value. The ones that can’t are free variables and allowed to take any allowable value, and the remaining variables are written as functions of these variables.
Finally, if the system is inconsistent, row-reduction will also show this by making one of the rows contradictory, usually by asserting something nonsensical like .
Moving forward, we will abstract the idea of matrices and learn what kind of algebraic structure (addition, multiplication, so forth) they have. We will learn that they have a lot of very elegant properties that contribute to understanding linear systems and the many applications in which they are found.
In Octave, run
A = floor(10*rand(m,n))
with m and n appropriate integers to kick up an example of a matrix to row-reduce. For example, if you would like to solve a system that may have a unique solution for a single output, let m be some number and n = m + 1 and draw the bar before the n-th column. Run
to check yourself. If you would like to make sure the numbers are nice and the solution is unique, run
A = floor(10*rand(n,n)) x = [x1, x2, ..., xn] b = A*x
where x1, x2, …, xn are your chosen solutions, and row-reduce [A|b]. Use
to check yourself.
Or, y’know, rent the textbook.