Skip to content

The null space

Find every input a matrix sends to zero, by reducing to reduced row echelon form and building one special solution per free column.

Helps to know first
This topic

First, the picture

Some inputs a matrix sends to zero. Watch a whole line of points in space fall into the origin and light up.

The inputs a matrix erases

A = [1 0 1; 0 1 1; 1 1 2] moves every point of space. Which points land on 0?

A loose cloud of points in space.

(−1, −1, 1) is now at
(−1, −1, 1)
0.00 / 10.20 s
Describe this picture

A slowly turning view of 3-D space. A loose cloud of points fades in, then a line through the origin in the direction (−1,−1,1)(-1,-1,1), with thirteen points marked on it. The matrix A=[101011112]\mathbf{A}=\begin{bmatrix}1&0&1\\0&1&1\\1&1&2\end{bmatrix} then moves every point x\mathbf{x} straight toward Ax\mathbf{A}\mathbf{x}: the cloud squashes flat, and the marked points of the line slide together until all of them sit on the origin, which lights up. The plane the outputs lie on, where the third entry is the sum of the first two, then fades in. A readout follows where the point (−1,−1,1)(-1,-1,1) is, ending at (0,0,0)(0,0,0). There is no control.

What a matrix erases

The matrix at the top of the page has a quiet habit. Its third row is the sum of the first two, so every output has its third entry equal to the sum of the first two. All of space lands on one plane, and something has to be lost on the way.

What is lost is a direction. Try the input (−1,−1,1)(-1,-1,1):

[101011112][−1−11]=[−1+0+10−1+1−1−1+2]=[000].\begin{aligned} \begin{bmatrix}1&0&1\\0&1&1\\1&1&2\end{bmatrix}\begin{bmatrix}-1\\-1\\1\end{bmatrix}&=\begin{bmatrix}-1+0+1\\0-1+1\\-1-1+2\end{bmatrix}\\ &=\begin{bmatrix}0\\0\\0\end{bmatrix}. \end{aligned}

Every multiple of it goes to zero too, since A(c x)=c Ax=c 0=0\mathbf{A}(c\,\mathbf{x})=c\,\mathbf{A}\mathbf{x}=c\,\mathbf{0}=\mathbf{0}. That is the line that falls into the origin in the picture. Two inputs that differ by a point of this line give the same output, so from the output alone you can’t tell them apart.

The null space

The set of every input that a matrix sends to zero is its null space:

N(A)={ x: Ax=0 }.N(\mathbf{A})=\{\,\mathbf{x}:\ \mathbf{A}\mathbf{x}=\mathbf{0}\,\}.

It is a subspace, as in Vector spaces and subspaces. If Ax=0\mathbf{A}\mathbf{x}=\mathbf{0} and Ay=0\mathbf{A}\mathbf{y}=\mathbf{0}, then A(x+y)=0+0=0\mathbf{A}(\mathbf{x}+\mathbf{y})=\mathbf{0}+\mathbf{0}=\mathbf{0}, and A(c x)=0\mathbf{A}(c\,\mathbf{x})=\mathbf{0}. The zero vector is always in it.

Watch out

The null space and the column space live on opposite sides of the matrix. For an m×nm\times n matrix, the null space is made of inputs, vectors with nn entries. The column space is made of outputs, with mm entries. In the picture, the line that vanishes is on the input side, and the flat plane everything lands on is the column space, on the output side.

Finding it: reduced row echelon form

To find the null space, solve Ax=0\mathbf{A}\mathbf{x}=\mathbf{0}. Elimination, from Elimination, does the work. Subtracting a multiple of one equation from another never changes the solutions, and the right-hand side stays all zeros, so I only need to track the matrix.

Take a wider example, with two equations and four unknowns:

A=[12132438].\mathbf{A}=\begin{bmatrix}1&2&1&3\\2&4&3&8\end{bmatrix}.

Clear below the first pivot: row 2 ←\leftarrow row 2 − 2⋅-\ 2\cdot row 1 gives (0,0,1,2)(0,0,1,2). The second column now has 0 where a pivot would go, so the next pivot is the 1 in column 3. Then go one step further than elimination usually goes: clear above that pivot too, with row 1 ←\leftarrow row 1 −- row 2, which gives (1,2,0,1)(1,2,0,1). The result is

rref(A)=[12010012].\mathrm{rref}(\mathbf{A})=\begin{bmatrix}1&2&0&1\\0&0&1&2\end{bmatrix}.

This is the reduced row echelon form of A\mathbf{A}, written rref(A)\mathrm{rref}(\mathbf{A}). Its rules are simple:

  • each row’s first nonzero entry is a 1, its pivot;
  • each pivot sits to the right of the pivot above it;
  • every other entry in a pivot’s column is 0;
  • any all-zero rows sit at the bottom.

Columns 1 and 3 hold pivots: they are the pivot columns. Columns 2 and 4 have none: they are the free columns, and x2x_2, x4x_4 are the free variables. The number of pivots is the rank of the matrix, written rr. Here r=2r=2.

Special solutions

Read rref(A) x=0\mathrm{rref}(\mathbf{A})\,\mathbf{x}=\mathbf{0} back as equations:

x1+2x2+x4=0,x3+2x4=0.\begin{aligned} x_1+2x_2+x_4&=0,\\ x_3+2x_4&=0. \end{aligned}

Each equation has one pivot variable, and the free variables may be anything. So choose the free variables, and the pivot variables follow: x1=−2x2−x4x_1=-2x_2-x_4 and x3=−2x4x_3=-2x_4.

The simplest choices set one free variable to 1 and the others to 0. Each gives one special solution:

  • x2=1x_2=1, x4=0x_4=0: then x1=−2x_1=-2, x3=0x_3=0, so s1=(−2,1,0,0)\mathbf{s}_1=(-2,1,0,0).
  • x2=0x_2=0, x4=1x_4=1: then x1=−1x_1=-1, x3=−2x_3=-2, so s2=(−1,0,−2,1)\mathbf{s}_2=(-1,0,-2,1).

Any other choice of x2x_2 and x4x_4 is a mix of these two, so

N(A)={ x2 s1+x4 s2 },N(\mathbf{A})=\{\,x_2\,\mathbf{s}_1+x_4\,\mathbf{s}_2\,\},

where x2x_2 and x4x_4 run over all numbers.

Special solutions

Reduce A, find its free columns, and build one solution of Ax = 0 for each.

A = [1 2 1 3; 2 4 3 8] as cells.

0.00 / 13.00 s
Describe this picture

The 2×42\times4 matrix A=[12132438]\mathbf{A}=\begin{bmatrix}1&2&1&3\\2&4&3&8\end{bmatrix} as a grid of cells. Row 2 lights up and changes to (0,0,1,2)(0,0,1,2), row 2 minus 2 times row 1; then row 1 changes to (1,2,0,1)(1,2,0,1), row 1 minus row 2, and the grid is labelled rref(A)\mathrm{rref}(\mathbf{A}). The pivot cells, in columns 1 and 3, are outlined and marked “pivot”; columns 2 and 4 are shaded and marked “free”. Then each special solution is built as a column beside the grid: first its free entries, a 1 and a 0, then its pivot entries, taken from the free column with their signs changed. They read s1=(−2,1,0,0)\mathbf{s}_1=(-2,1,0,0) and s2=(−1,0,−2,1)\mathbf{s}_2=(-1,0,-2,1). There is no control.

Watch where the pivot entries of each special solution come from. They are the free column of rref(A)\mathrm{rref}(\mathbf{A}) with its signs changed: column 2 is (2,0)(2,0) and gives x1=−2x_1=-2, x3=0x_3=0; column 4 is (1,2)(1,2) and gives x1=−1x_1=-1, x3=−2x_3=-2.

Dimension

A line through the origin has one free direction, and a plane has two. The number of free directions of a subspace is its dimension, written dim⁡\dim. Independence, basis and dimension makes this exact; here the count is easy.

Each free variable gives one special solution, and none of them is a mix of the others: each has a 1 where the others have 0. So the null space has one direction per free column. There are nn columns, and rr of them hold pivots, so

dim⁡N(A)=n−r.\dim N(\mathbf{A})=n-r.

For the 2×42\times4 example, 4−2=24-2=2: the null space is a plane inside R4\mathbb{R}^4. For the 3×33\times3 matrix at the top, the reduced form is [101011000]\begin{bmatrix}1&0&1\\0&1&1\\0&0&0\end{bmatrix}, with rank 2 and one free column, so its null space is the line of (−1,−1,1)(-1,-1,1), and 3−2=13-2=1.

In signal processing · aliasing

Sampling is a linear map: it takes a signal xc(t)x_c(t) to its samples x[n]=xc(nTs)x[n]=x_c(nT_s), with Ts=1/fsT_s=1/f_s, and the samples of a sum are the sums of the samples. At fs=8f_s=8 kHz, a 1 kHz cosine and a 9 kHz cosine give the same samples, because cos⁡(2π⋅9n/8)=cos⁡(2πn+2πn/8)=cos⁡(2πn/8)\cos(2\pi\cdot9n/8)=\cos(2\pi n+2\pi n/8)=\cos(2\pi n/8) for every whole number nn. So their difference is sent to all zeros: it lies in the null space of sampling. Sampling and aliasing, in the signal processing course, is the study of that null space. Samples count from n=0n=0, while matrix entries count from 1.

Worked example

1. The 2×42\times4 matrix. Reduce A=[12132438]\mathbf{A}=\begin{bmatrix}1&2&1&3\\2&4&3&8\end{bmatrix} to rref(A)=[12010012]\mathrm{rref}(\mathbf{A})=\begin{bmatrix}1&2&0&1\\0&0&1&2\end{bmatrix}: pivots in columns 1 and 3, free variables x2x_2 and x4x_4. The special solutions are s1=(−2,1,0,0)\mathbf{s}_1=(-2,1,0,0) and s2=(−1,0,−2,1)\mathbf{s}_2=(-1,0,-2,1). Check them on the original matrix:

As1=(−2+2,  −4+4)=(0,0),As2=(−1−2+3,  −2−6+8)=(0,0).\begin{aligned} \mathbf{A}\mathbf{s}_1&=(-2+2,\;-4+4)\\ &=(0,0),\\ \mathbf{A}\mathbf{s}_2&=(-1-2+3,\;-2-6+8)\\ &=(0,0). \end{aligned}

Four columns, rank 2, two free variables: dim⁡N(A)=2\dim N(\mathbf{A})=2.

2. The 3×33\times3 matrix. Row 1 plus row 2 gives row 3, so elimination leaves a zero row and rank 2. The free variable is x3x_3, and A(−1,−1,1)=0\mathbf{A}(-1,-1,1)=\mathbf{0}.

3. A 2×22\times2 matrix. [1224]\begin{bmatrix}1&2\\2&4\end{bmatrix} reduces to [1200]\begin{bmatrix}1&2\\0&0\end{bmatrix}. The free variable is x2x_2; setting it to 1 gives x1=−2x_1=-2, so the null space is all multiples of (−2,1)(-2,1).

4. Counting. A 3×53\times5 matrix of rank 3 has 5−3=25-3=2 free variables, so its null space has dimension 2. A square matrix with a pivot in every column, the opposite of the singular case in Elimination, has no free variables, so its null space is {0}\{\mathbf{0}\} alone.

Predict before you watch again: how many points of the line through (−1,−1,1)(-1,-1,1) land at the origin? All of them.

Where you’ll meet this

Aliasing. The tones that sampling can’t tell apart differ by a signal in its null space, as the callout above shows.

Currents round a loop. In a circuit, a current that flows round a closed loop adds nothing at any node. Such loop currents form a null space, and Graphs and networks finds them.

Balancing a reaction. Burning propane: aa molecules of C3H8\text{C}_3\text{H}_8 and bb of O2\text{O}_2 give cc of CO2\text{CO}_2 and dd of H2O\text{H}_2\text{O}. Counting each kind of atom on both sides gives three equations with zero on the right: carbon 3a−c=03a-c=0, hydrogen 8a−2d=08a-2d=0, oxygen 2b−2c−d=02b-2c-d=0. The null space is the line of (1,5,3,4)(1,5,3,4): one propane and five oxygen give three carbon dioxide and four water.

Reference card

QuantityFormulaNotes
Null spaceN(A)={x:Ax=0}N(\mathbf{A})=\{\mathbf{x}:\mathbf{A}\mathbf{x}=\mathbf{0}\}inputs sent to zero; a subspace of Rn\mathbb{R}^n
Reduced formrref(A)\mathrm{rref}(\mathbf{A})pivots are 1, zeros above and below each pivot
Rankrrthe number of pivots
Free variablesone per column without a pivotn−rn-r of them
Special solutionone free variable 1, the others 0pivot entries from that free column, signs changed
Dimensiondim⁡N(A)=n−r\dim N(\mathbf{A})=n-rone direction per free column
No free columnsN(A)={0}N(\mathbf{A})=\{\mathbf{0}\}a pivot in every column

Keep reading with a free account.

By creating an account you accept the terms of use.

Sign in

Already have an account? Use the service you signed up with.

Or keep reading: get new lessons by email

Are you 13 or over?

Accounts and email updates are for people aged 13 or over. We keep only your answer, never your date of birth.

End of the lesson

Where to go next.

Phasorium

Account

Sign inKeep your place on any device

Subjects

Site

Look