JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Rank: A Matrix's True Size

Rank counts the genuinely independent directions inside a matrix. The surprise: independent columns and independent rows always agree, and you can read the number straight off the pivots.

What rank measures

The rank of a matrix is the number of independent columns it has — equivalently, the dimension of its column space (the span of those columns). It tells you how many truly distinct directions the matrix can produce. A matrix can be huge yet have a small rank if its columns secretly repeat each other.

Count the pivots

You do not compute rank by guessing. Run elimination to reach row echelon form, then count the pivots — the leading non-zero entries, one per staircase step. The number of pivots is the rank. Each pivot column is an independent direction; each pivot-free column is built from the ones before it.

A = [[1, 2, 3],
     [2, 4, 8],
     [1, 2, 5]]

elimination ->
    [[1, 2, 3],
     [0, 0, 2],
     [0, 0, 0]]

pivots in columns 1 and 3 -> 2 pivots
rank(A) = 2
(column 2 = 2 * column 1, so it is wasted)
Two pivots survive elimination, so the rank is 2 even though A is 3x3.

Full rank and rank deficiency

For an m-by-n matrix the rank can be at most min(m, n). When it hits that maximum the matrix is full rank; below it the matrix is rank deficient, meaning some rows or columns are redundant. For a square matrix, full rank is exactly the condition for being invertible.