Solving Ax = 0: Pivot Variables, Special Solutions
The null space stops being a definition and becomes a computation. Elimination, extended to rectangular matrices, sorts the columns into pivot columns and free columns; assigning the free variables the special values one and zero produces the special solutions, and every vector in the null space is a combination of them. One number runs the whole show — the rank r, the count of pivots — leaving exactly n minus r special solutions.
Lectures five and six defined the null space and the column space — what’s in those spaces. Now Strang wants to actually describe them: how do you compute all the vectors in the null space? “This is turning the idea, the definition, into an algorithm.” The algorithm for solving Ax=0.
The running example is deliberately rectangular — this whole chapter is about rectangular matrices:
A=1232462682810
Before any computing, Strang eyeballs it. Column two is a multiple of column one — same direction, not independent. And row one plus row two gives row three, so the third row isn’t independent either. “All that should come out of elimination.” The algorithm is elimination — but extended to the rectangular case, where we keep going even when a zero shows up in a pivot position.
One thing to hold onto throughout: elimination does not change the null space. Subtracting a multiple of one equation from another is a legitimate operation on the equations — the solutions of the system don’t move. (The column space does change, as we’ll see — you have to pay attention to what elimination leaves unchanged.) And since the right-hand side is all zeros, it stays all zeros; there’s no point writing it down.
Elimination on a rectangular matrix: the echelon form U
The first pivot is the 1 in the corner, and you know what to do with it. Subtract 2 times row one from row two, and 3 times row one from row three:
1232462682810⟶100200222244
On to the second column. The pivot position holds a zero — that’s signaling a difficulty. Look below, hoping for a nonzero to row-exchange with: zero there too. What that’s really telling us is that column two is a combination of the earlier columns — it’s dependent. But we don’t stop to think; in that column there’s nothing to do, so we go on to the next column. There sits a perfectly good pivot, the 2. The multiplier is one: subtract row two from row three, and out comes a row of zeros.
U=100200220240
Strang can’t quite call U upper triangular — it’s in echelon form. “The word echelon means, like, staircase form”: the nonzeros come down in a staircase. That row of zeros at the bottom is elimination discovering what we saw by eye: row three was a combination of rows one and two, and elimination knocked it out.
Pivot variables, free variables, special solutions
Now solve Ux=0 — same null space as Ax=0. There are solutions: three equations (really two, as it turned out), four unknowns — solutions were guaranteed.
Here’s the critical step. Separate the columns into two kinds. Columns one and three hold the pivots: they are the pivot columns, and x1,x3 are the pivot variables. Columns two and four are the free columns, and x2,x4 are the free variables. Why “free”? Because we may assign any numbers to x2 and x4, freely — and then the equations determine x1 and x3 by back substitution. In equations, Ux=0 says
x1+2x2+2x3+2x42x3+4x4=0=0
First choice: set x2=1, x4=0 — a free choice, but a convenient one. Back up from the last equation: x4=0 forces x3=0; then the first equation gives x1=−2. One solution found:
x=−2100
Check what it says about the columns: minus two of column one plus one of column two is the zero column — of course, since column two is twice column one. And once we have one solution, we have a line of them: any multiple c(−2,1,0,0) is in the null space too — an infinitely long line in four-dimensional space.
Is that the whole null space? No — there are two free variables, and we’ve only made one choice. Second choice:x2=0, x4=1. This solution is guaranteed to be new — no multiple of the first one can put a 1 in the fourth slot. Back substitution: 2x3+4=0 gives x3=−2; then x1−4+2=0 gives x1=2:
x=20−21
The whole null space: n − r special solutions
Now we can describe the complete null space — all solutions of Ax=0. Take all combinations of the special solutions. Don’t forget the crucial plus sign:
x=c−2100+d20−21
That’s a complete algorithm. Do elimination, pressing onward when a column offers nothing. Count the pivots — that’s r. Give the n−r free variables their zero–one values, back-substitute for the pivot variables, and take all combinations.
Going further: the reduced row echelon form R
Strang could stop at U, but he wants to clean the matrix up “as good as it can be.” Two more moves. First, eliminate upwards — get zeros above the pivots as well as below. Subtracting row two of U from row one turns the 2 above the second pivot into a 0 (and produces a −2 in the last column). Second, divide each row by its pivot so the pivots equal 1 — dividing an equation by 2 changes no solutions. The result is R, the reduced row echelon form:
R=100200010−220
Matlab produces it in one command: rref(A). And R carries all the information as clearly as it can be carried. Pivot rows one and two, pivot columns one and three — and sitting in those pivot rows and columns is the 2×2identity matrix. In the free columns sits the free partF: the entries 2,0 in column two and −2,2 in column four. Zero rows below, recording that the original third row was a combination of the others.
Here’s why, in block form. Pretend the pivot columns come first (a typical reduced form):
Do all the special solutions at once by building a null space matrixN whose columns are the special solutions, so that RN=0 (that’s the teaching-code command null(A)). The equation Rx=0 says: (pivot variables) +F⋅ (free variables) =0, so the pivot variables equal −F times the free variables. Put the identity in the free-variable part, and −F appears in the pivot part:
N=[−FI]
Back substitution, when the system has been reduced this far, is totally simple.
The same algorithm on the transpose
To practice, Strang runs the whole thing again on AT — “just for the heck of it.” Before calculating, predict: this matrix has three columns, and the third column is the sum of the first two, so we expect two pivot columns and one free column. Elimination had better discover that.
Problems
Run the lecture’s algorithm yourself — elimination, rank, free variables, special solutions — before opening the solutions.
Problem 7.1The full algorithm
Find all solutions of Ax=0 for
A=120360142284
Give the rank, identify the pivot and free variables, and write the null space as all combinations of special solutions.
Show solution
Subtract 2 times row one from row two:
100300122244
Column two has a zero pivot position with zeros below — move on. Column three has pivot 2; subtract row two from row three:
U=100300120240
Two pivots, so r=2. Pivot variables x1,x3; free variables x2,x4; there will be 4−2=2 special solutions.
Set x2=1,x4=0: the second equation 2x3+4x4=0 gives x3=0; the first, x1+3x2+x3+2x4=0, gives x1=−3. Special solution (−3,1,0,0).
Set x2=0,x4=1:2x3+4=0 gives x3=−2; then x1−2+2=0 gives x1=0. Special solution (0,0,−2,1).
The null space is
x=c−3100+d00−21
Problem 7.2Reading solutions off R
Continue Problem 7.1: reduce U to the reduced row echelon form R, identify the identity part I and the free part F, and confirm that the special solutions are the columns of N with −F in the pivot variables and I in the free variables.
Show solution
Eliminate upward — subtract 21 of row two from row one to clear the 1 above the second pivot — then divide row two by 2:
R=100300010020
The identity sits in the pivot rows and pivot columns (columns one and three). The free columns (two and four) hold
F=[3002]
Then −F placed in the pivot slots x1,x3 and the identity in the free slots x2,x4 gives exactly the special solutions (−3,1,0,0) and (0,0,−2,1) found by back substitution: the entries 3,0 and 0,2 reappear with their signs switched. RN=0 checks.
Problem 7.3Counting with the rank
(a) A matrix A is 5×7 with rank 4. How many free variables and how many special solutions does Ax=0 have? (b) For which relationship between r and n does the null space contain only the zero vector? (c) B is 7×5 with rank 4 — how many special solutions now? Why does the rank not change in passing from a matrix to its transpose here?
Show solution
(a) Free variables: n−r=7−4=3, so there are 3 special solutions, one per free variable.
(b) The null space is only x=0 exactly when there are no free variables: n−r=0, i.e. r=n — a pivot in every column.
(c) Now n=5, so n−r=5−4=1: one special solution. The rank is the same 4 because, as the lecture notes, the number of pivot columns of A and AT is the same — but the number of special solutions changes, since it depends on n, the number of columns.
Problem 7.4Predict, then verify
The third column of
A=1232593712
is the sum of the first two. Before computing: what rank do you expect, and how many special solutions? Then run elimination and find the whole null space.
Show solution
Prediction: columns one and two are independent, column three depends on them — so two pivot columns, rank 2, and 3−2=1 special solution.
Elimination: subtract 2 times row one from row two, and 3 times row one from row three:
100213313⟶U=100210310
(subtracting 3 times row two from row three). Rank 2 as predicted; x3 is free.
Special solution: set x3=1. Then x2+x3=0 gives x2=−1, and x1+2(−1)+3(1)=0 gives x1=−1. Check: −c1−c2+c3=0, which is exactly the dependence we spotted. The null space is the line