Linear Algebra / Unit 2, Systems of Linear Equations / Topic 2.3
Unit 2. Systems of Linear Equations
This topic shows how to read the number of solutions of a system from its row echelon form, and how to write all of the solutions when there are infinitely many.
You need Topics 1.3, 2.1, and 2.2 for this topic.
In Topic 2.1, a system of two equations in two unknowns had exactly one solution, no solution, or infinitely many solutions. The same three outcomes are the only ones for any linear system, with any number of equations and unknowns. A linear system never has exactly two solutions, or exactly five.
The reason comes from Topic 1.3. Each linear equation can be written as n · r = c, where n holds the coefficients and r holds the unknowns. Suppose that p and q are two different solutions, so that n · p = c and n · q = c. Take any point on the line through them, r = p + t(q − p). Then
n · r = n · p + t(n · q − n · p)the dot product, term by termn · r = c + t(c − c)both p and q are solutionsn · r = cthe point r is also a solutionThe point r satisfies the equation for each value of t. This is true for each equation of the system. So if a system has two solutions, all of the points on the line through them are solutions as well, and the system has infinitely many solutions.
Row reduction shows which outcome a system has. Consider this system and its augmented matrix.
x + 2y + z = 4 2x + 4y + 3z = 9 3x + 6y + 4z = 14 1214243936414The operations R₂ → R₂ − 2R₁ and R₃ → R₃ − 3R₁ make zeros in column 1. Then R₃ → R₃ − R₂ gives the row echelon form.
121400110012 then 121400110001The last row states 0x + 0y + 0z = 1, which is 0 = 1. No values of x, y, and z make this true, so the system has no solution. A system with no solution is called inconsistent.
A system has no solution exactly when its row echelon form has a row with zeros on the left of the line and a number that is not 0 on the right of the line.
Change the last right side of the system from 14 to 13. The same three operations now give
1214243936413 then 121400110000The last row states 0 = 0, which is true and gives no information. Two equations remain for three unknowns.
The pivots are in column 1 and column 3. Column 2 has no pivot. An unknown whose column has a pivot is called a pivot variable, and an unknown whose column has no pivot is called a free variable. Here x and z are pivot variables, and y is a free variable.
A free variable can take any value. Call that value t. The pivot variables are then found by back substitution.
All of the solutions can be written in one expression, called the general solution.
xyz = 3 − 2tt1the three unknowns in terms of txyz = 301 + t −210separate the part without t from the part with tThis is the parametric form of a line from Topic 1.3, with the point (3, 0, 1) and the direction (−2, 1, 0). Each value of t gives one solution. For example, t = 1 gives (1, 1, 1). Check:
1 + 2 + 1 = 4the first equation2 + 4 + 3 = 9the second equation3 + 6 + 4 = 13the third equationThe two examples lead to a rule for any system. Reduce the augmented matrix to row echelon form, and then read it.
| Row echelon form | Solutions |
|---|---|
| Has a row that states 0 = c, with c not 0 | None |
| Has no such row, and each column of unknowns has a pivot | Exactly one |
| Has no such row, and at least one column of unknowns has no pivot | Infinitely many |
The number of free variables is the number of unknowns minus the number of pivots. With one free variable, the solutions form a line. With two free variables, they form a plane.
The number of pivots of a matrix is called its rank. The matrix of coefficients in the examples above has the rank 2. Topic 4.4 studies the rank in detail.
Try it: three equations in two unknowns
Each equation is a line. Lines 1 and 2 do not change. Move the slider to change the right side c of the third equation. The system has a solution only when all three lines pass through one point.
The drawing shows why a system with more equations than unknowns usually has no solution. Two lines fix a point, and a third line passes through that point only for one value of c. Row reduction finds that value: the last row of the row echelon form states 0 = c − 4.
A system is called homogeneous when all of its right sides are 0.
x + 2y + z = 0 2x + 4y + 3z = 0 3x + 6y + 4z = 0A homogeneous system always has at least one solution, because setting each unknown to 0 makes each equation true. This solution is called the zero solution, or the trivial solution. The question for a homogeneous system is whether it has other solutions.
The right sides stay 0 during row reduction, so the row echelon form has the same left side as in Part 3. Again y is free, and back substitution gives z = 0 and x = −2t.
xyz = t −210A homogeneous system has solutions other than the zero solution exactly when it has a free variable.
Compare this with the general solution in Part 3, which was (3, 0, 1) + t(−2, 1, 0). The general solution of a system is one particular solution plus all of the solutions of the homogeneous system with the same coefficients. This structure appears again in differential equations and in quantum mechanics.
Each row has at most one pivot, and each column has at most one pivot. So the number of pivots cannot be larger than the number of equations, and it cannot be larger than the number of unknowns. Two useful facts follow.
When the matrix of coefficients of a system with n equations and n unknowns has fewer than n pivots, the matrix is called singular. Such a system has no solution or infinitely many solutions, depending on the right sides. This is the meaning of the error Singular matrix in the Python practice of Topic 2.1.
Each equation in x, y, and z is a plane. Three planes can meet in several ways.
| The three planes | Solutions |
|---|---|
| Meet at one point | Exactly one |
| Meet along one line, like three pages of an open book | Infinitely many, with one free variable |
| Are the same plane | Infinitely many, with two free variables |
| Have no common point, because two of them are parallel | None |
| Have no common point, although each pair meets along a line | None |
In the last case the three lines where the pairs meet are parallel, and the planes form a shape like the three sides of a tent with no ends. The system in Part 2 is of this kind.
| Term | Meaning |
|---|---|
| Inconsistent system | A system with no solution |
| Pivot variable | An unknown whose column has a pivot |
| Free variable | An unknown whose column has no pivot |
| General solution | One expression, with parameters, that gives all of the solutions |
| Homogeneous system | A system in which all of the right sides are 0 |
| Rank | The number of pivots |
| Singular matrix | A square matrix of coefficients with fewer pivots than columns |
Work each problem on paper first. Then open the answer to check your work.
None. The last row states 0 = 5, which is false.
Column 3 has no pivot, so z is free. Let z = t.
x = 1 − 2trow 1y = 4 + trow 2(x, y, z) = (1, 4, 0) + t(−2, 1, 1)the general solution
R₂ → R₂ − 2R₁gives a row of zerosR₃ → R₃ − R₁gives the row (0, 0, −2, −2)z = 1the row states −2z = −2y = tcolumn 2 has no pivot, so y is freex = 3 − t − 1 = 2 − trow 1, with y = t and z = 1(x, y, z) = (2, 0, 1) + t(−1, 1, 0)the general solution
R₂ → R₂ − 2R₁ gives the row (0, 0, k − 6).
If k = 6, the row states 0 = 0, and the system has infinitely many solutions. For any other value of k, the system has no solution.
R₂ → R₂ − 2R₁gives the row (0, −1, 3, 0)y = 3zthe second rowz = tz is freey = 3tsubstitute z = tx = z − y = −2tthe first row(x, y, z) = t(−2, 3, 1)the solutions−2 + 3 − 1 = 0the check in the first equation, with t = 1−4 + 3 + 1 = 0the check in the second equation, with t = 1
The number of free variables is 5 − 3 = 2.
Each row has a pivot on the left of the line, so no row states 0 = c. The system has infinitely many solutions.
Python reads the code one line at a time, from the top to the bottom. The equals sign stores the value on its right under the name on its left, and print shows a result. The name np stands for NumPy, the part of Python that works with vectors and matrices. A matrix is typed one row at a time, with each row inside its own square brackets.
The instruction np.linalg.matrix_rank gives the rank of a matrix, which is the number of pivots in its row echelon form. The code below finds the rank of the matrix of coefficients from Parts 2 and 3 of this topic.
Python
The result is 2. The system has 3 unknowns and 2 pivots, so one column has no pivot.
A system has no solution when its row echelon form has a pivot in the last column of the augmented matrix, on the right of the line. In that case the augmented matrix has one more pivot than the matrix of coefficients. So the test is to compare the two ranks.
The code below stores the augmented matrix from Part 3, with the right sides 4, 9, and 13 as a fourth column.
Python
Both ranks are 2, so the system has a solution. The rank is smaller than the number of unknowns, so the system has infinitely many solutions.
In the next box, change the augmented matrix to the one from Part 2, where the last right side is 14.
Python
The ranks are now 2 and 3. The augmented matrix has a pivot on the right of the line, so the system has no solution.
The general solution in Part 3 is (3, 0, 1) + t(−2, 1, 0). The code below builds the solution for one value of t. The last line uses the @ sign, which multiplies a matrix by a vector. The result holds the left side of each equation for the values in x. Topic 3.1 explains this product.
Python
The first result is the solution (1, 1, 1). The second result is [4 9 13], which are the right sides of the three equations. So (1, 1, 1) is a solution.
In the next box, change t to any other number and press Run. The second result should not change.
Python
From Part 5, the multiples of (−2, 1, 0) are solutions of the homogeneous system with the same coefficients. The code below tests one multiple.
Python
The result is [0 0 0], so 5 times (−2, 1, 0) makes each left side equal to 0.
In the next box, replace the zeros so that d is a solution of the homogeneous system in Practice Problem 5, other than the zero solution. The matrix has two rows, because that system has two equations.
Python
This quiz has 5 questions on this topic. A question asks you either to choose one answer or to type numbers. The page grades your answers and explains each one. A number can be typed as a whole number, a decimal, a fraction such as 1/3, or a calculation such as sqrt(18)/2 or arccos(1/2). The page shows the value of a calculation next to the box. Angles in a calculation are in degrees. The Calculator button under each question opens a calculator. Your answers are saved in your browser, so they are still on the page when you come back to it.
Choose how your answers are checked
1. The row echelon form of an augmented matrix has the last row 0 0 0 | 4. How many solutions does the system have?
The row states 0x + 0y + 0z = 4, which is 0 = 4. No values of the unknowns make this true, so the system has no solution.
2. A system with three unknowns has at least one solution, and its row echelon form has two pivots. How many solutions does the system have?
Three unknowns and two pivots leave one free variable. Each value of the free variable gives one solution, so there are infinitely many solutions.
3. A system has 6 unknowns, and its row echelon form has 4 pivots. How many free variables does the system have?
Each unknown either has a pivot in its column or is a free variable. So the number of free variables is 6 − 4 = 2.
4. The reduced row echelon form of a system in x, y, and z is 103201−15. The free variable is z. Find x and y when z = 1.
x + 3z = 2the first rowy − z = 5the second rowx = 2 − 3 = −1substitute z = 1 into the first rowy = 5 + 1 = 6substitute z = 1 into the second row
5. For which value of k does the system x + 3y = 2, 2x + 6y = k have at least one solution?
The operation R₂ → R₂ − 2R₁ leaves the second row 0 0 | k − 4. The system has a solution only when this row states 0 = 0, so k = 4.