Tutorials › Linear Algebra › Pivot Counts as a Measure of Rank

Fundamental Subspaces and Rank · Tutorial 347 of 1000

Pivot Counts as a Measure of Rank

Learn to interpret rank as the dimension of a column space and determine it reliably by counting pivots in reduced row-echelon form.

Intermediate 9 min read

What You'll Learn

  • Define the rank of a matrix using the dimension of its column space.
  • Explain why elementary row operations preserve rank.
  • Prove that the number of pivots in reduced row-echelon form equals rank.
  • Count rank from row reductions of rectangular and square matrices.
  • Determine how a parameter can change a matrix’s rank.
  • Recognize why counting nonzero rows before reduction can give a wrong answer.

Rank Measures the Size of a Column Space

A matrix may have many columns without those columns carrying equally many independent directions. Some columns may be combinations of others, so the set of vectors a matrix can produce is often smaller than the number of its columns. Rank gives a precise measure of that size: it is the dimension of the column space. Row reduction then provides a practical way to find rank by counting pivot positions.

Let \(\mathbf{A}\in\mathbb{R}^{m\times n}\) have columns \(\mathbf{a}_1,\dots,\mathbf{a}_n\), each in \(\mathbb{R}^m\). Its column space is \(\operatorname{Col}\mathbf{A}=\operatorname{span}\{\mathbf{a}_1,\dots,\mathbf{a}_n\}\), the subspace consisting of all linear combinations of its columns. Since the column space is spanned by a finite list, it is finite-dimensional.

Definition: The rank of \(\mathbf{A}\), written \(\operatorname{rank}\mathbf{A}\), is the dimension of its column space: \(\operatorname{rank}\mathbf{A}=\dim(\operatorname{Col}\mathbf{A})\). Thus rank counts the number of vectors in a basis of the column space, not necessarily the total number of columns in \(\mathbf{A}\).

For example, if three columns lie in a plane through the origin in \(\mathbb{R}^3\) and span that plane, the column space has dimension \(2\), so the matrix has rank \(2\). Rank is always a nonnegative integer. Rank \(0\) means the column space is \(\{\mathbf{0}\}\), which happens exactly when every column is zero, or equivalently when \(\mathbf{A}=\mathbf{O}\).

Why Row Operations Can Be Used to Count Rank

Row reduction changes the matrix, so it is important to justify why its pivot count can tell us the rank of the original matrix. The key is that each elementary row operation applies the same invertible linear transformation to every column. It can move the column space to a different subspace, but it does not change its dimension.

Lemma: If \(\mathbf{B}\) is obtained from \(\mathbf{A}\in\mathbb{R}^{m\times n}\) by a finite sequence of elementary row operations, then \(\operatorname{rank}\mathbf{B}=\operatorname{rank}\mathbf{A}\).

Proof. Consider first one elementary row operation. It defines a linear map \(S:\mathbb{R}^m\to\mathbb{R}^m\): \(S\) swaps two coordinates for a row swap, multiplies one coordinate by a nonzero scalar for row scaling, or adds a multiple of one coordinate to another for a row replacement. Each such map has an inverse of the same type: swap again, scale by the reciprocal, or add the opposite multiple. Hence \(S\) is invertible. Applying the row operation to \(\mathbf{A}\) gives the matrix whose columns are \(S(\mathbf{a}_1),\dots,S(\mathbf{a}_n)\), so its column space is \(S(\operatorname{Col}\mathbf{A})\). An invertible linear map takes a basis to a basis: it preserves spanning because every image of a linear combination is the same combination of the images, and it preserves independence because applying \(S^{-1}\) to a relation among the images gives a relation among the original basis vectors. Therefore the two column spaces have the same dimension. Repeating this argument for each operation proves the claim for a finite sequence. \(\square\)

This lemma does not say that row operations leave the column space itself unchanged. The vectors in the column space can change; what is preserved is its dimension. The distinction matters because rank is a dimension, not a particular subspace of \(\mathbb{R}^m\).

In reduced row-echelon form (RREF), a pivot position is the leading \(1\) in a nonzero row. Each pivot is in a different row and a different column. The next theorem explains why the number of these positions measures rank.

Theorem (Pivot count for rank): For any \(\mathbf{A}\in\mathbb{R}^{m\times n}\), the rank of \(\mathbf{A}\) equals the number of pivots in \(\operatorname{rref}(\mathbf{A})\).

Proof. Let \(\mathbf{R}=\operatorname{rref}(\mathbf{A})\), and suppose it has \(r\) pivots. By the lemma, \(\operatorname{rank}\mathbf{A}=\operatorname{rank}\mathbf{R}\). It remains to show that the dimension of \(\operatorname{Col}\mathbf{R}\) is \(r\). Let the pivot columns of \(\mathbf{R}\) be \(\mathbf{r}_{j_1},\dots,\mathbf{r}_{j_r}\), in their left-to-right order. In RREF, each such column has a \(1\) in its own pivot row and \(0\) in every other row. These columns are independent: if a linear combination of them is \(\mathbf{0}\), examining the entry in each pivot row shows that the coefficient of its pivot column is \(0\). Now take any column \(\mathbf{r}_j\) of \(\mathbf{R}\). Its entries in the pivot rows give scalars \(c_1,\dots,c_r\). The vector \(\sum_{k=1}^r c_k\mathbf{r}_{j_k}\) has the same entries as \(\mathbf{r}_j\) in every pivot row. Both vectors have zero entries in all non-pivot rows, since RREF has zero rows below the pivot rows. Thus \(\mathbf{r}_j=\sum_{k=1}^r c_k\mathbf{r}_{j_k}\). The pivot columns therefore span every column of \(\mathbf{R}\), so they form a basis of its column space. Its dimension is \(r\), and hence \(\operatorname{rank}\mathbf{A}=r\). If \(r=0\), \(\mathbf{R}\) has no nonzero rows and is the zero matrix; its column space is \(\{\mathbf{0}\}\), of dimension \(0\), so the same conclusion holds. \(\square\)

The theorem applies to rectangular matrices as well as square ones. A matrix with \(m\) rows and \(n\) columns can have at most \(\min(m,n)\) pivots, because each pivot occupies a distinct row and column. Consequently, its rank cannot exceed either its number of rows or its number of columns.

Counting Pivots in Examples

Worked Example: A Rectangular Matrix with Two Pivots

Find the rank of

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

Use \(R_2\to R_2-2R_1\) and \(R_3\to R_3-R_1\). The entries in the new second row are \((2-2,\;4-4,\;0-2,\;2-6)=(0,0,-2,-4)\); those in the new third row are \((1-1,\;2-2,\;2-1,\;5-3)=(0,0,1,2)\). Thus

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

Swap \(R_2\) and \(R_3\), then use \(R_3\to R_3+2R_2\) to eliminate the entry \(-2\):

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

Finally, \(R_1\to R_1-R_2\) gives the RREF:

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

The leading \(1\)s are in columns 1 and 3, so there are two pivots and \(\operatorname{rank}\mathbf{A}=2\). Check: the displayed matrix is in RREF: its leading entries are \(1\), each pivot column has zeros elsewhere, and the zero row is at the bottom. Its two nonzero rows and two pivot positions agree.

Worked Example: Full Rank in a Square Matrix

Find the rank of

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

Apply \(R_2\to R_2-2R_1\) and \(R_3\to R_3-R_1\). The rows become \((0,1,1)\) and \((0,-1,1)\), respectively:

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

Next, \(R_3\to R_3+R_2\) gives the third row \((0,0,2)\). Scale it by \(R_3\to\tfrac12R_3\), giving \((0,0,1)\):

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

Use \(R_2\to R_2-R_3\), then \(R_1\to R_1-R_2\):

$$ \begin{bmatrix} 1&1&0\\ 0&1&1\\ 0&0&1 \end{bmatrix} \sim \begin{bmatrix} 1&1&0\\ 0&1&0\\ 0&0&1 \end{bmatrix} \sim \begin{bmatrix} 1&0&0\\ 0&1&0\\ 0&0&1 \end{bmatrix}. $$

There are three pivots, so \(\operatorname{rank}\mathbf{B}=3\). Check: the final matrix is \(\mathbf{I}_3\), with a pivot in each of its three columns and rows. The row operations have also reduced every off-diagonal entry to \(0\), as required for RREF.

Worked Example: A Parameter Changes the Rank

Determine the rank of \(\mathbf{C}(t)=\begin{bmatrix}1&2\\2&4+t\end{bmatrix}\) for real \(t\).

Apply \(R_2\to R_2-2R_1\). The second row becomes \((2-2,\;(4+t)-4)=(0,t)\), so

$$ \begin{bmatrix} 1&2\\ 2&4+t \end{bmatrix} \sim \begin{bmatrix} 1&2\\ 0&t \end{bmatrix}. $$

If \(t\ne0\), scale the second row by \(1/t\), then use \(R_1\to R_1-2R_2\):

$$ \begin{bmatrix} 1&2\\ 0&t \end{bmatrix} \sim \begin{bmatrix} 1&2\\ 0&1 \end{bmatrix} \sim \begin{bmatrix} 1&0\\ 0&1 \end{bmatrix}. $$

There are two pivots, so the rank is \(2\). If \(t=0\), the reduced matrix is instead \(\begin{bmatrix}1&2\\0&0\end{bmatrix}\), with one pivot, so the rank is \(1\). Check: when \(t=0\), the second original row is twice the first, and the RREF has one nonzero row. When \(t\ne0\), the reduction produces two pivots. Thus the rank is \(2\) for \(t\ne0\) and \(1\) for \(t=0\).

Common Mistake: Counting Rows Before Reduction

A common error is to count the nonzero rows of the original matrix and call that number its rank. Row operations can reveal that some of those rows carry no additional dimension. For instance, consider

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

A wrong calculation counts three nonzero rows in \(\mathbf{D}\), then concludes that \(\operatorname{rank}\mathbf{D}=3\). But applying \(R_3\to R_3-R_1\) gives the third row \((0,1,1)\), and then \(R_3\to R_3-R_2\) makes it zero:

$$ \begin{bmatrix} 1&0&0\\ 0&1&1\\ 1&1&1 \end{bmatrix} \sim \begin{bmatrix} 1&0&0\\ 0&1&1\\ 0&1&1 \end{bmatrix} \sim \begin{bmatrix} 1&0&0\\ 0&1&1\\ 0&0&0 \end{bmatrix}. $$

The RREF has two pivots, so the correction is \(\operatorname{rank}\mathbf{D}=2\). In the original matrix, the third row equals the sum of the first two; it was nonzero, but did not provide a third pivot direction. Count pivots after row reduction, not nonzero rows before it.

Interpreting the Count

The rank is the dimension of the space of vectors that can be formed from the columns. A larger rank means that the column space has more independent directions; a smaller rank means that all the columns together span a lower-dimensional subspace. Row reduction makes that dimension count manageable even when the original columns are difficult to compare directly.

Keep the logic in order: row operations preserve rank because they apply invertible maps to the column space; in RREF, the pivot columns form a basis of the reduced matrix’s column space; therefore, the number of pivots gives the rank of the original matrix. This argument establishes a numerical count. It does not mean that row operations leave the original column space unchanged.

Check Your Understanding

Use the definition of rank and the pivot-count theorem to justify each answer.

  1. What is the largest possible rank of a \(4\times 3\) matrix? Explain using the number of rows and columns.
  2. If the RREF of a matrix has pivots in columns 1 and 4 and no other pivot positions, what is its rank?
  3. Find the rank of \(\begin{bmatrix}1&2&3\\2&4&6\end{bmatrix}\) by row reduction.
  4. For which real values of \(t\) does \(\begin{bmatrix}1&0\\0&t\end{bmatrix}\) have rank \(1\)?
  5. Explain why an invertible row operation can change the column space without changing its dimension.

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