Lecture 7 · Solving $A\boldsymbol{x}=\boldsymbol{0}$: Host variables and special solutions
Use pivot components and free variables to write all solutions to Ax=0, and understand special solutions and null spaces.
On this page
Solving Ax = 0: pivot variables, special solutions | Gilbert Strang | MIT 18.06 Linear Algebra
Lecture 7 / Total 35 Lectures |Part 1 · Elimination and Vector Spaces
Video of this lecture: Bilibili p7 · Solve : Main variables and special solutions ↗(43:20)| MIT OCW official page ↗
Illustration: MIT OCW 18.06SC official lecture summary (CC BY-NC-SA 4.0) and Bilibili classroom video frames (time stamped), about 10 frames per lecture.
Introduction to this lecture
The first two lectures are for The solution set is named - null space, and also given The desolvability has found its home - column space, but it all stops at the level of “what is”. This lecture will turn the definition into an algorithm: given a fixed process, for any matrix, whether it is a square matrix or a rectangular matrix, whether it is full rank or not full rank, every vector in the null space can be written.
tools are still elimination (elimination), but its usage has changed. In the past, elimination was to understand a specific system of equations, and all pivots must be non-zero; now elimination is to see the structure of the matrix clearly, and the position of the pivot appears. It’s no longer a disaster, but information - it declares that this column is a combination of some previous columns, and it also declares that the corresponding variables can take values freely. So the variables are divided into main variable (pivot variable) and free variable (free variable) two categories, the total number of pivots gives the matrix rank (rank), and the number of free variables determines the size of the null space: there are as many free variables as there are special solution (special solution), the null space is all their linear combinations.
The progression route of the whole lecture is three steps, plus an example at the end. The first step, in a After running the algorithm on the matrix, we get the echelon shape and two special solutions; in the second step, we continue to simplify the echelon shape into row simplest form(row reduced echelon form), so that the special solutions can be read directly without back-substitution; the third step is to arrange the special solutions side by side into a matrix , write all the answers at once in chunked form. Finally, we end with an example of a transposed matrix to illustrate with The number of pivot columns is the same.

MIT OCW Official Lecture Notes Summary Page 1/2 (18.06SC Lecture 7 Summary, CC BY-NC-SA 4.0).
1. From definition to algorithm: elimination on rectangular matrices
Take a matrix with three rows and four columns:
Two dependencies can be seen without having to draw a pen. The second column is the first column times, , it does not bring a new direction and is not an independent column; the third row is the sum of the first row and the second row, , which does not provide new equations. Both of these dependencies should be discovered automatically by elimination, not by sight.
The algorithm is the same as that of the square matrix, with only one more tolerance: searching for the pivot column by column starting from the upper left corner, if a column is at the pivot position , all below , don’t stop there and try again and again, move directly to the next column; as long as you can still find a non-zero pivot, continue to eliminate it. If the pivot position is But there is a non-zero dollar below, so swap the two rows to bring it up.
The first pivot is locational , the first row remains unchanged, use it to eliminate the with :
- The second row minus the first row Times: ;
- The third row minus the first row Times: .
The matrix becomes
Go to the second column, pivot position is , looking down still , the main element cannot be obtained from this column. this It’s not a coincidence: it is exactly the residue of “the second column is a multiple of the first column” after elimination, but there is no need to stop and analyze at this moment, just skip this column. On the third column locational is the second pivot element, and the multiplier is , the third row is subtracted from the second row and the whole row is reset to zero:
It cannot be called an upper triangular matrix because on the diagonal The location is ; Its non-zero elements are arranged in a stepped shape. This form is called ladder shape (echelon form), the original meaning of echelon is stairs. The number of steps, that is, the number of pivot elements, is equal to , this number is the matrix rank(rank): .
The zero row at the bottom is also no coincidence. The third row was originally the sum of the first two rows, and elimination dug this out: a row can be eliminated to zero by the row above, which is equivalent to it being a linear combination of the rows above. In other words, there are only two equations in the system of equations that are truly independent. The matrix has three rows, but the independent one has only two rows.
Here we need to distinguish what elimination changes and what does not change. What elimination does is “reduce a multiple of one equation to another equation”. The solution set of the system of equations remains unchanged, so , and behind The null space is exactly the same. But the column space will change: The column space is given by with Zhang Cheng, and The column space is given by with Zhang Cheng is another plane. Elimination preserves null space but not column space.

Video 00:04:20 | Approximately corresponding to Section 1 “1. From Definition to Algorithm: Elimination on Rectangular Matrix”.
2. Main variables, free variables and special solutions
Spread out and written there are only two non-zero equations:
Four unknowns and two independent equations, the solution is of course not unique - this is also expected: three equations with four unknowns should have non-zero solutions. Which variables can be “solved” depends entirely on which column the pivot falls on. The main element is in the first , column, so is main variable, is free variable;The variable corresponding to the pivot column is the main variable, and the variables corresponding to the other columns are free variables. This division must be given by the result of elimination, and cannot be guessed based on appearance: the second column of the original matrix is an obvious multiple, but whether the fourth column is free can only be seen after elimination.
The names of the free variables say it all: their values can be assigned arbitrarily, and once assigned, the host variables are uniquely determined by the remaining equations, and back-substitution proceeds as usual. Of course, you can also get a vector in the null space by taking any value, but the null space is an infinite set, and you can’t guarantee that none of them will be missed if you take any value. The algorithm requires a set of standard selection methods: only one free variable can be selected at a time , the remaining free variables are .
First time taking . The last equation gives , so ; Substituting back into the first equation, , so . So
This vector makes the relationship between columns clear: Double the first column plus Times the second column is equal to the zero column, that is , exactly the dependence that was seen at first glance. any multiple of it They are also solutions, drawing a straight line passing through the origin in four-dimensional space.
Second time taking . At this time , got ; Substituting back into the first equation, , that is , got . So
it is read as . Check item by item: , established. It can’t be Multiples of , only the second component with It is enough to explain that the two straight lines have different directions.
The complete description of the null space is therefore
That is, all linear combinations of two special solutions. Why is it “not leaking”? Because the method itself has a one-to-one correspondence: free variables Take any set of values , the solution is , and once the free variables are determined, the main variables are uniquely determined by the equation. Two vectors just cover all the degrees of freedom, one more is redundant, and one less is not enough.
This sentence can be said even harder: coefficient They are not made up after the fact, they are free variables The value itself. So each vector in the null space corresponds to a unique set of coefficients, with The entire null space is parameterized without duplication or omission. This distinction is very practical when answering questions: if you ask “What is the null space?” the answer must include any constant , because it is a whole plane passing through the origin; if you only ask “a set of basis of the null space”, it is enough to write these two vectors.
From this we get the most important counting formula in this lecture. Assume that the matrix has column ( unknown numbers), the rank is , then the main variable is , the free variables are There are also special solutions . This example , , the two free variables correspond to exactly two special solutions. At the same time, it is also a simpler fact: there seem to be three equations, but the only one that is truly independent is article.

Video 00:11:12 | Approximately corresponding to Section 2 “2. Main variables, free variables and special solutions”.

Video 00:13:00 | Approximately corresponding to Section 2 “2. Main variables, free variables and special solutions”.

Video 00:16:28 | Approximately corresponding to Section 2 “2. Main variables, free variables and special solutions”.
3. Do the simplest form: complete the back substitution in advance
The ladder form can already calculate the answer, but every time the values of a set of free variables are changed, it must be re-substituted. can put Wipe it clean a little more to make the answer visible: eliminate the elements above the pivot element to zero, and then divide each pivot element by itself to become . Both types of operations only reduce a multiple of an equation to another equation, or multiply an equation by a non-zero number, and the solution set is not affected.
Do upward elimination first. First row minus second row:
main element The one above was cleared, no. The columns are from become . Then divide the second row by , . get
This matrix is called row simplest form (row reduced echelon form, abbreviated as rref), which satisfies three conditions: each pivot is ;The other elements in the column where the pivot is located are all , both above and below are counted; zero rows are all sorted at the bottom.
Put the structure out in the open. The main row is the first row, the pivot column is the column, in the “pivot row” At the intersection of the “pivot columns” stands a of identity matrix(identity matrix);The zero line is at the bottom, confirm again that one of the original three lines is redundant. The remaining , The column is a free column, which separates the pivot column from the free column. It becomes a block shape
Among them It’s the piece where the free column is moved over as it is.
This shape is not unique to this case. Any matrix reduced to its simplest form of rows will present the same pattern: the above rows are pivot rows, and there are three rows at the pivot column positions. The identity matrix of ; the right side is free columns, forming ;The remaining rows are all zeros. Everything that can be eliminated has been eliminated - the top and bottom of the main element are clean, and the main element is clean , zero rows sink to the bottom, no other row transformation can make it easier. It is precisely because of this that from The information read out requires the least effort: the pivot row is , the main element column can be counted at a glance, and the position of the free column is also clear at a glance.
The block writing method allows special solutions to be solved in one step. Rearrange the unknowns according to “main variables and free variables” (this only changes the writing order, not the solution set), That’s it
Free variable takes , the main variable is the first column of ;Free variable takes , the main variable is . in original variable order Writing back, it happened to be the hand calculation of the previous section. with . Those “symbols flipping over” phenomenon when calculating by hand is not a coincidence: The number in is originally added to the main variable on the left side of the equal sign, but when moved to the right, the sign changes. This is The origin of.
Comes with a practical saying: put input, call rref command, this is what appears on the screen , you can see the pivot rows, pivot columns, unit blocks, and free columns at a glance.

Video 00:28:10|Approximately corresponding to section 3 “3. Do the simplest form: finish the back substitution in advance”.
4. Null space matrix: one special solution per column
Since the special solutions are the “generators” of the null space, we might as well arrange them side by side into a matrix. definition null space matrix(null space matrix) is a matrix with all special solutions as columns. From the derivation in the previous section, as long as the free variable takes each column of the identity matrix, the main variable takes , so
Its number of rows is equal to the number of unknown numbers , the number of columns is equal to the number of free variables . There is only one core property:
Each column of is sent to the zero column, so they are all in the null space; and because the number of columns is exactly equal to the number of degrees of freedom, these columns give the most economical set of generators in the null space. They are also unlikely to be linearly related: The piece of free variables is the identity matrix. Any non-trivial combination will leave a non-zero component there and cannot become a zero vector.
For the example in this lecture, put Enter it and press Rearrange the rows in their natural order to get
The two columns are exactly with . Contrast with We can also see the weight of this rule: inside appear intact Here, only a negative sign is added to the whole, and the unit block is moved from “the location of the main variable” to “the location of the free variable”.
Got it , all vectors in the null space can be written uniformly as , among which is arbitrary dimensional vector. degrees of freedom included , the matrix structure is included in , each of them manages one end. In this case is , it forms a plane passing through the origin; in the transposed example There is only one column, and it forms a straight line.
There is another convenience in calculation: if hand over null command, it does exactly these things internally - first calculate , identify the pivot column and the free column, and fill in the free variables and , and then use back substitution to complement the main variable. Simplify to After that, back-substitution is as simple as shifting terms, so the whole process requires almost no arithmetic.

Video 00:34:04 | Approximately corresponding to Section 4 “4. Null space matrix: one column, one special solution”.

Video 00:34:40 | Approximately corresponding to Section 4 “4. Null space matrix: one column, one special solution”.
5. Example of transposition: the number of pivot columns remains unchanged
put the above Transpose to get a matrix with four rows and three columns, and then go through the complete process:
Predict before calculating. Can there be three pivots in three columns? No, because the third column is exactly the sum of the first two columns: . So it is expected that there will only be two pivot columns and the third column will be the free column. There is also a dependence on the row direction: the second row is the first row times and should be eliminated.
Elimination begins. The first main element is , use the first line to eliminate the following : The second row minus twice the first row is ;The third line is ; The fourth line is :
The pivot position of the second column is , but the third line below has , so the second and third lines are swapped, and Bring it up. Appears at the pivot position It doesn’t necessarily mean that this column is useless, it may just be that it happens to be in the wrong position - take a look down and decide. This is the extra step for rectangular matrix elimination than for square matrices.
Then use the second line to eliminate the fourth line , the multiplier is : . At this time
Turning to the third column, the pivot position is , the two lines below are all , there is really nothing we can do this time, and the algorithm ends here. rank is still .
The pivot column is the column, the free column has only the column, therefore , there is only one special solution, the null space is a straight line in . Let the free variables (If order , the equation will only give an all-zero solution, which is equal to a white calculation), from the second formula Got ; Substituting back into the first formula, , got . So
Check column relationships: , established.
Continue to simplify to : The second row is divided by Got , the first row minus the second row Bede , so
Here’s another fact: There are two pivot columns, There are also two pivot columns. The transposition turns the rows into columns, but the number of pivots remains unchanged. It can be seen that the rank is an attribute of the matrix itself and does not change whether it is “viewed horizontally” or “viewed vertically” - it counts independent columns, and The line is columns, so the same number also counts separate rows. But the null space scale of the two is different: is a free variable, only . It can be seen that the same rank number leaves different room for free variables on matrices of different shapes. What determines this room is the number of columns. .

Video 00:39:00 | Approximately corresponding to Section 5 “5. Example of transposition: the number of pivot columns remains unchanged”.

MIT OCW Official Lecture Notes Summary Page 2/2 (18.06SC Lecture 7 Summary, CC BY-NC-SA 4.0).
Summary of this lecture
- solution The algorithm is elimination: find the pivot column by column, and the pivot position is and all below are Skip the column when there is a non-zero element below, and swap the two rows until there is no new pivot element.
- The number of pivots is the matrix rank (rank). This lecture In the example of , The rank is also .
- Elimination does not change the null space: , , All three have the same solution; but elimination will change the column space.
- The column corresponding to the pivot main variable, the remaining columns correspond to free variable; Column, rank The matrix has main variable and a free variable.
- special solution The method of taking is: let a free variable take , take the rest , and then go back to the main variable. Example 1 , , the null space is all their linear combinations.
- Each special solution corresponds to a specific relationship between columns: Description , Description .
- row simplest form The required pivot is , the rest of the elements in the pivot column are all , the zero row is at the bottom; the intersection of its pivot row and pivot column is the identity matrix, and the overall shape is .
- by Li De , therefore null space matrix for , and ; Its columns are all special solutions.
- The zero rows at the bottom of the steps indicate that one of the original rows is a combination of other rows, so the number of independent equations equals the rank, not the number of rows.
keywords
| English | Chinese | One sentence explanation |
|---|---|---|
| elimination | elimination | Algorithm for creating pivot elements column by column using row transformation without changing the solution set of the system of equations |
| echelon form | ladder shape | A matrix shape in which non-zero elements are arranged in a stepped shape with zero rows at the bottom |
| row reduced echelon form | row simplest form | The main element is , the remaining elements of the pivot column are of ladder shape |
| pivot | pivot | The non-zero first element on each step during the elimination process |
| pivot column | Pivot column | The column containing the pivot corresponds to the principal variable |
| pivot variable | main variable | The value of the unknown number corresponding to the pivot column is uniquely determined by the equation. |
| free variable | free variable | The unknown number corresponding to the column without pivot, the value can be specified arbitrarily |
| special solution | special solution | Let a free variable be , the rest are The null space vector obtained by back-substitution |
| null space matrix | null space matrix | matrix with all special solutions as columns |
| rank | rank | The number of pivots is also the number of independent equations and independent columns. |
| nullspace | null space | satisfy All vectors of |
| identity matrix | identity matrix | The intersection of the pivot row and the pivot column , the diagonal angle is , the rest are |
| transpose | transpose | Obtained by swapping rows and columns , with Same rank |
Machine-assisted translation · Read Chinese original
