What the theorem says
The rank of a matrix A, rank A, is the number of pivots in a row echelon form of A. It is the same whichever
sequence of row operations you use. For an m×n matrix A, the rank–nullity theorem says
where n is the number of columns and N(A) is the null space, all solutions of Ax = 0. Each column either has
a pivot or belongs to a free variable, and dim N(A), the nullity, is the number of free variables. The card
above gives the third of the three when you know two; the rank of a matrix of your own, with a basis for its
null space, is in the matrix calculator.
Holds for every m×n matrix. The rank is also at most m, since each row holds at most one pivot.
Worked example
A has the rows (1, 2, 0, 1), (0, 1, 1, 0) and (1, 3, 1, 2). R₃ − R₁ gives (0, 1, 1, 1), and then R₃ − R₂ gives
(0, 0, 0, 1). The pivots are in columns 1, 2 and 4, so rank A = 3. A has n = 4 columns, and
dim N(A) = 4 − 3 = 1.
The free variable belongs to column 3. With x₃ = t the echelon form gives x₄ = 0, x₂ = −t and x₁ = 2t, so the
null space consists of the multiples of (2, −1, 1, 0). Check with the first row: 2 − 2 + 0 + 0 = 0.
The same matrix in the matrix calculator.
Columns, not rows
The n in the theorem is the number of columns, which is the number of unknowns. For a square matrix it makes
no difference; for any other it does. The matrix with the rows (1, 2, 3) and (2, 4, 6) has two rows and three
columns. The second row is twice the first, so R₂ − 2R₁ gives a zero row and the rank is 1.
|
Count |
dim N(A) |
| Right, with the columns |
3 − 1 |
2 |
| Wrong, with the rows |
2 − 1 |
1 |
The system x + 2y + 3z = 0, 2x + 4y + 6z = 0 is a plane through the origin, and a plane has two free
parameters.
A second example: full rank
A square n×n matrix with a non-zero determinant has a pivot in every column, so its rank is n and
dim N(A) = 0. Then Ax = 0 has only the solution x = 0, and Ax = b has exactly one solution for every b. That
is the case for the matrix with the rows (2, 1, −1), (−3, −1, 2) and (−2, 1, 2) on the page on
Gaussian elimination: its rank is 3 and its null
space is the zero vector alone.
Where to go next
The rank is found by Gaussian elimination. For a
square matrix, full rank is the same as a
determinant that is not 0.
| The system Ax = b, A with n columns |
Solutions |
| rank A = rank [A | b] = n |
Exactly one |
| rank A = rank [A | b] < n |
Infinitely many, with n − rank A free parameters |
| rank A < rank [A | b] |
None |
Common mistakes
- Rows instead of columns. n is the number of columns, the number of unknowns.
- Counting the non-zero rows of the original matrix. The rank is read off the echelon form; a row that is
a combination of others becomes a zero row only there.
- Expecting a rank above the number of rows. The rank is at most the smaller of m and n.
Frequently asked questions
Are the row rank and the column rank the same?
Yes. The number of linearly independent rows equals the number of linearly independent columns, and both
are the number of pivots. So A and its transpose have the same rank.
What does the rank say about a system of equations?
Compare the rank of A with the rank of the augmented matrix [A | b]. If they differ there is no solution.
If they agree there are solutions, with n − rank A free parameters.
Can the rank be 0?
Only for the zero matrix, the one matrix without a pivot. Then all n variables are free.