Rank of a Matrix

April 13, 2026

Problem

Find the rank of A = [[1,2,3],[4,5,6],[7,8,9]]. Reduce to echelon form and count pivots.

Explanation

What is rank?

The rank of an m×nm \times n matrix AA, written rank(A)\operatorname{rank}(A), is the dimension of its column space — the number of linearly independent columns. Equivalently, it's:

  • The number of pivots in any row-echelon form of AA.
  • The dimension of the row space (row rank == column rank — always).
  • The number of non-zero rows in the RREF.

Rank satisfies 0rank(A)min(m,n)0 \le \operatorname{rank}(A) \le \min(m, n).

Step-by-step

A=(123456789)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{pmatrix}

Step 1 — Row reduce.

R2R24R1R_2 \to R_2 - 4 R_1: (4,5,6)4(1,2,3)=(0,3,6)(4, 5, 6) - 4(1, 2, 3) = (0, -3, -6). R3R37R1R_3 \to R_3 - 7 R_1: (7,8,9)7(1,2,3)=(0,6,12)(7, 8, 9) - 7(1, 2, 3) = (0, -6, -12).

(1230360612)\begin{pmatrix} 1 & 2 & 3 \\ 0 & -3 & -6 \\ 0 & -6 & -12 \end{pmatrix}

R3R32R2R_3 \to R_3 - 2 R_2: (0,6,12)2(0,3,6)=(0,0,0)(0, -6, -12) - 2(0, -3, -6) = (0, 0, 0).

(123036000)\begin{pmatrix} 1 & 2 & 3 \\ 0 & -3 & -6 \\ 0 & 0 & 0 \end{pmatrix}

Step 2 — Count pivots. Row 1 has a pivot in column 1; row 2 has a pivot in column 2; row 3 is zero (no pivot).

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

Since AA is 3×33 \times 3 but rank 2, the matrix is rank-deficient: it has fewer pivots than its size. It is singular (detA=0\det A = 0) and not invertible.

A rank-2 story: what went wrong?

The original rows are arithmetic progressions: (1,2,3),(4,5,6),(7,8,9)(1,2,3), (4,5,6), (7,8,9). Each row is the previous one shifted by 3. In particular, r3=2r2r1\mathbf{r}_3 = 2 \mathbf{r}_2 - \mathbf{r}_1

One row is a linear combination of the others, so they span only a 2D subspace of R3\mathbb{R}^3.

Rank and properties

  • rank(A)=n\operatorname{rank}(A) = n (full column rank) ⟺ columns are linearly independent ⟺ Ax=0A \mathbf{x} = \mathbf{0} has only the trivial solution.
  • rank(A)=m\operatorname{rank}(A) = m (full row rank) ⟺ Ax=bA \mathbf{x} = \mathbf{b} is consistent for every b\mathbf{b}.
  • For a square n×nn \times n matrix: rank(A)=n\operatorname{rank}(A) = nAA is invertible ⟺ detA0\det A \ne 0.

How rank changes under operations

  • Elementary row operations preserve rank.
  • Transpose: rank(AT)=rank(A)\operatorname{rank}(A^T) = \operatorname{rank}(A) — the row rank equals the column rank.
  • Multiplication by invertible: rank(PA)=rank(AP)=rank(A)\operatorname{rank}(PA) = \operatorname{rank}(AP) = \operatorname{rank}(A) if PP is invertible.
  • Sub-additivity: rank(A+B)rank(A)+rank(B)\operatorname{rank}(A + B) \le \operatorname{rank}(A) + \operatorname{rank}(B).
  • Multiplicativity: rank(AB)min(rank(A),rank(B))\operatorname{rank}(AB) \le \min(\operatorname{rank}(A), \operatorname{rank}(B)).

Common mistakes

  • Counting rows instead of pivots. Zero rows in the reduced form contribute no pivot and no rank.
  • Confusing rank with the number of non-zero entries. A matrix can be dense but have low rank (like AA above).
  • Not being careful with identifying pivot columns vs. pivot rows. Pivots are at specific (row, column) positions, and the column index determines which column is a pivot column.

Try it in the visualization

Type entries into a 3×33 \times 3 matrix. As you row-reduce, pivots light up; rank updates live; a small 3D plot shows the column span — flat plane if rank 2, full space if rank 3, line if rank 1.

Interactive Visualization

Parameters

[[1,2,3],[4,5,6],[7,8,9]] rank 2
3.00
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day