# Chapter 12. Rank and Nullity

# Chapter 12. Rank and Nullity

Rank and nullity measure two complementary parts of a matrix. Rank measures how many independent directions the matrix produces. Nullity measures how many independent directions the matrix sends to zero. For an \(m\times n\) matrix \(A\), these quantities satisfy the rank-nullity theorem:

$$
\operatorname{rank}(A)+\operatorname{nullity}(A)=n.
$$

Here \(n\) is the number of columns of \(A\). Equivalently, it is the dimension of the input space. This theorem says that every input direction is accounted for either by contributing to the image of \(A\), or by disappearing into the null space of \(A\).

## 12.1 Rank

The rank of a matrix is the number of pivot positions in any row echelon form of the matrix.

If \(A\) row reduces to an echelon matrix with \(r\) nonzero rows, then

$$
\operatorname{rank}(A)=r.
$$

For example,

$$
A=
\begin{bmatrix}
1&2&3\\
2&4&6\\
1&1&0
\end{bmatrix}.
$$

Apply row operations:

$$
R_2\leftarrow R_2-2R_1,
\qquad
R_3\leftarrow R_3-R_1.
$$

Then

$$
\begin{bmatrix}
1&2&3\\
0&0&0\\
0&-1&-3
\end{bmatrix}.
$$

Swap rows \(2\) and \(3\):

$$
\begin{bmatrix}
1&2&3\\
0&-1&-3\\
0&0&0
\end{bmatrix}.
$$

There are two nonzero rows in echelon form. Therefore

$$
\operatorname{rank}(A)=2.
$$

## 12.2 Rank as Number of Pivots

Rank can be read from pivots.

Each pivot represents one independent constraint in the row view and one independent output direction in the column view. If a matrix has \(r\) pivots, then its rank is \(r\).

For example,

$$
R=
\begin{bmatrix}
1&0&3&2\\
0&1&-1&4\\
0&0&0&0
\end{bmatrix}
$$

has two pivots. Hence

$$
\operatorname{rank}(R)=2.
$$

The original matrix and its row echelon form have the same rank, because elementary row operations preserve the number of pivots.

## 12.3 Row Rank and Column Rank

There are two natural ways to define rank.

The row rank is the dimension of the row space: the number of linearly independent rows.

The column rank is the dimension of the column space: the number of linearly independent columns.

A fundamental theorem says that these two numbers are always equal. Thus we may speak simply of the rank of a matrix.

$$
\text{row rank}(A)=\text{column rank}(A)=\operatorname{rank}(A).
$$

This equality is one reason rank is so useful. It connects equations, columns, transformations, and dimension.

## 12.4 Column Space

The column space of an \(m\times n\) matrix \(A\) is the span of its columns.

If

$$
A=
\begin{bmatrix}
|&|&&|\\
a_1&a_2&\cdots&a_n\\
|&|&&|
\end{bmatrix},
$$

then

$$
\operatorname{Col}(A) =
\operatorname{span}\{a_1,a_2,\ldots,a_n\}.
$$

The column space is a subspace of \(F^m\).

The equation

$$
Ax=b
$$

has a solution exactly when

$$
b\in \operatorname{Col}(A).
$$

Thus the column space is the set of all right-hand sides that the matrix can produce.

## 12.5 Rank as Dimension of the Column Space

Rank is also the dimension of the column space:

$$
\operatorname{rank}(A)=\dim \operatorname{Col}(A).
$$

This means rank counts how many independent columns the matrix has.

For example,

$$
A=
\begin{bmatrix}
1&2&3\\
0&1&1\\
0&0&0
\end{bmatrix}.
$$

The first two columns

$$
\begin{bmatrix}
1\\
0\\
0
\end{bmatrix},
\qquad
\begin{bmatrix}
2\\
1\\
0
\end{bmatrix}
$$

are independent. The third column is their sum:

$$
\begin{bmatrix}
3\\
1\\
0
\end{bmatrix} =
\begin{bmatrix}
1\\
0\\
0
\end{bmatrix}
+
\begin{bmatrix}
2\\
1\\
0
\end{bmatrix}.
$$

Therefore the column space has dimension \(2\), and

$$
\operatorname{rank}(A)=2.
$$

## 12.6 Pivot Columns

Pivot columns identify a basis for the column space.

The important rule is this: row reduce \(A\), find the pivot column positions, then take the corresponding columns from the original matrix \(A\).

For example,

$$
A=
\begin{bmatrix}
1&2&3\\
2&4&7\\
1&2&4
\end{bmatrix}.
$$

Row reduction gives

$$
\begin{bmatrix}
1&2&3\\
0&0&1\\
0&0&1
\end{bmatrix}
\longrightarrow
\begin{bmatrix}
1&2&3\\
0&0&1\\
0&0&0
\end{bmatrix}.
$$

The pivot columns are columns \(1\) and \(3\). Therefore a basis for the column space of the original matrix is

$$
\left\{
\begin{bmatrix}
1\\
2\\
1
\end{bmatrix},
\begin{bmatrix}
3\\
7\\
4
\end{bmatrix}
\right\}.
$$

Do not take the pivot columns from the reduced matrix when the goal is a basis for the original column space.

## 12.7 Row Space

The row space of a matrix is the span of its rows.

If \(A\) is an \(m\times n\) matrix, each row is a vector in \(F^n\). The row space is therefore a subspace of \(F^n\).

For example,

$$
A=
\begin{bmatrix}
1&2&3\\
2&4&6\\
0&1&1
\end{bmatrix}.
$$

The rows are

$$
(1,2,3),\qquad (2,4,6),\qquad (0,1,1).
$$

Since the second row is twice the first, it adds no new direction. The row space is spanned by

$$
(1,2,3)
$$

and

$$
(0,1,1).
$$

Thus the row rank is \(2\).

## 12.8 Basis for the Row Space

The nonzero rows of a row echelon form give a basis for the row space.

For example,

$$
A=
\begin{bmatrix}
1&2&3\\
2&4&6\\
0&1&1
\end{bmatrix}
$$

row reduces to

$$
R=
\begin{bmatrix}
1&2&3\\
0&1&1\\
0&0&0
\end{bmatrix}.
$$

The nonzero rows of \(R\) are

$$
(1,2,3),
\qquad
(0,1,1).
$$

They form a basis for the row space. Therefore

$$
\operatorname{rank}(A)=2.
$$

## 12.9 Null Space

The null space of an \(m\times n\) matrix \(A\) is the set of all vectors \(x\in F^n\) such that

$$
Ax=0.
$$

It is denoted by

$$
\operatorname{Null}(A)
$$

or

$$
N(A).
$$

Thus

$$
\operatorname{Null}(A)=\{x\in F^n:Ax=0\}.
$$

The null space is a subspace of \(F^n\). It contains all input vectors that the matrix sends to the zero vector.

## 12.10 Nullity

The nullity of a matrix is the dimension of its null space:

$$
\operatorname{nullity}(A)=\dim \operatorname{Null}(A).
$$

Equivalently, nullity is the number of free variables in the homogeneous system

$$
Ax=0.
$$

For example, suppose the reduced row echelon form of \(A\) is

$$
\begin{bmatrix}
1&0&2&-1\\
0&1&3&4\\
0&0&0&0
\end{bmatrix}.
$$

There are four variables and two pivots. Therefore there are two free variables. Hence

$$
\operatorname{nullity}(A)=2.
$$

## 12.11 Computing the Null Space

To compute the null space, solve the homogeneous system

$$
Ax=0.
$$

Consider

$$
A=
\begin{bmatrix}
1&1&1&1\\
2&3&4&5
\end{bmatrix}.
$$

Row reduce:

$$
\begin{bmatrix}
1&1&1&1\\
2&3&4&5
\end{bmatrix}
\longrightarrow
\begin{bmatrix}
1&1&1&1\\
0&1&2&3
\end{bmatrix}
\longrightarrow
\begin{bmatrix}
1&0&-1&-2\\
0&1&2&3
\end{bmatrix}.
$$

The homogeneous equations are

$$
x_1-x_3-2x_4=0,
$$

$$
x_2+2x_3+3x_4=0.
$$

Let

$$
x_3=s,\qquad x_4=t.
$$

Then

$$
x_1=s+2t,
\qquad
x_2=-2s-3t.
$$

Thus

$$
x=
\begin{bmatrix}
s+2t\\
-2s-3t\\
s\\
t
\end{bmatrix} =
s
\begin{bmatrix}
1\\
-2\\
1\\
0
\end{bmatrix}
+
t
\begin{bmatrix}
2\\
-3\\
0\\
1
\end{bmatrix}.
$$

A basis for the null space is

$$
\left\{
\begin{bmatrix}
1\\
-2\\
1\\
0
\end{bmatrix},
\begin{bmatrix}
2\\
-3\\
0\\
1
\end{bmatrix}
\right\}.
$$

Therefore

$$
\operatorname{nullity}(A)=2.
$$

## 12.12 Rank-Nullity Theorem for Matrices

Let \(A\) be an \(m\times n\) matrix. Then

$$
\operatorname{rank}(A)+\operatorname{nullity}(A)=n.
$$

The rank counts pivot variables. The nullity counts free variables. Since every variable is either a pivot variable or a free variable, their counts add to the total number of variables, which is the number of columns of \(A\).

If

$$
\operatorname{rank}(A)=r,
$$

then

$$
\operatorname{nullity}(A)=n-r.
$$

This formula is often the fastest way to compute nullity once rank is known.

## 12.13 Rank-Nullity Theorem for Linear Maps

The same theorem applies to linear transformations.

Let

$$
T:V\to W
$$

be a linear transformation, where \(V\) is finite-dimensional. Then

$$
\dim V=\dim \ker(T)+\dim \operatorname{im}(T).
$$

Here

$$
\dim \ker(T)
$$

is the nullity of \(T\), and

$$
\dim \operatorname{im}(T)
$$

is the rank of \(T\).

This form shows the conceptual meaning of the theorem. The domain splits into directions lost by \(T\) and directions that contribute to the image.

## 12.14 Full Rank

An \(m\times n\) matrix has full rank if its rank is as large as possible.

Since the rank cannot exceed the number of rows or the number of columns,

$$
\operatorname{rank}(A)\le \min(m,n).
$$

Thus full rank means

$$
\operatorname{rank}(A)=\min(m,n).
$$

There are two common cases.

If \(m\ge n\), full rank means rank \(n\). The columns are linearly independent, and the nullity is \(0\).

If \(m\le n\), full rank means rank \(m\). The columns span the whole output space \(F^m\).

## 12.15 Rank and Solvability

The equation

$$
Ax=b
$$

is solvable exactly when

$$
b\in \operatorname{Col}(A).
$$

Thus rank tells how large the set of reachable right-hand sides is.

If \(A\) is \(m\times n\), then

$$
\operatorname{Col}(A)\subseteq F^m.
$$

If

$$
\operatorname{rank}(A)=m,
$$

then

$$
\operatorname{Col}(A)=F^m.
$$

In that case, \(Ax=b\) has at least one solution for every \(b\in F^m\).

If

$$
\operatorname{rank}(A)<m,
$$

then some right-hand sides are unreachable.

## 12.16 Rank and Uniqueness

The equation

$$
Ax=b
$$

has at most one solution exactly when the null space is trivial:

$$
\operatorname{Null}(A)=\{0\}.
$$

This is equivalent to

$$
\operatorname{nullity}(A)=0.
$$

By rank-nullity, for an \(m\times n\) matrix this means

$$
\operatorname{rank}(A)=n.
$$

Thus the columns of \(A\) must be linearly independent.

If the null space contains a nonzero vector \(v\), then any solution \(p\) gives infinitely many solutions:

$$
p+tv,\qquad t\in F.
$$

## 12.17 Square Matrices

For an \(n\times n\) matrix \(A\), the rank-nullity theorem becomes

$$
\operatorname{rank}(A)+\operatorname{nullity}(A)=n.
$$

The matrix is invertible exactly when

$$
\operatorname{rank}(A)=n.
$$

Equivalently,

$$
\operatorname{nullity}(A)=0.
$$

Thus an invertible matrix has no nonzero vector in its null space.

A singular matrix has

$$
\operatorname{rank}(A)<n
$$

and

$$
\operatorname{nullity}(A)>0.
$$

It collapses at least one nonzero direction to zero.

## 12.18 Rank of a Product

If \(A\) and \(B\) are matrices with compatible sizes, then

$$
\operatorname{rank}(AB)\le \operatorname{rank}(A)
$$

and

$$
\operatorname{rank}(AB)\le \operatorname{rank}(B).
$$

Multiplication cannot create more independent output directions than either factor allows.

Geometrically, \(B\) first restricts the possible intermediate outputs. Then \(A\) acts on those outputs. The final image cannot have dimension larger than the image available after either step.

## 12.19 Rank and Transpose

The rank of a matrix equals the rank of its transpose:

$$
\operatorname{rank}(A)=\operatorname{rank}(A^T).
$$

This is another way to express equality of row rank and column rank. The columns of \(A^T\) are the rows of \(A\), and the rows of \(A^T\) are the columns of \(A\).

## 12.20 Geometric Meaning

Rank is the dimension of the output produced by a matrix.

Nullity is the dimension of the input directions that disappear.

For example, the matrix

$$
A=
\begin{bmatrix}
1&0\\
0&0
\end{bmatrix}
$$

maps

$$
\begin{bmatrix}
x\\
y
\end{bmatrix}
$$

to

$$
\begin{bmatrix}
x\\
0
\end{bmatrix}.
$$

The image is the \(x\)-axis, so

$$
\operatorname{rank}(A)=1.
$$

The null space is the \(y\)-axis, because all vectors of the form

$$
\begin{bmatrix}
0\\
y
\end{bmatrix}
$$

are sent to zero. Therefore

$$
\operatorname{nullity}(A)=1.
$$

Since \(A\) has two columns,

$$
1+1=2.
$$

## 12.21 Common Mistakes

| Mistake | Correction |
|---|---|
| Confusing rank with number of rows | Rank is the number of pivots, not the number of rows |
| Confusing nullity with number of zero rows | Nullity is the number of free variables in \(Ax=0\) |
| Taking column-space basis from reduced columns | Use pivot positions to select columns from the original matrix |
| Forgetting that null space lives in \(F^n\) | For \(m\times n\), null vectors have \(n\) entries |
| Forgetting that column space lives in \(F^m\) | Columns have \(m\) entries |
| Assuming rank changes under row operations | Row operations preserve rank |

## 12.22 Summary

Rank and nullity describe how a matrix acts on its input space.

Rank measures the dimension of the image:

$$
\operatorname{rank}(A)=\dim \operatorname{Col}(A).
$$

Nullity measures the dimension of the null space:

$$
\operatorname{nullity}(A)=\dim \operatorname{Null}(A).
$$

For an \(m\times n\) matrix,

$$
\operatorname{rank}(A)+\operatorname{nullity}(A)=n.
$$

The main interpretations are:

| Quantity | Meaning |
|---|---|
| Rank | Number of pivots |
| Rank | Dimension of column space |
| Rank | Dimension of row space |
| Nullity | Number of free variables in \(Ax=0\) |
| Nullity | Dimension of null space |
| Rank + nullity | Number of input variables |

Rank tells how many independent directions survive. Nullity tells how many independent directions vanish. Together they account for the whole input space.
