Quiz 2

Rank, Dimension & the Rank-Nullity Theorem

2283 words
11 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# Rank, Dimension & the Rank-Nullity Theorem ## 🎯 Learning Objectives After this topic you will be able to: - Compute the rank of a matrix using Gaussian elimination - Find the nullity of a matrix - State and apply the rank-nullity theorem - Relate rank to the dimension of the column space - Use rank to determine p...

Rank, Dimension & the Rank-Nullity Theorem

🎯 Learning Objectives

After this topic you will be able to:
  • Compute the rank of a matrix using Gaussian elimination
  • Find the nullity of a matrix
  • State and apply the rank-nullity theorem
  • Relate rank to the dimension of the column space
  • Use rank to determine properties of linear systems

📋 Prerequisites

  • Gaussian Elimination (Week 2) — finding pivots and RREF
  • Basis & Dimension (this week) — dimension of a vector space
  • Subspaces (Week 3) — null space and column space

1. Intuition: Counting Independent Directions

The rank of a matrix answers the question: how many independent directions does this matrix capture? If you have a 3×53 \times 5 matrix, its columns live in R3\mathbb{R}^3. The rank tells you whether the columns span:
  • A line (rank 1)
  • A plane (rank 2)
  • All of R3\mathbb{R}^3 (rank 3) The nullity tells you the opposite: how many directions in the domain get crushed to zero. (Diagram) The rank-nullity theorem says: rank(A)+nullity(A)=number of columns\text{rank}(A) + \text{nullity}(A) = \text{number of columns}. It's a conservation law: every column either contributes to the output (rank) or gets crushed (nullity).

2. Rank of a Matrix

2.1 Definition

Definition (Rank). The rank of a matrix AA is:
  • The number of non-zero rows in its RREF
  • Equivalently, the number of pivot columns
  • Equivalently, the dimension of the column space C(A)C(A)
  • Equivalently, the dimension of the row space
rank(A)=dim(C(A))=dim(R(A))=#pivots\text{rank}(A) = \dim(C(A)) = \dim(R(A)) = \#\text{pivots}

2.2 Computing Rank

The simplest way: row reduce and count pivots.
Example 1: Computing rank
>A=[1231247336104]>> A = \begin{bmatrix} 1 & 2 & 3 & 1 \\ 2 & 4 & 7 & 3 \\ 3 & 6 & 10 & 4 \end{bmatrix} >
Row reduce:
>[1231247336104]R22R1,R33R1[123100110011]R3R2[123100110000]>> \begin{bmatrix} 1 & 2 & 3 & 1 \\ 2 & 4 & 7 & 3 \\ 3 & 6 & 10 & 4 \end{bmatrix} \xrightarrow{R_2 - 2R_1, R_3 - 3R_1} \begin{bmatrix} 1 & 2 & 3 & 1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & 1 \end{bmatrix} \xrightarrow{R_3 - R_2} \begin{bmatrix} 1 & 2 & 3 & 1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 \end{bmatrix} >
Two non-zero rows: rank(A)=2\text{rank}(A) = 2.

2.3 Properties of Rank

PropertyExplanation
0rank(A)min(m,n)0 \leq \text{rank}(A) \leq \min(m, n)Cannot exceed number of rows or columns
rank(AT)=rank(A)\text{rank}(A^T) = \text{rank}(A)Row space = column space of transpose
rank(AB)min(rank(A),rank(B))\text{rank}(AB) \leq \min(\text{rank}(A), \text{rank}(B))Composition can't increase rank
rank(A+B)rank(A)+rank(B)\text{rank}(A+B) \leq \text{rank}(A) + \text{rank}(B)Subadditivity
rank(A)=n\text{rank}(A) = n for An×nA_{n \times n} invertibleFull rank means invertible

3. Nullity

3.1 Definition

Definition (Nullity). The nullity of a matrix AA is the dimension of the null space N(A)N(A):
>nullity(A)=dim(N(A))>> \text{nullity}(A) = \dim(N(A)) >
Nullity = number of free variables in the solution of Ax=0A\mathbf{x} = \mathbf{0}. Nullity = number of columns without a pivot.
Example 2: Computing nullity
For
>A=[123100110000]>> A = \begin{bmatrix} 1 & 2 & 3 & 1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 \end{bmatrix} >
(RREF from Example 1):
Pivots in columns 1 and 3. Free variables: columns 2 and 4. nullity(A)=2\text{nullity}(A) = 2.
Check: AA has 4 columns. Rank = 2. 2+2=42 + 2 = 4 ✓ (rank-nullity).

4. The Rank-Nullity Theorem

Theorem (Rank-Nullity). For an m×nm \times n matrix AA:
>rank(A)+nullity(A)=n>> \text{rank}(A) + \text{nullity}(A) = n >
where nn is the number of columns of AA. Proof Sketch
Row reduce AA to RREF. Let r=rank(A)r = \text{rank}(A) = number of pivot columns. Then there are nrn - r non-pivot columns, each corresponding to a free variable. The null space has dimension nrn - r (each free variable contributes one basis vector). So nullity(A)=nr=nrank(A)\text{nullity}(A) = n - r = n - \text{rank}(A). Rearranging gives rank(A)+nullity(A)=n\text{rank}(A) + \text{nullity}(A) = n. Example 3: Applying rank-nullity
AA is 5×75 \times 7 with rank 3. Find nullity.
nullity(A)=73=4\text{nullity}(A) = 7 - 3 = 4.
The null space is a 4-dimensional subspace of R7\mathbb{R}^7.

4.1 Consequences

SituationWhat rank-nullity tells us
Square n×nn \times n , invertiblerank=n\text{rank} = n , nullity=0\text{nullity} = 0 — unique solution to Ax=bA\mathbf{x}=\mathbf{b}
Square n×nn \times n , singularrank0\text{rank} 0 — either 0 or ∞ solutions
More columns than rows ( m<nm < n )nullitynm>0\text{nullity} \geq n - m > 0 — always non-trivial null space
More rows than columns ( m>nm > n )rankn\text{rank} \leq n , nullity could be 0

5. Finding Bases for Row Space, Column Space, Null Space

5.1 Row Space Basis

Row reduce to RREF. The non-zero rows of the RREF form a basis for the row space.
Example 4: Row space basis
>A=[121243120]RREF[120001000]>> A = \begin{bmatrix} 1 & 2 & 1 \\ 2 & 4 & 3 \\ 1 & 2 & 0 \end{bmatrix} \xrightarrow{\text{RREF}} \begin{bmatrix} 1 & 2 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix} >
Basis for row space: {(1,2,0),(0,0,1)}\{(1,2,0), (0,0,1)\}.

5.2 Column Space Basis

The original columns corresponding to pivot columns form a basis for the column space.
Example 5: Column space basis
Same AA as above. Pivot columns are 1 and 3. Original columns: {(1,2,1),(1,3,0)}\{(1,2,1), (1,3,0)\} form a basis for C(A)C(A).

5.3 Null Space Basis

Solve Ax=0A\mathbf{x} = \mathbf{0}, express in parametric form. The vectors multiplying the free parameters form a basis.
Example 6: Null space basis
>A=[120000]>> A = \begin{bmatrix} 1 & 2 & 0 \\ 0 & 0 & 0 \end{bmatrix} >
Actually let's use a better example.
>A=[12100011]>> A = \begin{bmatrix} 1 & 2 & -1 & 0 \\ 0 & 0 & 1 & 1 \end{bmatrix} >
(RREF).
Pivots in columns 1 and 3. Free variables: x2x_2, x4x_4.
x1=2x2+x3=2x2(x4)=2x2+x4x_1 = -2x_2 + x_3 = -2x_2 - (-x_4) = -2x_2 + x_4? Wait, let's solve properly:
From RREF: x1+2x2x3=0x_1 + 2x_2 - x_3 = 0, x3+x4=0x_3 + x_4 = 0. From row 2: x3=x4x_3 = -x_4. From row 1: x1=2x2+x3=2x2x4x_1 = -2x_2 + x_3 = -2x_2 - x_4.
Free: x2,x4x_2, x_4.
>[x1x2x3x4]=x2[2100]+x4[1011]>> \begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \end{bmatrix} = x_2\begin{bmatrix} -2 \\ 1 \\ 0 \\ 0 \end{bmatrix} + x_4\begin{bmatrix} -1 \\ 0 \\ -1 \\ 1 \end{bmatrix} >
Basis for N(A)N(A): {(2,1,0,0),(1,0,1,1)}\{(-2,1,0,0), (-1,0,-1,1)\}. Nullity = 2.

6. Full Column Rank vs. Full Row Rank

TypeConditionProperties
Full column rankrank(A)=n\text{rank}(A) = n (number of columns)Columns are independent; N(A)={0}N(A) = \{\mathbf{0}\}
Full row rankrank(A)=m\text{rank}(A) = m (number of rows)Rows are independent; C(A)=RmC(A) = \mathbb{R}^m
Full rank (square)rank(A)=m=n\text{rank}(A) = m = nInvertible matrix
Example 7: Full column rank
>A=[100111]>> A = \begin{bmatrix} 1 & 0 \\ 0 & 1 \\ 1 & 1 \end{bmatrix} >
is 3×23 \times 2. Row reduce shows pivots in both columns. rank(A)=2=n\text{rank}(A) = 2 = n. Nullity = 22=02 - 2 = 0. N(A)={0}N(A) = \{\mathbf{0}\}.

7. Edge Cases & Gotchas

SituationWhat Happens
Zero matrixrank=0\text{rank} = 0 , nullity=n\text{nullity} = n
Identity matrixrank=n\text{rank} = n , nullity=0\text{nullity} = 0
** AA is m×nm \times n with m<nm < n **rankm0\text{rank} \leq m 0 (always has non-trivial null space)
Rank of a productrank(AB)min(rank(A),rank(B))\text{rank}(AB) \leq \min(\text{rank}(A), \text{rank}(B))

8. Common Pitfalls

❌ Pitfall 1: Confusing rank with number of rows

Rank is the dimension of the column space, not the number of rows. A 5×35 \times 3 matrix can have rank at most 3, not 5.

❌ Pitfall 2: Forgetting rank-nullity applies to columns

Students sometimes use number of rows instead of columns. rank(A)+nullity(A)=n\text{rank}(A) + \text{nullity}(A) = n (columns), not mm.

❌ Pitfall 3: Taking RREF rows as column space basis

The RREF rows are a basis for the row space, not the column space. For the column space, use original pivot columns.

9. Formula Summary Table

ConceptFormulaNotes
Rank#pivots=dim(C(A))\#\text{pivots} = \dim(C(A))0rankmin(m,n)0 \leq \text{rank} \leq \min(m,n)
Nullitydim(N(A))\dim(N(A))Number of free variables
Rank-Nullityrank(A)+nullity(A)=n\text{rank}(A) + \text{nullity}(A) = nnn = number of columns
Full column rankrank(A)=n\text{rank}(A) = nN(A)={0}N(A) = \{\mathbf{0}\}
Full row rankrank(A)=m\text{rank}(A) = mC(A)=RmC(A) = \mathbb{R}^m
Invertible (square)rank(A)=n\text{rank}(A) = nA1A^{-1} exists

10. 📝 Practice Questions

Q1: Find rank from RREF
>A=[110011001]>> A = \begin{bmatrix} 1 & 1 & 0 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \end{bmatrix} >
This is already in REF with 3 pivots. rank(A)=3\text{rank}(A) = 3. Q2: Rank and nullity
>A=[123424681234]>> A = \begin{bmatrix} 1 & 2 & 3 & 4 \\ 2 & 4 & 6 & 8 \\ 1 & 2 & 3 & 4 \end{bmatrix} >
Solution: Rows 1 and 3 are identical; row 2 is 2×2 \times row 1. RREF:
>[123400000000]>> \begin{bmatrix} 1 & 2 & 3 & 4 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \end{bmatrix} >
. Rank = 1, Nullity = 41=34 - 1 = 3. Q3: Rank-Nullity application
If AA is 3×53 \times 5 with rank 2, what are the dimensions of N(A)N(A) and C(A)C(A)?
Solution: dim(C(A))=rank(A)=2\dim(C(A)) = \text{rank}(A) = 2. nullity(A)=52=3\text{nullity}(A) = 5 - 2 = 3. N(A)N(A) is a 3-dim subspace of R5\mathbb{R}^5, C(A)C(A) is a 2-dim subspace of R3\mathbb{R}^3. Q4: Finding null space basis
Find a basis for N(A)N(A) where
>A=[11010012]>> A = \begin{bmatrix} 1 & 1 & 0 & 1 \\ 0 & 0 & 1 & 2 \end{bmatrix} >
.
Solution: Already in RREF. Pivots in columns 1, 3. Free: columns 2, 4.
Row 1: x1+x2+x4=0x1=x2x4x_1 + x_2 + x_4 = 0 \Rightarrow x_1 = -x_2 - x_4 Row 2: x3+2x4=0x3=2x4x_3 + 2x_4 = 0 \Rightarrow x_3 = -2x_4
>[x1x2x3x4]=x2[1100]+x4[1021]>> \begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \end{bmatrix} = x_2\begin{bmatrix} -1 \\ 1 \\ 0 \\ 0 \end{bmatrix} + x_4\begin{bmatrix} -1 \\ 0 \\ -2 \\ 1 \end{bmatrix} >
Basis: {(1,1,0,0),(1,0,2,1)}\{(-1,1,0,0), (-1,0,-2,1)\}. Q5: Full row rank
For what kk does
>A=[12243k]>> A = \begin{bmatrix} 1 & 2 \\ 2 & 4 \\ 3 & k \end{bmatrix} >
have full row rank?
Solution: Full row rank means rank(A)=3\text{rank}(A) = 3 (number of rows). But AA is 3×23 \times 2, so max rank is min(3,2)=2\min(3,2) = 2. It's impossible for a 3×23 \times 2 matrix to have rank 3.
The question should be: when does it have full column rank?
Row reduce:
>[12243k]R22R1,R33R1[12000k6]>> \begin{bmatrix} 1 & 2 \\ 2 & 4 \\ 3 & k \end{bmatrix} \xrightarrow{R_2-2R_1, R_3-3R_1} \begin{bmatrix} 1 & 2 \\ 0 & 0 \\ 0 & k-6 \end{bmatrix} >
If k6k \neq 6, there are 2 pivots ⇒ rank 2 (full column rank). If k=6k = 6, rank 1. Q6: Rank of a product
If AA is 3×43 \times 4 with rank 2 and BB is 4×24 \times 2 with rank 2, what can you say about rank(AB)\text{rank}(AB)?
Solution: rank(AB)min(rank(A),rank(B))=min(2,2)=2\text{rank}(AB) \leq \min(\text{rank}(A), \text{rank}(B)) = \min(2, 2) = 2.
Also, rank(AB)min(3,2)=2\text{rank}(AB) \leq \min(3, 2) = 2 (dimensions of ABAB are 3×23 \times 2).
So rank(AB)2\text{rank}(AB) \leq 2. It could be 0, 1, or 2. Q7: Rank from determinant
If AA is 4×44 \times 4 with det(A)=0\det(A) = 0, what is the maximum possible rank?
Solution: det(A)=0\det(A) = 0 means AA is singular, so rank(A)<4\text{rank}(A) < 4. The maximum possible rank is 3. Q8: Invertibility and rank
If AA is 5×55 \times 5 with rank(A)=5\text{rank}(A) = 5, what is nullity(A)\text{nullity}(A)? Is AA invertible?
Solution: nullity(A)=55=0\text{nullity}(A) = 5 - 5 = 0. Yes, AA is invertible (full rank square matrix). Q9: Row space dimension
If AA is 7×47 \times 4 with rank 3, what is the dimension of the row space?
Solution: dim(row space)=rank(A)=3\dim(\text{row space}) = \text{rank}(A) = 3. Q10: Rank of transpose
If AA is 5×35 \times 3 with rank 2, what is rank(AT)\text{rank}(A^T)?
Solution: rank(AT)=rank(A)=2\text{rank}(A^T) = \text{rank}(A) = 2.

🔗 Cross-References

Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.