Lecture 7 · Week 2· 17:30
Systems of linear equations
Row picture vs column picture, augmented matrix.
Saved in this browser only. No account needed.
TranscriptThe full text of the lecture. Click any sentence to play the video from there.
Linear equations
Welcome back. Twice already, a question about vectors has turned into a system of linear equations. In the first lecture, we asked which combination of two columns reaches a target. And in the lecture on span, we asked whether a vector lies in a span. Today, systems of linear equations become the main subject. We will say exactly what they are, look at them in two different pictures, and write them in a compact form that the rest of the course will use. Let's start with a single equation. Here is one: two x, plus three y, minus z, equals five. The unknowns are x, y and z. Each unknown is multiplied by a fixed number, and the results are added.
The fixed numbers two, three and minus one are called the coefficients. The number on the right, five, is called the constant term. In general, a linear equation in the unknowns x one up to x n has the form a one x one, plus a two x two, and so on, up to a n x n, equals b. The coefficients and the constant term are numbers from a field, usually the real numbers. What makes an equation linear? Each unknown appears only to the first power, multiplied by a constant. There are no squares, no products of two unknowns, and no unknowns inside functions such as the sine or the square root.
So x squared plus y equals one is not linear, and neither is x times y equals four. But three x equals y plus one is linear. We only need to move y to the left, to get three x minus y equals one. A solution of the equation is a list of numbers, one for each unknown, that makes the equation true when we substitute it. For example, take (one, one, zero). Substituting, two times one, plus three times one, minus zero, is five. So (one, one, zero) is a solution.
Usually an equation has many solutions. The solutions of one linear equation in two unknowns form a line in the plane. In three unknowns, as we saw in Lecture five, they form a plane, and the coefficients make up its normal vector. There are two extreme cases. If every coefficient is zero, the left side is always zero. Then zero equals five has no solution at all, while zero equals zero is solved by everything.
Systems and their solutions
A system of linear equations is a finite collection of linear equations in the same unknowns. A system of m equations in n unknowns looks like this. The coefficient in equation i, in front of unknown j, is written a i j. The first index names the equation, the row. The second names the unknown, the column. And the constant term of equation i is b i. A solution of the system is a list of n numbers that solves every equation at the same time. The set of all solutions is called the solution set.
A system is called consistent if it has at least one solution, and inconsistent if it has none. Here is an example, with three equations in three unknowns. x plus y plus z equals six. Two x minus y plus z equals three. And x plus two y minus z equals two. Let's check whether (one, two, three) is a solution. We substitute x equals one, y equals two, and z equals three, into each equation in turn.
In the first equation, one plus two plus three is six. That holds. In the second, two times one, minus two, plus three is three. That holds too. In the third, one plus two times two, minus three is two. All three equations hold, so (one, two, three) is a solution.
Now try (six, zero, zero). The first equation holds, because six plus zero plus zero is six. But in the second, two times six is twelve, not three. So (six, zero, zero) is not a solution. Satisfying one equation is not enough. A solution must satisfy them all. Two systems in the same unknowns are called equivalent if they have exactly the same solution set. Solving a system will mean replacing it, step by step, by simpler equivalent systems, until the solutions can be read off. That is the method of the next lecture.
The row picture
Now, two ways to see a system. In the row picture, we look at the equations one at a time, as rows. Each equation has its own solution set, and the solutions of the system are the points that lie in all of them at once. Take the system two x plus y equals five, and x minus y equals one. The first equation is a line in the plane. The second equation is another line. A solution must lie on both lines, so it is a point where they cross. Here they cross at the point (two, one).
Let's check it. Two times two, plus one, is five. And two minus one is one. Both equations hold. Two lines do not always cross. Change the second equation to two x plus y equals one. Now the two lines have the same slope, so they are parallel. They never meet, and the system has no solution. In fact, the two equations contradict each other. Their left sides are the same, so five would have to equal one.
And there is a third possibility. Change the second equation to four x plus two y equals ten. That is just the first equation multiplied by two, so it describes the very same line. Every point on that line is a solution, and there are infinitely many. So in the plane, two lines meet in exactly one point, in no point, or in infinitely many points. With three unknowns, each equation is a plane in space. Our example system has three equations, so it has three planes, and they meet in a single point, (one, two, three).
Planes can meet in other ways too. Three planes can share a whole line, like the pages of an open book. Or they can have no common point at all, even when no two of them are parallel. Each pair meets in a line, but the three lines run side by side, like the edges of a tent. In every picture we drew, the number of solutions was zero, one, or infinitely many. Never two, and never seven. This is no accident. It is a theorem.
Zero, one or infinitely many
Here is the theorem. A system of linear equations over the real numbers has either no solution, exactly one solution, or infinitely many solutions. The idea of the proof is simple. If a system has two different solutions, then every point on the line through them is a solution as well. And a line has infinitely many points. This proof is the main argument of today's lecture. It is short, but every step counts, so take it slowly, and feel free to pause or rewatch it.
First, a useful way to write one equation. Collect the coefficients of equation i into a vector, called r i, the row of equation i. Then the left side of the equation is exactly the dot product of r i with the vector x of the unknowns. So equation i reads: r i dot x equals b i. Now suppose that s and t are two different solutions. Then, for every equation i, r i dot s equals b i, and r i dot t equals b i. For any number c, consider the point s plus c times the difference t minus s. When c is zero, this is s. When c is one, it is t. And as c runs through all real numbers, the point runs along the whole line through s and t.
Let's substitute this point into equation i. By the rules of the dot product, r i dot the point equals r i dot s, plus c times the difference, r i dot t minus r i dot s. Both s and t solve the equation, so this is b i, plus c times b i minus b i. The bracket is zero, and what remains is b i. So the point solves equation i. This holds for every equation, so it solves the whole system. And since t minus s is not the zero vector, different values of c give different points. So the system has infinitely many solutions.
That completes the proof. A system cannot have exactly two solutions. As soon as it has two, it has a whole line of them. One remark about fields. The proof works over any field with infinitely many numbers, such as the rational or the complex numbers. But over a finite field there are only finitely many choices of c. Over the field with two elements, for instance, the equation x plus y equals one has exactly two solutions, (one, zero) and (zero, one).
The column picture
Now the second picture. In the column picture, we read the system by columns instead of rows. Go back to two x plus y equals five, and x minus y equals one. Collect the coefficients of x into one column, (two, one), and the coefficients of y into another column, (one, minus one). The constant terms form the right hand side, the vector b, equal to (five, one). Then the system is a single vector equation: x times the first column, plus y times the second column, equals b.
Why is this the same system? Let's compute the left side, one coordinate at a time. In the first coordinate, we get two x plus y. In the second coordinate, we get x minus y. Two vectors are equal exactly when their entries are equal. So the vector equation says that two x plus y equals five, and that x minus y equals one. These are our two equations. So solving the system means finding weights x and y that combine the columns into b. It is a question about linear combinations.
For our system, the weights are two and one. Two copies of the first column take us to (four, two). Then one copy of the second column moves us one to the right and one down, to (five, one), which is b. Let's check the sum one coordinate at a time. Two times (two, one) is the vector (four, two). In the first coordinate, four plus one is five. In the second coordinate, two plus minus one is one. So the combination is (five, one), exactly b. Notice that the two pictures live in different spaces. In the row picture, a point is a choice of the unknowns, so with n unknowns we work in R n. In the column picture, each column has one entry per equation, so with m equations we work in R m.
The column picture gives a new way to say when a system is consistent. The system has a solution exactly when b is a linear combination of the columns, that is, when b lies in the span of the columns. Let's see the three cases again in this picture. In our first system, the columns (two, one) and (one, minus one) do not lie on one line. Their combinations fill the whole plane, so every right hand side can be reached, in exactly one way. In the parallel case, the columns are (two, two) and (one, one). Both lie on the same line through the origin, so every combination stays on that line. But b, which is (five, one), is not on it. No weights can reach it, and the system has no solution.
In the case of the repeated line, the columns are (two, four) and (one, two), and b is (five, ten). Now b lies on the line of the columns, and it can be reached in infinitely many ways. For example, two times the first column plus one times the second gives b. And so does zero times the first column plus five times the second. The same holds in any dimension. Our three by three system asks for weights x, y and z that combine three columns in R three into the vector (six, three, two). The solution (one, two, three) gives the weights, and the three entries of the combination are exactly the three checks we did earlier.
So which picture is right? Both, since they describe the same system. The row picture is easy to see with two or three unknowns. The column picture connects systems to span, and it grows into the central ideas of the course.
Try it yourself
The two pictures move together, and the best way to feel that is to try it. On the website, on this lecture's page, there is an interactive figure with both pictures side by side. On the left is the row picture, with the two lines. On the right is the column picture, with the two columns, a one and a two, and the gold point b. Let's drag b. As b moves on the right, the weights that reach it change, and on the left the crossing point moves with them. The crossing point is always the pair of weights, x and y.
Now change the second equation, so that its coefficients become two and one, the same as in the first. The lines turn parallel, and on the right the two columns fall onto one line. Wherever b is off that line, nothing reaches it, and the lines on the left never meet. Drag b onto the line of the columns, and the two lines on the left become one. The system now has infinitely many solutions.
Try your own systems: lines that cross, lines that are parallel, and lines that coincide, and watch where b sits on the right in each case. The address is on the screen.
The augmented matrix
When we solve a system by hand, the names of the unknowns do no work. Only the numbers matter: the coefficients, and the constant terms. So let's write down just the numbers. A matrix is a rectangular array of numbers from a field. A matrix with m rows and n columns is called an m by n matrix, and the entry in row i and column j is written a i j, just like the coefficients of a system. The coefficient matrix of a system collects all its coefficients, with one row for each equation and one column for each unknown. The augmented matrix adds one more column at the end, the constant terms, usually set off by a vertical line.
Here is our three by three system again. Its first equation gives the first row: one, one, one, and then six. The second equation gives the second row: two, minus one, one, and then three. And the third gives one, two, minus one, and then two. Each row of the augmented matrix is one equation, the object of the row picture. Each column, apart from the last, belongs to one unknown, the object of the column picture. And the last column is the vector b. Two things need care. First, an unknown missing from an equation has coefficient zero, and that zero must be written. Second, the unknowns must appear in the same order in every equation.
Take this system. Two x minus z equals one. Three y plus x equals seven. And z equals four minus y. First, put every equation in standard form, with the unknowns in the order x, y, z on the left, and the constant on the right. The second equation becomes x plus three y equals seven. The third becomes y plus z equals four. Now fill in a zero for each missing unknown. The first equation has no y, the second has no z, and the third has no x. So the augmented matrix has the rows two, zero, minus one, and one. Then one, three, zero, and seven. And zero, one, one, and four.
We can also read a system back from its augmented matrix. A row of zeros followed by a nonzero number, such as zero, zero, zero, and then five, is the equation zero equals five. A system with such a row is inconsistent. In the next lecture, we solve systems by working only on the rows of the augmented matrix, with three simple row operations that never change the solution set. And in week three, the coefficient matrix will act on the vector of unknowns, and the whole system will become one short equation: A x equals b.
Summary
Let's summarise. A linear equation multiplies each unknown by a constant and adds the results. A system is a finite collection of linear equations, and a solution must satisfy all of them at once. In the row picture, each equation is a line, a plane, or in general a flat set, and the solutions are the points common to all of them. In the column picture, the system asks for weights that combine the columns into the right hand side. It is consistent exactly when b lies in the span of the columns.
Over the real numbers, every system has no solution, exactly one, or infinitely many, because two solutions bring a whole line of solutions with them. And the augmented matrix records a system by its numbers alone, one row per equation and one column per unknown, plus the column of constant terms. Before the next lecture, read section two point two of the course book, try the problems on systems on sheet two, and do the lecture check on this lecture's page at Open Semester dot com. Next time, we learn Gaussian elimination, a method that solves every system. See you there.
In this lecture
- Linear equations
- Systems and their solutions
- The row picture
- Zero, one or infinitely many
- The column picture
- Try it yourself
- The augmented matrix
- Summary
Materials
Try it
One system, two pictures
Drag the gold point b, change the coefficients with the sliders, or pick an example. The crossing point on the left is always the pair of weights x, y that reaches b on the right.
Check yourself
3 questions, from warm-up to stretch
Work each one out on paper, type your answer and press Check. Stuck? Open a hint; the worked solution is there when you need it.
- Question 1 of 3 Warm-up
Is a solution of the system , , ? Start with the left side of the third equation at this point.
Hint 1 of 2
A solution of the system is a solution of every equation at once. Put , , into each left side.
Hint 2 of 2
The third left side is . Compare it with the constant term .
Worked solution
- First equation: . True.
- Second equation: . True.
- Third equation: . False.
- The point fails the third equation, so it is not a solution of the system.
- Question 2 of 3 Core
Column picture: find the weights with .
Hint 1 of 2
Compare entries: the first entries give , the second entries give .
Hint 2 of 2
Add the two equations: .
Worked solution
- Entry by entry, the vector equation is the system , .
- Adding the two equations gives , so , and then .
- Check: .
- Question 3 of 3 Stretch
Consider the system , over . For which does it have infinitely many solutions? And how many solutions does it have when ?
Hint 1 of 2
The left side of the second equation is twice the left side of the first.
Hint 2 of 2
Any solution has . Compare this with .
Worked solution
- Any solution of the first equation gives .
- If , the second equation is the first one multiplied by : both describe the same line, and every point of it is a solution, so there are infinitely many.
- If , a solution would force , so there is no solution: in the row picture the lines are parallel and different.
How did it go?