BetaFree coursewareRewritten from MIT OpenCourseWareCC BY-NC-SA 4.0
Open CosmologyPhysics & cosmology, from high school to a graduate year

Solving Ax = 0: pivot variables and special solutions

The nullspace is found by elimination, now on rectangular matrices: when a column has no pivot, move on to the next. Elimination does not change the solutions of Ax = 0. For A with rows (1, 2, 2, 2), (2, 4, 6, 8), (3, 6, 8, 10) it gives an echelon (staircase) matrix U with two pivots, so the rank is r = 2. Columns 1 and 3 are pivot columns; x₂ and x₄ are free. Setting one free variable to 1 and the others to 0 and back-substituting gives the special solutions (−2, 1, 0, 0) and (2, 0, −2, 1); the nullspace is all their combinations. An m × n matrix of rank r has n − r free variables, one special solution for each. Going further, with zeros above the pivots and pivots equal to 1, gives the reduced row echelon form R = [I F; 0 0]. Then Rx = 0 says x_pivot = −F x_free, so the nullspace matrix N, whose columns are the special solutions, is [−F; I]. For the transpose of the example, the rank is again 2, and the nullspace is the line through (−1, −1, 1).

You need this first

Full reading path (11 pages)
  1. Vectors (8.01)
  2. Vectors and the dot product (18.02)
  3. Determinants and the cross product (18.02)
  4. Planes through three points, and matrices (18.02)
  5. Equations of planes and square systems (18.02)
  6. The geometry of linear equations (18.06)
  7. Elimination with matrices (18.06)
  8. Matrix multiplication and inverse matrices (18.06)
  9. Factorization into A = LU (18.06)
  10. Transposes, permutations and vector spaces (18.06)
  11. Column space and nullspace (18.06)
On this page · 5 sections
  1. Elimination on a rectangular matrix
  2. Pivot variables, free variables, special solutions
  3. The reduced row echelon form R
  4. A second example: the transpose
  5. Summary

The last lecture defined the nullspace; this one turns the definition into an algorithm for solving Ax=0Ax = 0 (transcript, p. 1). It continues column space and nullspace.

Elimination on a rectangular matrix#

The example has three rows and four columns (transcript, pp. 1–2):

The example
A=(1222246836810)A = \begin{pmatrix} 1 & 2 & 2 & 2 \\ 2 & 4 & 6 & 8 \\ 3 & 6 & 8 & 10 \end{pmatrix}
In words

capital A equals 1 2 2 2; 2 4 6 8; 3 6 8 10

By eye, column 2 is twice column 1, and row 1 plus row 2 gives row 3; elimination should discover both (p. 1). Elimination does not change the nullspace: subtracting a multiple of one equation from another keeps the solutions, with zeros on the right all along. It does change the column space (p. 2).

Subtracting 2 and 3 times row 1 clears column 1 and leaves (0,0,2,4)(0, 0, 2, 4) in both lower rows (p. 2). Column 2 now has zeros in and below the pivot position: no row exchange can help, which signals that column 2 depends on the earlier ones. Elimination just moves on to column 3, finds the second pivot 2, and subtracting row 2 from row 3 gives a row of zeros (p. 3):

Echelon form
U=(122200240000)U = \begin{pmatrix} 1 & 2 & 2 & 2 \\ 0 & 0 & 2 & 4 \\ 0 & 0 & 0 & 0 \end{pmatrix}
In words

U equals 1 2 2 2; 0 0 2 4; 0 0 0 0

UU is in echelon (staircase) form (p. 3). The row of zeros appeared because row 3 was a combination of rows 1 and 2 (p. 9). The most important number has already appeared (pp. 3–4):

Rank
rank of A=r=number of pivots=2\text{rank of } A = r = \text{number of pivots} = 2
In words

rank of capital A equals r equals number of pivots equals 2

Pivot variables, free variables, special solutions#

Ux=0Ux = 0 has the same solutions as Ax=0Ax = 0 (transcript, p. 4). Columns 1 and 3 are the pivot columns; columns 2 and 4 are free columns, because x2x_2 and x4x_4 can be given any values, and then x1x_1 and x3x_3 follow by back substitution (p. 4). The equations are (p. 5)

Ux = 0
x1+2x2+2x3+2x4=0,2x3+4x4=0x_1 + 2x_2 + 2x_3 + 2x_4 = 0, \qquad 2x_3 + 4x_4 = 0
In words

x one plus 2 x two plus 2 x three plus 2 x four equals 0, 2 x three plus 4 x four equals 0

Choose x2=1x_2 = 1, x4=0x_4 = 0: then x3=0x_3 = 0 and x1=−2x_1 = -2 (p. 5). That says −2-2 times column 1 plus column 2 is zero, as seen at the start (pp. 5–6). Choose x2=0x_2 = 0, x4=1x_4 = 1: then x3=−2x_3 = -2 and x1=2x_1 = 2, saying 2 of column 1 minus 2 of column 3 plus column 4 is zero (pp. 6–7). These are the special solutions, special because of the values 0 and 1 given to the free variables (pp. 7–8). The nullspace holds exactly all their combinations (p. 8):

The nullspace
x=c(−2100)+d(20−21)x = c\begin{pmatrix} -2 \\ 1 \\ 0 \\ 0 \end{pmatrix} + d\begin{pmatrix} 2 \\ 0 \\ -2 \\ 1 \end{pmatrix}
In words

x equals c minus 2; 1; 0; 0 plus d 2; 0; minus 2; 1

There is one special solution per free variable (p. 8). With three equations in four unknowns, solutions other than zero were bound to exist (p. 4). For an m×nm \times n matrix of rank rr (pp. 8–9):

Counting
r pivot variables,n−r free variablesr \text{ pivot variables}, \qquad n - r \text{ free variables}
In words

r pivot variables, n minus r free variables

Here 4−2=24 - 2 = 2: the three equations were really only two independent ones (p. 9). That is a complete algorithm for Ax=0Ax = 0 (p. 9).

The reduced row echelon form R#

One more cleaning step (transcript, pp. 9–10): eliminate upwards to get zeros above the pivots, and divide each pivot row by its pivot to make the pivots 1. Neither changes the solutions (p. 10). Subtracting row 2 from row 1 and halving row 2 (p. 10):

Reduced row echelon form
R=(120−200120000)R = \begin{pmatrix} 1 & 2 & 0 & -2 \\ 0 & 0 & 1 & 2 \\ 0 & 0 & 0 & 0 \end{pmatrix}
In words

capital R equals 1 2 0 minus 2; 0 0 1 2; 0 0 0 0

MATLAB produces it with the command rref(A) (p. 10). RR shows everything: pivot rows 1 and 2, pivot columns 1 and 3, an identity matrix in the pivot rows and columns, and a zero row for each row that was a combination of others (pp. 10–11). The free columns hold (2,0)(2, 0) and (−2,2)(-2, 2), and those numbers reappear in the special solutions with their signs switched, because back substitution moves them to the other side (pp. 11–12).

Why, in general (pp. 12–14). Put the pivot columns first (a reordering of the variables). Then RR has an r×rr \times r identity, a free part FF with n−rn - r columns, and zero rows below (pp. 12–13):

Block form of R
R=(IF00),Rx=0  ⇒  xpivot+F xfree=0  ⇒  xpivot=−F xfreeR = \begin{pmatrix} I & F \\ 0 & 0 \end{pmatrix}, \qquad Rx = 0 \;\Rightarrow\; x_{\text{pivot}} + F\,x_{\text{free}} = 0 \;\Rightarrow\; x_{\text{pivot}} = -F\,x_{\text{free}}
In words

capital R equals capital I F; 0 0, capital R x equals 0 which gives x pivot plus F x free equals 0 which gives x pivot equals minus F x free

Choosing the identity for the free variables gives all the special solutions at once, as the columns of the nullspace matrix NN, with RN=0RN = 0 (p. 13):

Nullspace matrix
N=(−FI)N = \begin{pmatrix} -F \\ I \end{pmatrix}
In words

capital N equals minus F; capital I

Strang mentions a MATLAB or teaching-code command that produces this nullspace matrix; it works exactly this way: compute RR, then put ones and zeros in the free variables and copy −F-F into the pivot variables (pp. 13–14).

A second example: the transpose#

Take the transpose of the first matrix (transcript, p. 14). Its third column is the sum of the first two, so expect two pivot columns and one free column (p. 15). Elimination clears column 1, leaving a zero row and the rows (0,2,2)(0, 2, 2) and (0,4,4)(0, 4, 4); column 2 has a 0 in the pivot position but a 2 below, so exchange rows and continue; column 3 then has no pivot (pp. 15–16):

The transpose and its U
AT=(1232462682810)  →  U=(123022000000)A^T = \begin{pmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 2 & 6 & 8 \\ 2 & 8 & 10 \end{pmatrix} \;\to\; U = \begin{pmatrix} 1 & 2 & 3 \\ 0 & 2 & 2 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix}
In words

capital A ^ capital T equals 1 2 3; 2 4 6; 2 6 8; 2 8 10 goes to U equals 1 2 3; 0 2 2; 0 0 0; 0 0 0

The rank is again 2, which is no accident: a matrix and its transpose have the same number of pivot columns, a great fact Strang states here (p. 16). There is 3−2=13 - 2 = 1 free column (p. 16). Set the free variable x3=1x_3 = 1: 2x2+2x3=02x_2 + 2x_3 = 0 gives x2=−1x_2 = -1, and x1+2x2+3x3=0x_1 + 2x_2 + 3x_3 = 0 gives x1=−1x_1 = -1 (p. 17). Minus column 1 minus column 2 plus column 3 is zero. The whole nullspace is the line c(−1,−1,1)c(-1, -1, 1); Strang wants the cc in an answer, as a reminder that it is a whole space (pp. 17–18). Going on to RR (p. 18):

R for the transpose
R=(101011000000)=(IF00),N=(−FI)=(−1−11)R = \begin{pmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{pmatrix} = \begin{pmatrix} I & F \\ 0 & 0 \end{pmatrix}, \qquad N = \begin{pmatrix} -F \\ I \end{pmatrix} = \begin{pmatrix} -1 \\ -1 \\ 1 \end{pmatrix}
In words

capital R equals 1 0 1; 0 1 1; 0 0 0; 0 0 0 equals capital I F; 0 0, capital N equals minus F; capital I equals minus 1; minus 1; 1

Solving Ax=bAx = b comes next (p. 19).

Worked example

Special solutions of your own

(a) Find the rank, RR and the special solutions of B=(130226171328)B = \begin{pmatrix} 1 & 3 & 0 & 2 \\ 2 & 6 & 1 & 7 \\ 1 & 3 & 2 & 8 \end{pmatrix}. (b) Why must every 3×53 \times 5 matrix have a nonzero vector in its nullspace?

(a) Eliminate

Row 2 minus 2 row 1 is (0,0,1,3)(0, 0, 1, 3); row 3 minus row 1 is (0,0,2,6)(0, 0, 2, 6), and minus 2 times the new row 2 that is zero. Pivots sit in columns 1 and 3, so the rank is 2. The pivot in column 3 already has a zero above it and equals 1, so R=(130200130000)R = \begin{pmatrix} 1 & 3 & 0 & 2 \\ 0 & 0 & 1 & 3 \\ 0 & 0 & 0 & 0 \end{pmatrix}, with F=(3203)F = \begin{pmatrix} 3 & 2 \\ 0 & 3 \end{pmatrix}.

(a) Special solutions

Free x2=1x_2 = 1, x4=0x_4 = 0: x1=−3x_1 = -3, x3=0x_3 = 0, giving (−3,1,0,0)(-3, 1, 0, 0). Free x2=0x_2 = 0, x4=1x_4 = 1: x3=−3x_3 = -3, x1=−2x_1 = -2, giving (−2,0,−3,1)(-2, 0, -3, 1). The pivot entries are the columns of −F-F. Check the second with row 3 of BB: −2+0−6+8=0-2 + 0 - 6 + 8 = 0.

(b) Counting

There are at most 3 pivots (one per row), so at least 5−3=25 - 3 = 2 free variables, and each gives a nonzero special solution.

Summary#

Symbols on this page

Show the 24 symbols used here
→\to arrow.
Goes to (tends to), or becomes. Say it: “goes to”.
⇒\Rightarrow implies.
Implies: what follows is a consequence of what came before. Say it: “which gives”.
×\times times.
Times (multiplication). Between two vectors: the cross product. Say it: “times”.
cc c.
The multiple of the first special solution. Say it: “c”.
TT T.
As a superscript: the transpose. Say it: “capital T”.
xx x.
A vector in the nullspace: a solution of Ax = 0. Say it: “x”.
dd d.
The multiple of the second special solution. Say it: “d”.
nn n.
The number of columns (unknowns). Say it: “n”.
mm m.
The number of rows. Say it: “m”.
FF F.
The free part of R: its entries in the free columns of the pivot rows. Say it: “F”.
rr r.
The rank: the number of pivots. Say it: “r”.
AA A.
The 3 × 4 example matrix with rows (1, 2, 2, 2), (2, 4, 6, 8), (3, 6, 8, 10). Say it: “capital A”.
BB B.
The 3 × 4 matrix of the worked example. Say it: “capital B”.
bb b.
A right-hand side, in Ax = b. Say it: “b”.
NN N.
The nullspace matrix, whose columns are the special solutions. Say it: “capital N”.
RR R.
The reduced row echelon form: zeros above and below the pivots, pivots equal to 1. Say it: “capital R”.
x1x_{1} x 1.
The first unknown (a pivot variable in the first example). Say it: “x one”.
x2x_{2} x 2.
The second unknown (a free variable in the first example). Say it: “x two”.
UU U.
The echelon (staircase) form that elimination produces. Say it: “U”.
x4x_{4} x four.
The fourth unknown (a free variable in the first example). Say it: “x four”.
x3x_{3} x three.
The third unknown (a pivot variable in the first example; the free variable for the transpose). Say it: “x three”.
II I.
An identity matrix: in R, in the pivot rows and columns; in N, in the free variables. Say it: “capital I”.
xpivotx_{\text{pivot}} x pivot.
The pivot variables of x, together. Say it: “x pivot”.
xfreex_{\text{free}} x free.
The free variables of x, together. Say it: “x free”.

Tap or click a symbol in a formula to see the same explanation. All symbols: symbols and notation.

Words on this page

Show the 21 words used here

New here

echelon form.
The staircase shape a matrix takes after elimination: each row's first nonzero entry, its pivot, lies to the right of the one above.
free column.
A column of a matrix with no pivot after elimination; it is a combination of the pivot columns before it.
special solution.
A solution of Ax = 0 found by setting one free variable to 1 and the others to 0; together they build every solution.
pivot variable.
An unknown whose column has a pivot; once the free variables are chosen, the pivot variables are found by back substitution.

Also used

nullspace.
All the vectors x that a matrix sends to zero, that is, all solutions of Ax = 0. Explained in Column space and nullspace.
p..
Page, in a reference to a source; pp. means pages, as in pp. 3–5.
column space.
All the vectors made by combining the columns of a matrix; Ax = b can be solved exactly when b lies in it. Explained in Matrix multiplication and inverse matrices.
elimination.
Solving equations by subtracting multiples of one from another until each unknown can be found in turn. Explained in The geometry of linear equations.
pivot.
In elimination, the first nonzero number in a row, used to clear out the entries below it. Explained in Positive definite matrices and minima.
row exchange.
Swapping two rows of a matrix, needed in elimination when a zero sits where a pivot should be.
pivot column.
A column of a matrix that contains a pivot after elimination; the matching columns of the original matrix form a basis for its column space. Explained in Column space and nullspace.
back substitution.
Solving a triangular system from the bottom up: the last equation gives the last unknown, which is put into the one above, and so on.
free variable.
An unknown whose column has no pivot, so it can be given any value; the other unknowns are then fixed by the equations.
matrix.
A rectangular table of numbers, which acts on vectors to give new ones and so describes a linear change of coordinates. Explained in Planes through three points, and matrices.
rank.
The number of independent columns of a matrix, which always equals the number of independent rows. Explained in Similar matrices and the Jordan form.
identity matrix.
The square matrix with ones down its main diagonal and zeros elsewhere; it leaves every vector unchanged. Explained in Planes through three points, and matrices.
transpose.
The matrix made by writing the rows of a matrix as columns, flipping it across its main diagonal. Explained in Planes through three points, and matrices.
vector.
A list of numbers written as a column, or more generally anything that can be added and multiplied by numbers. Explained in Orthogonal vectors and subspaces.

Academic

transcript.
A written record of exactly what was said in a recorded lecture, word for word.
by eye.
Judged just by looking, without measuring or calculating.
no accident.
Not a matter of chance: there is a deeper reason why it happens.

Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).

Where this leads

In cosmology

32 more cosmology pages that build on this

Pages that build on this

Practise

Check your understanding

  1. A 3×53 \times 5 matrix has rank 3. How many special solutions does Ax=0Ax = 0 have?
  2. In a special solution, the free variables are set to…
  3. If R=(IF00)R = \begin{pmatrix} I & F \\ 0 & 0 \end{pmatrix}, the nullspace matrix is…
0 of 3 answered

Flashcards

1 / 3