MAT1041 · Week 9 · - Rank of a Matrix and Systems of Linear Equations
Rank, row/column/null space and linear systems
You learn to find bases for the row space, column space and null space of a matrix, rank and nullity, the rank-nullity theorem, and to decide the consistency of a system with rank and write its solution in the form 'particular solution + homogeneous solution'.
Three subspaces go with a matrix: the row space spanned by the rows, the column space spanned by the columns, and the null space made of the solutions of Ax=0. The relation among their dimensions (the rank-nullity theorem) is the most useful counting rule in linear algebra. And the good news: bases for all three come out of a single RREF computation. This week we also close the theory behind the “unique / infinite / none” decision of week 1.
Golden rules:
RREF first. All three subspaces are read off from it.
For the row space use the rows of the RREF, for the column space use the original columns.
Rank + nullity = number of columns.
Consistency: rank[A∣b]=rankA.
The three subspaces
Let A be m×n.
Subspace
Definition
Where it lives
Row space
the span of its rows
Rn
Column space
the span of its columns = {Ax}
Rm
Null space
{x:Ax=0}
Rn
The column space is all the values Ax can take, because Ax is a combination of the columns (week 2). So Ax=b is consistent if and only if b is in the column space.
Row space. Row operations replace rows by combinations of each other; the span stays the same. The nonzero rows of R are independent (the pivots are in different places):
basis of row(A): {(1,3,0,1),(0,0,1,1)}.
Column space. Row operations preserve the linear relations among the columns but change the columns themselves. In R, column 2 = 3 × column 1 and column 4 = column 1 + column 3; the same relations hold in A. The pivot columns are independent, and the rest are combinations of them:
basis of col(A): {(1,2,1),(1,3,0)}(columns 1 and 3 of A).
Null space.Rx=0: x1+3x2+x4=0, x3+x4=0. With x2=s, x4=t free:
x=s(−3,1,0,0)+t(−1,0,−1,1),basis of null(A): {(−3,1,0,0),(−1,0,−1,1)}.
PITFALL · writing the RREF columns as the column space basis. The pivot columns of R are (1,0,0) and (0,1,0); these are not even in the column space of A (the column space of A is the plane 3b1=b2+b3). For the column space, always use the original A.
Rank and nullity
rankA=dimrow(A)=dimcol(A)=number of pivots,nullityA=dimnull(A).
That the row space and the column space have equal dimension is surprising (one lives in Rn, the other in Rm), but both equal the number of pivots. Consequence: rankAT=rankA.
Rank-nullity theorem. If A is m×n then
rankA+nullityA=n.
Every column is either a pivot column (counted in the rank) or a free variable column (counted in the nullity). In the example 2+2=4.
A table for quick questions (A is m×n):
Information
Result
rankA≤min(m,n)
a 4×6 matrix has rank at most 4
Ax=0 only trivial
nullity 0, rank =n
rankA=m
a pivot in every row, consistent for every b
rankA=n
no free variable, a unique solution if consistent
n>m
nullity ≥n−m>0, the homogeneous system has a nontrivial solution
Rank and systems
For Ax=b:
Case
Result
rank[A∣b]>rankA
no solution
rank[A∣b]=rankA=n
unique solution
rank[A∣b]=rankA<n
infinitely many solutions, n−rankA parameters
This is the same as the decision table of week 1, just in the language of rank. A row [0⋯0∣c=0] means adding an extra pivot to the augmented matrix.
In the example, for b=(b1,b2,b3) the same operations leave b2+b3−3b1 on the right of the last row. For b=(3,7,2), 7+2−9=0: consistent. For b=(1,0,0), −3=0: inconsistent, rank[A∣b]=3.
General solution = particular solution + homogeneous solution
If xp is any (particular) solution of Ax=b, then all solutions are
x=xp+xh,xh∈null(A).
Why: the difference of two solutions satisfies A(x−xp)=b−b=0, so it is in the null space.
In the example with b=(3,7,2): the RREF of [A∣b] gives x1+3x2+x4=2, x3+x4=1. Take the free variables as 0: xp=(2,0,1,0). Check: Axp=(2+1,4+3,2+0)=(3,7,2). The general solution:
x=(2,0,1,0)+s(−3,1,0,0)+t(−1,0,−1,1).
Geometrically: the solution set is the null space shifted by xp. It is not a subspace (it does not contain zero), but it is a parallel copy.
The invertible matrix theorem (current)
For n×nA the following are equivalent:
A is invertible. 2. detA=0. 3. A∼In. 4. Ax=0 has only the trivial solution. 5. Ax=b has a unique solution for every b. 6. rankA=n. 7. nullityA=0. 8. The columns are independent. 9. The columns span Rn. 10. The rows are a basis of Rn.
On the exam, showing one item and writing another as the conclusion is a legitimate argument.
Common mistakes
Wrong
Right
Using the number of rows in rank-nullity
n = the number of columns
Writing the RREF columns as the column space
The original pivot columns
Blindly writing the original rows as the row space
They may be dependent; the nonzero rows of the RREF are safe
Thinking the rank is the number of nonzero entries
The number of pivots
If det=0 then rank =0
Rank <n; it can be 1 or 2
Forgetting the particular solution in the general solution
xp+xh
Looking for the null space in Rm
In Rn (where x lives)
Test yourself
Exam-style questions. Solve them on paper first, then reveal the answer.
Question 1easy
Find the rank of [1224].
Show answer
1
R2←R2−2R1 gives a zero row. One pivot: rank 1. By columns: column 2 = 2 × column 1, the number of independent columns is 1.
Question 2easy
A is a 5×7 matrix with rank 3. What is the nullity of A?
Show answer
4
Rank-nullity: rankA+nullityA=n = the number of columns=7.nullity=7−3=4. The number of rows (5) does not appear in this formula.
Question 3medium
Find the rank of A=12−1−1−21251013.
Show answer
2
R2←R2−2R1: (0,0,1,1). R3←R3+R1: (0,0,3,3). R3←R3−3R2: a zero row. Two pivots (columns 1 and 3): rank 2.
Question 4medium
For the matrix A of the previous question, find a basis for the row space of A.
Show answer
{(1,−1,0,−2),(0,0,1,1)}
Row operations do not change the row space. The nonzero rows of the RREF form a basis. With R1←R1−2R2 the RREF is: (1,−1,0,−2) and (0,0,1,1). (The REF rows (1,−1,2,0), (0,0,1,1) are also a correct answer.)
Question 5medium
For the same A, find a basis for the column space of A.
Show answer
{(1,2,−1),(2,5,1)}
The pivots are in columns 1 and 3. A basis of the column space: the original 1st and 3rd columns of A. Writing the columns of the RREF is wrong: row operations change the column space.
Question 6medium
For the same A, find a basis for the null space and the nullity.
Show answer
Basis {(1,1,0,0),(2,0,−1,1)}, nullity 2
RREF: x1−x2−2x4=0, x3+x4=0. x2=s, x4=t are free.x=(s+2t,s,−t,t)=s(1,1,0,0)+t(2,0,−1,1). Check: 2+2=4 the number of columns (rank + nullity).
Question 7medium
For the same A, is b=(1,3,4) in the column space of A?
Show answer
No
The same operations on [A∣b]: R2−2R1: (0,0,1,1∣1); R3+R1: (0,0,3,3∣5); R3−3R2: (0,0,0,0∣2). Inconsistent, that is, rank[A∣b]=3>rankA=2. b is not in the column space. (If b=(1,3,2) the last row would have been 0=0.)
Question 8hard
For which values of k does A=1212k136k have rank 2?
Show answer
k=3 or k=4
detA=1(k2−6)−2(2k−6)+3(2−k)=k2−7k+12=(k−3)(k−4). If det=0 the rank is 3. When k=3 or 4, det=0, rank <3. Rows 1 and 3, (1,2,3) and (1,1,k), are not proportional for any k, so rank ≥2. Conclusion: the rank is exactly 2.
Question 9hard
Write the general solution of x1+x2+2x3=3, 2x1+3x2+5x3=8 in the form x=xp+xh.
Show answer
x=(1,2,0)+t(−1,−1,1)
R2←R2−2R1: (0,1,1∣2). R1←R1−R2: (1,0,1∣1).x3=t: x1=1−t, x2=2−t. The particular solution (t=0) is (1,2,0); the homogeneous part t(−1,−1,1) is the null space of A.
Question 10easy
True or false: A 4×6 matrix can have rank 5.
Show answer
False
Rank = number of pivots; there is at most one pivot per row, and there are 4 rows. rankA≤min(m,n)=4.
Question 11hard
A is 6×4 and Ax=0 has only the trivial solution. Find rankA. Is Ax=b consistent for every b∈R6?
Show answer
rankA=4; no
Only the trivial solution ⇒ nullity 0 ⇒ rank =4−0=4. The column space is a 4-dimensional subspace of R6, not all of R6. For some b it is inconsistent. But when it is consistent the solution is unique (no free variable).
Question 12medium
If A is 3×5 with rankA=3, what are rankAT and the dimension of the null space of AT?
Show answer
3 and 0
rankAT=rankA=3 (the row space and the column space have equal dimension).AT is 5×3: nullity =3−3=0.
Verification: The RREF, rank, pivot columns and null space bases were computed exactly in node with BigInt fractions; the consistency conditions were checked by trying exact solutions with many b vectors, the particular solutions by the product A·x = b, and the parametric rank question at many values of k (verify/MAT1041/09.mjs).
Review card
Row space row(A) ⊆ Rⁿ: the nonzero ROWS of the RREF are a basis (row operations do not change it).
Column space col(A) ⊆ Rᵐ: the ORIGINAL form of the PIVOT COLUMNS is a basis.
Null space null(A) ⊆ Rⁿ: solve Ax = 0, separate by the free variables.
rank A = number of pivots = dim row = dim col. rank A^T = rank A.
nullity A = dim null(A) = number of free variables.
RANK-NULLITY: rank A + nullity A = n (number of COLUMNS).
rank ≤ min(m, n).
Ax = b is consistent ⇔ b ∈ col(A) ⇔ rank[A|b] = rank A.
If consistent: x = x_p + x_h (a particular solution + any vector from the null space).
rank = n → unique solution; rank < n → infinitely many.
rank = m (a pivot in every row) → consistent for every b.
Square A invertible ⇔ rank = n ⇔ nullity = 0 ⇔ det ≠ 0 ⇔ rows/columns are a basis.