MatrixStep

Guides8 min

How to Find a Basis for the Null Space and Column Space (RREF Example)

The null space and the column space are two of the most important spaces attached to a matrix. For both, one RREF is enough to read off a basis. Let's find a basis and the dimension of each space for a single matrix.

Definitions

Example matrix

A =120−124113610

This is a 3×4 matrix. First we compute its RREF.

  1. 01
    Start from the given matrix.
    120−124113610
  2. 02
    Make every other entry of column 1 zero.
    R₂ ← R₂ − 2R₁R₃ ← R₃ − 3R₁
    120−100130013
  3. 03
    Make every other entry of column 3 zero.
    R₃ ← R₃ − R₂
    120−100130000
RREF(A) =120−100130000

The pivots are in columns 1 and 3, so rank(A) = 2. Columns 2 and 4 have no pivot, so there are two free variables.

Finding a basis for the null space

Read the equations from the RREF: x₁ + 2x₂ − x₄ = 0 and x₃ + 3x₄ = 0. Setting the free variables x₂ = s and x₄ = t gives the following.

x₁ = −2s + tx₂ = sx₃ = −3tx₄ = t

Collecting the s terms and the t terms into vectors, every solution is a linear combination of two vectors.

x = s−2100+ t10−31

So these two vectors form a basis for the null space. Multiply each by A to check that the result is the zero vector.

120−124113610×−2100=000120−124113610×10−31=000

Finding a basis for the column space

The pivot columns of the RREF are columns 1 and 3. A basis for the column space is columns 1 and 3 of the original matrix A, not the columns of the RREF. This matters because row operations change the column space.

Basis:123011

The remaining columns 2 and 4 are linear combinations of these two. For example, column 2 is twice column 1.

The relationship between the dimensions

There are 4 columns and the rank is 2, so the dimension of the null space (the nullity) is 4 − 2 = 2, which matches the number of basis vectors we just found. This relationship is the rank-nullity theorem.

rank(A) + nullity(A) = number of columns2 + 2 = 4

Common mistakes

FAQ

Do the null space and the column space live in the same space?

No. For an m×n matrix, the column space is a subspace of ℝᵐ and the null space is a subspace of ℝⁿ.

How do I find a basis for the row space?

The nonzero rows of the RREF form a basis for the row space. Row operations do not change the row space, so the rows of the RREF can be used directly.

What does it mean if the null space has dimension 0?

It means the only solution of Ax = 0 is the zero vector. Equivalently, every column has a pivot, and the columns are linearly independent.

Related guides