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 matrix , these quantities satisfy the rank-nullity theorem:
Here is the number of columns of . 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 , or by disappearing into the null space of .
12.1 Rank
The rank of a matrix is the number of pivot positions in any row echelon form of the matrix.
If row reduces to an echelon matrix with nonzero rows, then
For example,
Apply row operations:
Then
Swap rows and :
There are two nonzero rows in echelon form. Therefore
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 pivots, then its rank is .
For example,
has two pivots. Hence
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.
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 matrix is the span of its columns.
If
then
The column space is a subspace of .
The equation
has a solution exactly when
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:
This means rank counts how many independent columns the matrix has.
For example,
The first two columns
are independent. The third column is their sum:
Therefore the column space has dimension , and
12.6 Pivot Columns
Pivot columns identify a basis for the column space.
The important rule is this: row reduce , find the pivot column positions, then take the corresponding columns from the original matrix .
For example,
Row reduction gives
The pivot columns are columns and . Therefore a basis for the column space of the original matrix is
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 is an matrix, each row is a vector in . The row space is therefore a subspace of .
For example,
The rows are
Since the second row is twice the first, it adds no new direction. The row space is spanned by
and
Thus the row rank is .
12.8 Basis for the Row Space
The nonzero rows of a row echelon form give a basis for the row space.
For example,
row reduces to
The nonzero rows of are
They form a basis for the row space. Therefore
12.9 Null Space
The null space of an matrix is the set of all vectors such that
It is denoted by
or
Thus
The null space is a subspace of . 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:
Equivalently, nullity is the number of free variables in the homogeneous system
For example, suppose the reduced row echelon form of is
There are four variables and two pivots. Therefore there are two free variables. Hence
12.11 Computing the Null Space
To compute the null space, solve the homogeneous system
Consider
Row reduce:
The homogeneous equations are
Let
Then
Thus
A basis for the null space is
Therefore
12.12 Rank-Nullity Theorem for Matrices
Let be an matrix. Then
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 .
If
then
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
be a linear transformation, where is finite-dimensional. Then
Here
is the nullity of , and
is the rank of .
This form shows the conceptual meaning of the theorem. The domain splits into directions lost by and directions that contribute to the image.
12.14 Full Rank
An 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,
Thus full rank means
There are two common cases.
If , full rank means rank . The columns are linearly independent, and the nullity is .
If , full rank means rank . The columns span the whole output space .
12.15 Rank and Solvability
The equation
is solvable exactly when
Thus rank tells how large the set of reachable right-hand sides is.
If is , then
If
then
In that case, has at least one solution for every .
If
then some right-hand sides are unreachable.
12.16 Rank and Uniqueness
The equation
has at most one solution exactly when the null space is trivial:
This is equivalent to
By rank-nullity, for an matrix this means
Thus the columns of must be linearly independent.
If the null space contains a nonzero vector , then any solution gives infinitely many solutions:
12.17 Square Matrices
For an matrix , the rank-nullity theorem becomes
The matrix is invertible exactly when
Equivalently,
Thus an invertible matrix has no nonzero vector in its null space.
A singular matrix has
and
It collapses at least one nonzero direction to zero.
12.18 Rank of a Product
If and are matrices with compatible sizes, then
and
Multiplication cannot create more independent output directions than either factor allows.
Geometrically, first restricts the possible intermediate outputs. Then 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:
This is another way to express equality of row rank and column rank. The columns of are the rows of , and the rows of are the columns of .
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
maps
to
The image is the -axis, so
The null space is the -axis, because all vectors of the form
are sent to zero. Therefore
Since has two columns,
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 |
| Taking column-space basis from reduced columns | Use pivot positions to select columns from the original matrix |
| Forgetting that null space lives in | For , null vectors have entries |
| Forgetting that column space lives in | Columns have 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:
Nullity measures the dimension of the null space:
For an matrix,
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 |
| 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.