Linear Algebra · Siblings

The rank and the nullity of a matrix count two complementary kinds of directions, so the two numbers are easy to mix up. The rank of a matrix $A$ is the dimension of its column space: the number of independent directions that $A x$ can reach. The nullity of $A$ is the dimension of its kernel: the number of independent directions that $A$ sends to $0$. In the reduced row echelon form of $A$, the rank counts the columns with a leading entry and the nullity counts the columns without one, so for an $m \times n$ matrix, $\rank{A} + \nullity{A} = n$ (the rank–nullity theorem).

Definitions

rank (of a matrix)

High school

Consider a matrix $A$ and its reduced row echelon form. The rank of $A$ is the number of nonzero rows of the reduced row echelon form, which is the number of its leading entries.

Undergraduate

Consider a matrix and its column space, the span of its columns. The rank of the matrix is the dimension of its column space: the maximum number of linearly independent columns.

Worked examples
  • Value:

    $\rank{I} = 3$

    The $3 \times 3$ identity matrix has rank $3$, because its columns are linearly independent.
  • Value:

    $\rank{A} = 2$

    The matrix \(\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}\) has rank $2$, because its echelon form has two nonzero rows.
  • Value:

    $\rank{A} = 2$

    The matrix \(\begin{bmatrix} 1 & 3 & 5 \\ 0 & 2 & 4 \end{bmatrix}\) has rank $2$, because it is in echelon form and has two nonzero rows.
  • Value:

    $1$

    The rank of the $3 \times 4$ matrix of ones is $1$, because every row is $(1, 1, 1, 1)$. The $3 \times 4$ matrix of ones has matrix rank $1$, because all of its columns are equal, so only one is linearly independent.
  • Value:

    $\rank{A} = 1$

    The matrix \(\begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix}\) has rank $1$, because its second column is twice its first column.
  • Value:

    $\rank{0} = 0$

    The $2 \times 2$ zero matrix has rank $0$, because its column space is $\setdef{0}$.
Properties
  • The rank of an $m \times n$ matrix $A$ is the rank of the linear map $x \mapsto A x$ from $\reals^n$ to $\reals^m$, because the column space of $A$ is the range of that map.
  • If $A$ is the matrix of a linear map $T$ relative to some pair of bases, then $\rank{A} = \rank{T}$.
  • The rank also equals the maximum number of linearly independent rows (row rank equals column rank).
  • For an $m \times n$ matrix $A$, the rank plus the nullity (the dimension of the null space) of $A$ is $n$ (the rank–nullity theorem).

nullity (of a matrix)

High school

Consider a matrix $A$ and its reduced row echelon form. The nullity of $A$ is the number of columns of the reduced row echelon form that have no leading entry.

Undergraduate

Consider an $m \times n$ matrix $A$ and its null space $\nullspace{A}$, the set of vectors $x \in \reals^n$ such that $A x = 0$. The nullity of $A$ is the dimension of the null space of $A$:

\[\nullity{A} = \dim(\nullspace{A}).\]
Worked examples
  • Value:

    $\nullity{I} = 0$

    The $3 \times 3$ identity matrix has nullity $0$, because $I x = x$, so $I x = 0$ only for $x = 0$.
  • Value:

    $\nullity{A} = 0$

    The matrix \(\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}\) has nullity $0$, because its determinant is $-2 \neq 0$, so $A x = 0$ only for $x = 0$.
  • Value:

    $\nullity{A} = 1$

    The matrix \(\begin{bmatrix} 1 & 3 & 5 \\ 0 & 2 & 4 \end{bmatrix}\) has nullity $1$, because its third column has no leading entry, so $x_3$ is a free variable, and its kernel is the line spanned by $(1, -2, 1)$.
  • Value:

    $3$

    The $3 \times 4$ matrix of ones has nullity $3$, because its kernel is the set of vectors $x$ in $\reals^4$ such that $x_1 + x_2 + x_3 + x_4 = 0$, which is a $3$-dimensional subspace. This agrees with the rank–nullity theorem: $4 - 1 = 3$.
  • Value:

    $\nullity{A} = 1$

    The matrix \(\begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix}\) has nullity $1$, because its kernel is the line spanned by $(2, -1)$.
  • Value:

    $\nullity{0} = 2$

    The $2 \times 2$ zero matrix has nullity $2$, because it sends every vector in $\reals^2$ to $0$.
Properties
  • The nullity of $A$ is the nullity of the linear map $x \mapsto A x$, because the null space of $A$ is the kernel of that map.
  • For an $m \times n$ matrix $A$, $\rank{A} + \nullity{A} = n$ (the rank–nullity theorem).
  • The nullity of a matrix $A$ is the number of free variables in the solutions of $A x = 0$.
  • The nullity of a matrix $A$ is $0$ if and only if the columns of $A$ are linearly independent, if and only if the map $x \mapsto A x$ is injective.

Examples

Each cell is the ___ of the matrix in that row.

Example rank (of a matrix) nullity (of a matrix) Why
The $3 \times 3$ identity matrix $\rank{I} = 3$$\nullity{I} = 0$
rank (of a matrix): The $3 \times 3$ identity matrix has rank $3$, because its columns are linearly independent.
nullity (of a matrix): The $3 \times 3$ identity matrix has nullity $0$, because $I x = x$, so $I x = 0$ only for $x = 0$.
The matrix $[1, 2; 3, 4]$ $\rank{A} = 2$$\nullity{A} = 0$
rank (of a matrix): The matrix \(\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}\) has rank $2$, because its echelon form has two nonzero rows.
nullity (of a matrix): The matrix \(\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}\) has nullity $0$, because its determinant is $-2 \neq 0$, so $A x = 0$ only for $x = 0$.
The matrix $[1, 3, 5; 0, 2, 4]$ $\rank{A} = 2$$\nullity{A} = 1$
rank (of a matrix): The matrix \(\begin{bmatrix} 1 & 3 & 5 \\ 0 & 2 & 4 \end{bmatrix}\) has rank $2$, because it is in echelon form and has two nonzero rows.
nullity (of a matrix): The matrix \(\begin{bmatrix} 1 & 3 & 5 \\ 0 & 2 & 4 \end{bmatrix}\) has nullity $1$, because its third column has no leading entry, so $x_3$ is a free variable, and its kernel is the line spanned by $(1, -2, 1)$.
The matrix $[1, 2; 2, 4]$ $\rank{A} = 1$$\nullity{A} = 1$
rank (of a matrix): The matrix \(\begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix}\) has rank $1$, because its second column is twice its first column.
nullity (of a matrix): The matrix \(\begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix}\) has nullity $1$, because its kernel is the line spanned by $(2, -1)$.
The $3 \times 4$ matrix of ones $1$$3$
rank (of a matrix): The rank of the $3 \times 4$ matrix of ones is $1$, because every row is $(1, 1, 1, 1)$. The $3 \times 4$ matrix of ones has matrix rank $1$, because all of its columns are equal, so only one is linearly independent.
nullity (of a matrix): The $3 \times 4$ matrix of ones has nullity $3$, because its kernel is the set of vectors $x$ in $\reals^4$ such that $x_1 + x_2 + x_3 + x_4 = 0$, which is a $3$-dimensional subspace. This agrees with the rank–nullity theorem: $4 - 1 = 3$.
The $2 \times 2$ zero matrix $\rank{0} = 0$$\nullity{0} = 2$
rank (of a matrix): The $2 \times 2$ zero matrix has rank $0$, because its column space is $\setdef{0}$.
nullity (of a matrix): The $2 \times 2$ zero matrix has nullity $2$, because it sends every vector in $\reals^2$ to $0$.

Notes

  • The same two numbers are defined for a linear map $T : V \to W$: the rank of $T$ is the dimension of the range of $T$, and the nullity of $T$ is the dimension of the kernel of $T$. For the map $x \mapsto A x$, these equal the rank and the nullity of the matrix $A$.

See also

All distinctions · All definitions · Notation