๐Ÿงฎ Linear Algebra Kingdom ยท Linear Algebra

Rank & the Shape of Solutions

Counting what a matrix really pins down: read the rank off a reduced form, work out the nullity from it, count free variables, compare the rank of a matrix with the rank of its augmented form to decide consistency, and say the largest rank a given shape allows.

In short

  • The rank is the number of pivots in the reduced form โ€” the count of genuinely independent rows, which is never the number of rows and never the number of columns.
  • rank + nullity = n, where n is the number of columns. The number of rows is a ceiling on the rank and plays no part in the arithmetic.
  • Compare rank(A) with rank([A | b]) first: a larger augmented rank means a row reading 0 = k and no solution at all. If they agree, compare the rank with the number of unknowns.
  • Elementary row operations are reversible, so they leave the rank untouched. Rank neither adds across a sum nor multiplies across a product, and a product can only lose rank.

Rank counts what is new

A matrix with five rows looks like five pieces of information. Often it is not. Two of those rows may say the same thing twice, and a third may be the first two added together. The rank is the honest count: how many of the rows are genuinely new.

To find it, reduce the matrix and count the pivots โ€” the leading 1s. Every non-zero row of a reduced matrix has exactly one, and a row of nothing but zeros has none at all, because it was a repeat of the rows above it.

R = [[1, 0, -2 | 3], [0, 1, 4 | 5], [0, 0, 0 | 0]]

Two pivots. The rank is 2, even though the matrix has three rows.

The number of rows is not the rank. That single sentence is the most common slip in this whole craft, and it is worth guarding deliberately: count the leading 1s, not the lines on the page. The number of columns is not the rank either โ€” a column with no pivot in it is exactly what a free unknown looks like.

Two ceilings sit over the rank, and they follow straight from what a pivot is. A pivot claims a row of its own and a column of its own, so an m by n matrix can never have more than m pivots and never more than n. The rank is at most the smaller of the two.

One more fact, surprising the first time and useful forever: the number of independent rows and the number of independent columns are always the same number. So the rank of a matrix and the rank of its transpose are equal, and it never matters which way round you count.

Rank and nullity share out the columns

Set every constant to zero and look at Ax = 0. Every column of A carries one unknown, so there are n unknowns in play, where n is the number of columns.

Reduce. Each pivot pins one unknown to a value. Whatever is left over is free โ€” it may take any value at all, and each value gives another solution. The count of free unknowns has its own name, the nullity, and the two counts share the columns out between them:

rank + nullity = n

That is the whole rule, and it is one of the few places in mathematics where a sentence about structure is also a sentence about arithmetic. Know any two of the three numbers and the third follows.

The number of rows is nowhere in that rule. It is a ceiling on the rank and nothing more. A system of ten equations in three unknowns still has only three columns to share out, and its nullity is 3 minus its rank, never 10 minus its rank. Slipping the row count into this rule is the second signature mistake of the craft.

A nullity of 0 is a perfectly ordinary answer, not a sign of an error: it says the rank has reached the number of columns, every unknown sits in a pivot column, and Ax = 0 has nothing but the zero solution. What a nullity can never be is negative, because the rank can never pass the number of columns it has to fit into.

Two ranks decide everything about a system

For a system Ax = b there are two ranks worth knowing: the rank of the coefficient matrix A, and the rank of the whole augmented matrix [A | b]. Comparing them answers every question about the solutions, in two steps and in this order.

Step one: are the two ranks equal? The augmented matrix has one extra column, so its rank is either the same as rank(A) or one larger. If it is larger, that extra pivot can only be sitting in the column past the bar โ€” which is exactly a row reading 0 = k for some k that is not zero. The system is inconsistent and has no solution.

Notice what this means for counting. A row like [0, 0, 0 | 5] contributes a pivot to the augmented matrix and no pivot at all to the coefficient matrix. Counting it in both places is the third signature mistake here, and it makes an impossible system look like a solvable one.

Step two: if the ranks agree, compare that rank with n. Here n is the number of unknowns, which is the number of columns before the bar. The column past the bar is never an unknown and is never counted here.

  • rank(A) less than rank([A | b]): no solution
  • rank(A) = rank([A | b]) = n: exactly one solution
  • rank(A) = rank([A | b]) less than n: infinitely many solutions, one for every value of each of the n minus rank free unknowns

A homogeneous system, Ax = 0, can never take the first branch: x = 0 always solves it, so the two ranks always agree. The only question there is whether anything else solves it too, and the answer is yes exactly when the rank is below n.

What changes the rank, and what only looks as though it does

The three elementary row operations โ€” swapping two rows, multiplying a row by a number that is not zero, adding a multiple of one row to another โ€” never change the rank. There is one test behind all three: each can be undone by another operation of the same kind. Something reversible cannot lose information and cannot invent any, so the count of independent rows is exactly what it was.

That is why reducing a matrix is safe. The reduced form and the original have the same rank, so the rank you count at the end is the rank you started with.

Some steps are not reversible, and they behave differently. Replacing a row by a row of zeros throws that row away for good; if the rows were independent, the rank drops by exactly 1. Adding a row of zeros at the bottom, on the other hand, changes nothing: a zero row carries no pivot.

Products need their own care, and two claims that sound reasonable are simply not true.

  • rank(AB) is never larger than rank(A), and never larger than rank(B). A product can lose rank freely โ€” anything multiplied by a zero matrix has rank 0 โ€” but it can never gain any.
  • rank(A + B) is not rank(A) plus rank(B). Take any A of rank 2 and let B be its negative: both have rank 2, and A + B is all zeros, of rank 0. The sum of the ranks is a ceiling, not a value.

Multiplying by an invertible matrix is the exception that proves the rule: that is reversible, so it leaves the rank alone.

Worked examples

Example 1

Find the rank of R = [[1, 3, 0, -2], [0, 0, 1, 5], [0, 0, 0, 0]], which is already reduced.

  1. Work down the rows and mark the first entry in each that is not zero.
  2. Row 1 has a leading 1 in column 1. Row 2 has a leading 1 in column 3.
  3. Row 3 is nothing but zeros, so it carries no pivot and adds nothing.
  4. That is 2 pivots, so the rank is 2 โ€” not 3, which is only the number of rows.

Example 2

A is a 4 by 6 matrix of rank 3. What is the nullity of A, and how many free unknowns does Ax = 0 have?

  1. The rule is rank + nullity = n, where n is the number of COLUMNS.
  2. A has 6 columns, so n = 6, and the 4 rows do not enter the arithmetic.
  3. Nullity = 6 - 3 = 3.
  4. The nullity is exactly the count of free unknowns, so Ax = 0 has 3 of them.

Example 3

A system in 4 unknowns has rank(A) = 3 and rank([A | b]) = 3. How many solutions does it have?

  1. Step one: compare the two ranks. They are equal, so no row reads 0 = k and the system is consistent.
  2. Step two: compare the rank with the number of unknowns. The rank is 3 and there are 4 unknowns.
  3. That leaves 4 - 3 = 1 free unknown, which may take any value at all.
  4. Each value gives another solution, so the system has infinitely many solutions.

Practice problems, with solutions

Three problems of increasing difficulty, each with the full working. In the game these are generated fresh every time; these three are fixed so this page always shows the same ones.

Problem 1

Difficulty 1 of 5

Row reduction has already been run on this 2 by 2 matrix. R = [[1, 0], [0, 1]] What is its rank?

Answer: 2

  1. R = [[1, 0], [0, 1]].
  2. The leading 1s sit in the columns numbered 1, 2.
  3. Every row carries a leading 1.
  4. That is 2 pivots, so the rank is 2.

Problem 2

Difficulty 3 of 5

A = [[0, 1, 0, 0], [0, 0, 0, 1], [0, 2, 0, 1]] This 3 by 4 matrix has not been reduced yet. What is its nullity?

Answer: 2

  1. A = [[0, 1, 0, 0], [0, 0, 0, 1], [0, 2, 0, 1]].
  2. Row reduction leaves 2 pivots, so the rank is 2.
  3. A has 4 columns.
  4. Nullity = 4 - 2 = 2.

Problem 3

Difficulty 4 of 5

Here is the augmented matrix of a system in 3 unknowns: [[0, 1, 0 | 5], [0, -1, 1 | -9], [0, 1, 1 | 1], [0, -3, 1 | -19]] Compare the rank of the coefficient part with the rank of the whole augmented matrix. How many solutions does the system have?

  1. infinitely many solutions
  2. exactly two solutions
  3. exactly one solution
  4. no solution

Answer: A. infinitely many solutions

  1. The augmented matrix is [[0, 1, 0 | 5], [0, -1, 1 | -9], [0, 1, 1 | 1], [0, -3, 1 | -19]].
  2. Reducing it gives rank(A) = 2 and rank([A | b]) = 2.
  3. The ranks agree at 2, below the 3 unknowns, so 1 unknown is free.
  4. Answer: infinitely many solutions.

Common mistakes

  • Reading the rank as the number of rows. A row that reduces to zeros still takes up a line but carries no pivot, so it adds nothing to the rank.
  • Counting an inconsistent row like [0, 0, 0 | 5] as a pivot row of the coefficient matrix. It contributes a pivot to the augmented matrix only, which is exactly what makes the ranks disagree.
  • Using the number of rows in rank + nullity = n. The rule shares out the columns, because each column carries one unknown.
  • Counting the column past the bar among the unknowns when counting free unknowns, which gives an answer one too large every time.
  • Treating a nullity of 0 as an error. It simply says the rank has reached the number of columns and nothing is free to vary.

What you should be able to do

  • Find the rank of a matrix from its reduced row echelon form, and the number of free variables.
  • Use the rule nullity = n - rank to find one of the three from the other two.
  • Compare the rank of a coefficient matrix with the rank of the augmented matrix to decide consistency.
  • Give the largest possible rank of a matrix of a stated shape, and what row operations do to rank.

Where this fits in the curriculum

Common Core

  • HSN-VM.C.10

    High school โ€” Understand that the zero and identity matrices play a role in matrix addition and multiplication similar to the role of 0 and 1 in the real numbers; the determinant of a square matrix is nonzero if and only if the matrix has a multiplicative inverse.

    HSN-VM.C.10 is a (+) standard โ€” beyond the college- and career-ready threshold, i.e. precalculus rather than Algebra II. Rank, nullity and the count of free variables are named in no published framework. HSN-VM.C.10's determinant test is the same statement for the full-rank case of a square matrix, and the Common Core stops there.

  • HSA-REI.C.9

    High school โ€” Find the inverse of a matrix if it exists and use it to solve systems of linear equations (using technology for matrices of dimension 3 ร— 3 or greater).

    HSA-REI.C.9 is a (+) standard โ€” beyond the college- and career-ready threshold, i.e. precalculus rather than Algebra II. "If it exists" is where this craft lives: comparing the rank of a matrix with the rank of its augmented form is how that question is answered when the matrix is not square.

Learn these first

This leads on to