Tutorials › Linear Algebra › Using Rank-Nullity to Recover Unknown Dimensions

Fundamental Subspaces and Rank · Tutorial 367 of 1000

Using Rank-Nullity to Recover Unknown Dimensions

Learn to recover unknown matrix dimensions from rank and nullity data, and to test whether all the reported dimensions can hold simultaneously.

Intermediate 10 min read

What You'll Learn

  • Recover a matrix’s number of columns from its rank and nullity
  • Infer rank and nullity from dimensions of fundamental subspaces
  • Use left nullity to recover an unknown number of rows
  • Check integer, sum, and rank-bound conditions for compatibility
  • Construct a matrix that realizes compatible dimension data

What Dimension Data Can Tell You

A matrix may be described by only some of its dimensions. You might know its rank and nullity but not its number of columns, or know the dimensions of its row space and left null space but not its row count. Rank-nullity turns these partial reports into equations. The important second step is to check that the inferred numbers are possible for a matrix of the stated size.

Let \(\mathbf{A}\in\mathbb{R}^{m\times n}\). It represents a linear map from \(\mathbb{R}^n\) to \(\mathbb{R}^m\). Its rank is the dimension of its column space, \(\operatorname{rank}\mathbf{A}=\dim(\operatorname{Col}\mathbf{A})\), and its nullity is the dimension of its null space, \(\operatorname{nullity}\mathbf{A}=\dim(\operatorname{Nul}\mathbf{A})\). The number \(n\) counts columns, or input coordinates; \(m\) counts rows, or output coordinates. Neither is, in general, the rank.

Rank-Nullity Theorem: For an \(m\times n\) matrix \(\mathbf{A}\), \(\operatorname{rank}\mathbf{A}+\operatorname{nullity}\mathbf{A}=n\). Thus the number of columns equals rank plus nullity. Also, \(0\leq\operatorname{rank}\mathbf{A}\leq\min(m,n)\). These are standard results established in the earlier material on the Matrix Rank-Nullity Theorem and full rank for rectangular matrices.

The first equation is about the domain, so it recovers the number of columns. To recover the number of rows from a related dimension count, use the transpose. The left null space is \(\operatorname{Nul}\mathbf{A}^{\top}\), consisting of vectors \(\mathbf{y}\in\mathbb{R}^m\) such that \(\mathbf{A}^{\top}\mathbf{y}=\mathbf{0}\). By rank-nullity applied to \(\mathbf{A}^{\top}\), together with \(\operatorname{rank}(\mathbf{A}^{\top})=\operatorname{rank}\mathbf{A}\), its dimension is \(m-\operatorname{rank}\mathbf{A}\). The equality of the two ranks is the standard result on rank of a transpose established earlier.

Dimension formulas: If \(r=\operatorname{rank}\mathbf{A}\), then \(\dim(\operatorname{Col}\mathbf{A})=r\), \(\dim(\operatorname{Row}\mathbf{A})=r\), \(\dim(\operatorname{Nul}\mathbf{A})=n-r\), and \(\dim(\operatorname{Nul}\mathbf{A}^{\top})=m-r\). The row-space and four-fundamental-subspace dimension statements are standard results from the earlier material on dimensions of the four fundamental subspaces.

Recovering a Missing Number

When two of rank, nullity, and column count are given, the third is determined by one equation. Rearrange it to match the missing quantity: \(n=r+\operatorname{nullity}\mathbf{A}\), \(r=n-\operatorname{nullity}\mathbf{A}\), or \(\operatorname{nullity}\mathbf{A}=n-r\). If the number of rows is also known, compare the inferred rank with the bound \(r\leq m\). A numerical answer from the equation is not automatically feasible.

Worked Example: Recovering the Number of Columns

An \(m\times n\) matrix has rank \(4\) and nullity \(3\). Its number of rows is \(5\). Find \(n\), and check that these data are possible.

Rank-nullity gives \(n=4+3=7\). The required rank bound is \(0\leq4\leq\min(5,7)=5\), so the values pass the size check.

To verify that these data can occur together, consider

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

The first four columns are pivot columns and the remaining three are zero columns, so the rank is \(4\). For \(\mathbf{x}=(x_1,x_2,x_3,x_4,x_5,x_6,x_7)^{\top}\), the equation \(\mathbf{A}\mathbf{x}=\mathbf{0}\) says \(x_1=x_2=x_3=x_4=0\), leaving \(x_5,x_6,x_7\) free. Thus the nullity is \(3\). The matrix has \(7\) columns, as inferred.

A dimension report can also include data about multiple fundamental subspaces. In that case, first translate each reported dimension into either rank, nullity, or a row/column count. Then check that every translated value agrees with the others.

Worked Example: Using the Row Space and Null Space

A matrix has \(8\) rows and \(11\) columns. Its row space has dimension \(6\). Find its rank, nullity, and left nullity.

The row-space dimension equals the rank, so \(r=6\). Since there are \(11\) columns, rank-nullity gives \(\operatorname{nullity}\mathbf{A}=11-6=5\). Since there are \(8\) rows, the left nullity is \(8-6=2\).

Check: the column-space and row-space dimensions are both \(6\); the nullity and left nullity give the respective sums \(6+5=11\) and \(6+2=8\). The rank bound also holds because \(6\leq\min(8,11)=8\).

When Are the Data Compatible?

For an \(m\times n\) matrix, a proposed rank \(r\) must be an integer between \(0\) and \(\min(m,n)\). Once \(r\) is chosen, the nullity and left nullity are not additional independent choices: they must be \(n-r\) and \(m-r\). In particular, their reported values must be nonnegative integers and satisfy the corresponding sums.

Theorem (Compatibility of rank and nullity data): Let \(m,n\) be nonnegative integers and let \(r,k\) be integers. There exists a real \(m\times n\) matrix of rank \(r\) and nullity \(k\) if and only if \(0\leq r\leq\min(m,n)\) and \(k=n-r\).

Proof. Suppose first that such a matrix \(\mathbf{A}\) exists. A matrix with \(m\) rows and \(n\) columns has rank at most both \(m\) and \(n\), and rank is nonnegative, so \(0\leq r\leq\min(m,n)\). The Matrix Rank-Nullity Theorem gives \(r+k=n\), hence \(k=n-r\).

Conversely, suppose \(0\leq r\leq\min(m,n)\) and \(k=n-r\). Form the \(m\times n\) matrix whose first \(r\) diagonal entries are \(1\) and whose other entries are \(0\). This construction also covers \(r=0\), when the matrix is all zero. Its first \(r\) columns are pivot columns and every remaining column is zero, so its rank is \(r\). Its homogeneous system forces the first \(r\) coordinates to be zero and leaves the other \(n-r\) coordinates free, so its nullity is \(n-r=k\). Such a matrix therefore realizes the proposed data. \(\square\)

This theorem gives both a test and a way to verify that the test is sharp: when the conditions hold, there really is a matrix with those dimensions. It also shows why checking only the equation \(r+k=n\) is insufficient. That equation does not ensure that the rank fits the number of rows.

Worked Example: Data That Fail a Rank Bound

A proposed \(5\times8\) matrix is reported to have rank \(6\) and nullity \(2\). Are the data compatible?

The sum check passes: \(6+2=8\), which is the column count. But the rank bound fails: \(6>\min(5,8)=5\). No matrix with only \(5\) rows can have rank \(6\), so the report is impossible.

A different report for a \(5\times8\) matrix gives rank \(4\) and nullity \(3\). Here \(4+3=7\ne8\), so rank-nullity fails. The rank itself is within the size bound, but the nullity would have to be \(8-4=4\), not \(3\). Each check catches a different kind of incompatibility.

Inferring Both Row and Column Counts

When rank and both kinds of nullity are reported, the row and column counts follow separately. If the rank is \(r\), the nullity is \(k\), and the left nullity is \(\ell\), then \(n=r+k\) and \(m=r+\ell\). The resulting dimensions must still be nonnegative integers, and the rank must not exceed either inferred count.

Worked Example: Recovering Both Matrix Dimensions

A matrix has rank \(3\), nullity \(4\), and left nullity \(2\). Find its size and check that these data are realizable.

The number of columns is \(n=3+4=7\). The number of rows is \(m=3+2=5\). The rank bound is satisfied because \(0\leq3\leq\min(5,7)=5\).

For a direct realization, take

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

The first three columns are pivot columns, so the rank is \(3\). The last four coordinates of a solution to \(\mathbf{A}\mathbf{x}=\mathbf{0}\) are free, giving nullity \(4\). For \(\mathbf{y}\in\mathbb{R}^5\), the equation \(\mathbf{A}^{\top}\mathbf{y}=\mathbf{0}\) forces \(y_1=y_2=y_3=0\) and leaves \(y_4,y_5\) free, giving left nullity \(2\). The checks agree with the inferred size \(5\times7\).

A Reliable Compatibility Check

When several pieces of dimension data are supplied, do not accept a plausible-looking answer based on one equation. Translate each item into a constraint and compare all constraints. For a reported \(m\times n\) matrix, the essential checks are:

  • Every dimension and count is a nonnegative integer.
  • The rank agrees with the dimensions of the row space and column space.
  • Rank plus nullity equals the number of columns.
  • Rank plus left nullity equals the number of rows.
  • The rank lies between \(0\) and \(\min(m,n)\).

These checks also reveal when information is incomplete rather than contradictory. For instance, knowing only that rank is \(4\) does not determine either matrix dimension: many sizes with at least \(4\) rows and \(4\) columns can support rank \(4\). Likewise, rank and nullity determine the number of columns, but not the number of rows unless further data are provided.

Common Mistake: Confusing Rank with the Number of Columns

Suppose a matrix has rank \(4\) and nullity \(3\). A wrong calculation might say, “The rank is \(4\), so the matrix has \(4\) columns.” This mistakes the number of pivot columns for the total number of columns. The correction is to use rank-nullity: \(n=4+3=7\). Four columns contribute pivots, while the other three correspond to free variables in the homogeneous system. Always use the dimension equation before identifying a count.

A second useful warning is that a correct sum does not replace the rank bound. Rank \(6\) and nullity \(2\) sum to \(8\), but cannot describe a \(5\times8\) matrix because its rank cannot exceed \(5\). A complete compatibility check uses both the sum equations and the size bounds.

Check Your Understanding

For each problem, state the equation or bound you use, then check whether the result is compatible.

  1. A matrix has rank \(5\) and nullity \(2\). How many columns does it have?
  2. A \(4\times9\) matrix is reported to have rank \(4\) and nullity \(5\). Are these data compatible?
  3. A matrix has rank \(3\), row-space dimension \(3\), and left nullity \(2\). If it has \(7\) columns, how many rows does it have?
  4. Can a \(6\times4\) matrix have rank \(5\) and nullity \(-1\)? Check both the rank bound and the dimension condition.
  5. If rank is \(2\), nullity is \(5\), and left nullity is \(1\), determine the matrix size and verify the rank bound.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon