Quiz 2

Null Space & Column Space of a Matrix

2148 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

# Null Space & Column Space of a Matrix ## 🎯 Learning Objectives After this topic you will be able to: - Find a basis for the null space of a matrix - Find a basis for the column space of a matrix - Relate nullity and rank to the geometry of $A\mathbf{x} = \mathbf{b}$ - Understand the relationship between the four...

Null Space & Column Space of a Matrix

🎯 Learning Objectives

After this topic you will be able to:
  • Find a basis for the null space of a matrix
  • Find a basis for the column space of a matrix
  • Relate nullity and rank to the geometry of Ax=bA\mathbf{x} = \mathbf{b}
  • Understand the relationship between the four fundamental subspaces
  • Determine whether a given vector is in the null space or column space

📋 Prerequisites

  • Rank & Dimension (Week 4) — rank, nullity, rank-nullity theorem
  • Gaussian Elimination (Week 2) — solving homogeneous systems
  • Subspaces (Week 3) — definition of subspaces

1. The Four Fundamental Subspaces

Every m×nm \times n matrix AA defines four subspaces:
SubspaceNotationDefinitionLives in
Null spaceN(A)N(A){xRnAx=0}\{\mathbf{x} \in \mathbb{R}^n \mid A\mathbf{x} = \mathbf{0}\}Rn\mathbb{R}^n
Column spaceC(A)C(A){AxRmxRn}\{A\mathbf{x} \in \mathbb{R}^m \mid \mathbf{x} \in \mathbb{R}^n\}Rm\mathbb{R}^m
Row spaceR(A)R(A)Span of rows of AARn\mathbb{R}^n
Left null spaceN(AT)N(A^T){yRmATy=0}\{\mathbf{y} \in \mathbb{R}^m \mid A^T\mathbf{y} = \mathbf{0}\}Rm\mathbb{R}^m
(Diagram)

2. Null Space (Kernel)

2.1 Definition and Geometry

Definition (Null Space). The null space of an m×nm \times n matrix AA is:
>N(A)={xRnAx=0}>> N(A) = \{\mathbf{x} \in \mathbb{R}^n \mid A\mathbf{x} = \mathbf{0}\} >
The null space contains all vectors that AA annihilates (maps to zero). It is always a subspace of Rn\mathbb{R}^n. Geometric intuition: If AA projects R3\mathbb{R}^3 onto the xyxy-plane, the zz-axis becomes the null space — every vector (0,0,z)(0,0,z) maps to (0,0,0)(0,0,0).

2.2 Finding a Basis for the Null Space

Algorithm:
  1. Row reduce AA to RREF
  2. Identify pivot columns (basic variables) and non-pivot columns (free variables)
  3. Express basic variables in terms of free variables
  4. Write the solution as a linear combination of basis vectors, one per free variable
Example 1: Null space basis
>A=[120110012100000]>> A = \begin{bmatrix} 1 & 2 & 0 & 1 & -1 \\ 0 & 0 & 1 & 2 & 1 \\ 0 & 0 & 0 & 0 & 0 \end{bmatrix} >
(already in RREF)
Step 1: Identify pivots. Pivot columns: 1, 3. Free variables: x2,x4,x5x_2, x_4, x_5.
Step 2: Write equations:
>x1+2x2+x4x5=0x1=2x2x4+x5>> x_1 + 2x_2 + x_4 - x_5 = 0 \Rightarrow x_1 = -2x_2 - x_4 + x_5 >
>x3+2x4+x5=0x3=2x4x5>> x_3 + 2x_4 + x_5 = 0 \Rightarrow x_3 = -2x_4 - x_5 >
Step 3: Parametric form:
>[x1x2x3x4x5]=x2[21000]+x4[10210]+x5[10101]>> \begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \\ x_5 \end{bmatrix} = x_2\begin{bmatrix} -2 \\ 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} + x_4\begin{bmatrix} -1 \\ 0 \\ -2 \\ 1 \\ 0 \end{bmatrix} + x_5\begin{bmatrix} 1 \\ 0 \\ -1 \\ 0 \\ 1 \end{bmatrix} >
Basis for N(A)N(A): {(2,1,0,0,0),(1,0,2,1,0),(1,0,1,0,1)}\{(-2,1,0,0,0), (-1,0,-2,1,0), (1,0,-1,0,1)\}.
nullity(A)=3\text{nullity}(A) = 3.

2.3 Checking Membership

To check if xN(A)\mathbf{x} \in N(A): compute AxA\mathbf{x}. If Ax=0A\mathbf{x} = \mathbf{0}, then x\mathbf{x} is in the null space.
Example 2: Membership test
Is (2,1,0,0,0)(2,-1,0,0,0) in N(A)N(A) from Example 1?
>Ax=[1(2)+2(1)+0+0+00+0+0+0+00]=[000]>> A\mathbf{x} = \begin{bmatrix} 1(2) + 2(-1) + 0 + 0 + 0 \\ 0 + 0 + 0 + 0 + 0 \\ 0 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} >
Yes, it's in N(A)N(A). Indeed, it's 12-\frac{1}{2} times the first basis vector.

3. Column Space (Range)

3.1 Definition

Definition (Column Space). The column space of AA is:
>C(A)={yRmy=Ax for some xRn}>> C(A) = \{\mathbf{y} \in \mathbb{R}^m \mid \mathbf{y} = A\mathbf{x} \text{ for some } \mathbf{x} \in \mathbb{R}^n\} >
Equivalently, C(A)=span{columns of A}C(A) = \text{span}\{\text{columns of } A\}. The column space captures all possible outputs of AA.

3.2 Finding a Basis for the Column Space

Algorithm:
  1. Row reduce AA to RREF
  2. Identify pivot columns
  3. The original columns of AA at the pivot positions form a basis for C(A)C(A)
Example 3: Column space basis
>A=[120124131210]>> A = \begin{bmatrix} 1 & 2 & 0 & 1 \\ 2 & 4 & 1 & 3 \\ 1 & 2 & -1 & 0 \end{bmatrix} >
Row reduce:
>R22R1,R3R1[120100110011]R3+R2[120100110000]>> \xrightarrow{R_2-2R_1, R_3-R_1} \begin{bmatrix} 1 & 2 & 0 & 1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & -1 & -1 \end{bmatrix} \xrightarrow{R_3+R_2} \begin{bmatrix} 1 & 2 & 0 & 1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 \end{bmatrix} >
Pivot columns: 1 and 3.
Basis for C(A)C(A):
>{[121],[011]}>> \left\{\begin{bmatrix}1\\2\\1\end{bmatrix}, \begin{bmatrix}0\\1\\-1\end{bmatrix}\right\} >
.
rank(A)=2\text{rank}(A) = 2.

3.3 Checking Membership

To check if bC(A)\mathbf{b} \in C(A): solve Ax=bA\mathbf{x} = \mathbf{b}. If a solution exists, b\mathbf{b} is in the column space.
Example 4: Column space membership
Is b=(3,5,1)\mathbf{b} = (3,5,1) in C(A)C(A) from Example 3?
Solve Ax=bA\mathbf{x} = \mathbf{b}:
>[120132413512101]>> \left[\begin{array}{cccc|c} 1 & 2 & 0 & 1 & 3 \\ 2 & 4 & 1 & 3 & 5 \\ 1 & 2 & -1 & 0 & 1 \end{array}\right] >
After row reduction, check consistency. If consistent, bC(A)\mathbf{b} \in C(A).

4. Column Space vs. Row Space

AspectColumn Space C(A)C(A)Row Space R(A)R(A)
Subspace ofRm\mathbb{R}^mRn\mathbb{R}^n
Basis fromPivot columns of original AANon-zero rows of RREF
Dimensionrank(A)\text{rank}(A)rank(A)\text{rank}(A)
Related toOutputs of AALinear relations among columns
Example 5: Row space basis
Using AA from Example 3, RREF is
>[120100110000]>> \begin{bmatrix} 1 & 2 & 0 & 1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 \end{bmatrix} >
.
Basis for R(A)R(A): {(1,2,0,1),(0,0,1,1)}\{(1,2,0,1), (0,0,1,1)\}.

5. The Fundamental Theorem of Linear Algebra

Theorem (Fundamental Theorem of Linear Algebra, Part I). For an m×nm \times n matrix AA:
  • N(A)N(A) and R(A)R(A) are orthogonal complements in Rn\mathbb{R}^n
  • N(AT)N(A^T) and C(A)C(A) are orthogonal complements in Rm\mathbb{R}^m
  • dim(N(A))+dim(R(A))=n\dim(N(A)) + \dim(R(A)) = n
  • dim(N(AT))+dim(C(A))=m\dim(N(A^T)) + \dim(C(A)) = m Orthogonal complements means every vector in one subspace is orthogonal to every vector in the other, and together they span the whole space.

6. Edge Cases & Gotchas

SituationWhat Happens
**Zero matrix 0m×n0_{m \times n} **N(A)=RnN(A) = \mathbb{R}^n (whole domain), C(A)={0}C(A) = \{\mathbf{0}\}
**Identity InI_n **N(A)={0}N(A) = \{\mathbf{0}\} , C(A)=RnC(A) = \mathbb{R}^n
Square invertibleN(A)={0}N(A) = \{\mathbf{0}\} , C(A)=RnC(A) = \mathbb{R}^n
One rowN(A)N(A) is (n1)(n-1) -dimensional; C(A)C(A) is a line

7. Common Pitfalls

❌ Pitfall 1: Thinking N(A)N(A) and C(A)C(A) live in the same space

N(A)RnN(A) \subseteq \mathbb{R}^n (domain), C(A)RmC(A) \subseteq \mathbb{R}^m (codomain). For mnm \neq n, they are different spaces entirely.

❌ Pitfall 2: Using RREF columns for column space basis

The column space basis must use original columns from AA, not the RREF columns. The RREF columns are linear combinations of original columns and may live in a different coordinate system.

❌ Pitfall 3: Forgetting to check 0\mathbf{0} for null space membership

0\mathbf{0} is always in N(A)N(A). The question is whether there are non-zero vectors as well.

8. Formula Summary Table

ConceptBasisDimension
**Null space N(A)N(A) **Parametric solution vectors of Ax=0A\mathbf{x}=\mathbf{0}nullity(A)=nr\text{nullity}(A) = n - r
**Column space C(A)C(A) **Original pivot columns of AArank(A)=r\text{rank}(A) = r
**Row space R(A)R(A) **Non-zero rows of RREFrank(A)=r\text{rank}(A) = r
**Left null space N(AT)N(A^T) **Solve ATy=0A^T\mathbf{y} = \mathbf{0}mrm - r

9. 📝 Practice Questions

Q1: Null space of a 2×2 matrix
Find a basis for N(A)N(A) where
>A=[1224]>> A = \begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix} >
.
Solution: Solve Ax=0A\mathbf{x} = \mathbf{0}: x+2y=0x + 2y = 0, 2x+4y=02x + 4y = 0x=2yx = -2y, yy free. N(A)=span{(2,1)}N(A) = \text{span}\{(-2,1)\}. Dimension = 1. Q2: Column space of a 2×2 matrix
Find a basis for C(A)C(A) where
>A=[1224]>> A = \begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix} >
.
Solution: Columns are (1,2)(1,2) and (2,4)(2,4). Column 2 = 2(column 1), so they are dependent. C(A)=span{(1,2)}C(A) = \text{span}\{(1,2)\}. Dimension = 1. Q3: Three independent columns
Find a basis for C(A)C(A) where
>A=[101210123]>> A = \begin{bmatrix} 1 & 0 & -1 \\ 2 & 1 & 0 \\ 1 & 2 & 3 \end{bmatrix} >
.
Solution: Row reduce:
>[101210123]R22R1,R3R1[101012024]R32R2[101012000]>> \begin{bmatrix} 1 & 0 & -1 \\ 2 & 1 & 0 \\ 1 & 2 & 3 \end{bmatrix} \xrightarrow{R_2-2R_1, R_3-R_1} \begin{bmatrix} 1 & 0 & -1 \\ 0 & 1 & 2 \\ 0 & 2 & 4 \end{bmatrix} \xrightarrow{R_3-2R_2} \begin{bmatrix} 1 & 0 & -1 \\ 0 & 1 & 2 \\ 0 & 0 & 0 \end{bmatrix} >
Pivot columns: 1 and 2. Basis for C(A)C(A): columns 1 and 2 of original AA: {(1,2,1),(0,1,2)}\{(1,2,1), (0,1,2)\}. Q4: Complete solution to Ax = b
Find the complete solution to Ax=bA\mathbf{x} = \mathbf{b} where
>A=[1224]>> A = \begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix} >
,
>b=[36]>> \mathbf{b} = \begin{bmatrix} 3 \\ 6 \end{bmatrix} >
.
Solution: Particular solution: Solve x+2y=3x + 2y = 3. Set y=0y = 0, then x=3x = 3. xp=(3,0)\mathbf{x}_p = (3,0).
Homogeneous solution: N(A)=span{(2,1)}N(A) = \text{span}\{(-2,1)\}.
Complete solution:
>x=[30]+t[21]>> \mathbf{x} = \begin{bmatrix} 3 \\ 0 \end{bmatrix} + t\begin{bmatrix} -2 \\ 1 \end{bmatrix} >
, tRt \in \mathbb{R}. Q5: Column space membership test
Is b=(1,2,3)\mathbf{b} = (1, 2, 3) in C(A)C(A) for
>A=[100111]>> A = \begin{bmatrix} 1 & 0 \\ 0 & 1 \\ 1 & 1 \end{bmatrix} >
?
Solution: Solve Ax=bA\mathbf{x} = \mathbf{b}:
>{x=1y=2x+y=31+2=3 ✓>> \begin{cases} x = 1 \\ y = 2 \\ x + y = 3 \end{cases} \Rightarrow 1 + 2 = 3 \text{ ✓} >
Yes, bC(A)\mathbf{b} \in C(A) with x=(1,2)\mathbf{x} = (1,2). Q6: Null space of a 3×3 singular matrix
Find N(A)N(A) for
>A=[111011000]>> A = \begin{bmatrix} 1 & 1 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \end{bmatrix} >
.
Solution: Solve Ax=0A\mathbf{x} = \mathbf{0}: x+y+z=0x + y + z = 0, y+z=0y + z = 0y=zy = -z, x=yz=zz=0x = -y - z = z - z = 0. So x=0x = 0, y=zy = -z, zz free.
N(A)=span{(0,1,1)}N(A) = \text{span}\{(0,-1,1)\}. Nullity = 1. Q7: Finding left null space
Find a basis for N(AT)N(A^T) where
>A=[1224]>> A = \begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix} >
.
Solution:
>AT=[1224]>> A^T = \begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix} >
(same here). Solve ATy=0A^T\mathbf{y} = \mathbf{0}: y1+2y2=0y_1 + 2y_2 = 0, 2y1+4y2=02y_1 + 4y_2 = 0y1=2y2y_1 = -2y_2, y2y_2 free.
N(AT)=span{(2,1)}N(A^T) = \text{span}\{(-2,1)\}. Dimension = mr=21=1m - r = 2 - 1 = 1. Q8: Rank from nullity
If AA is 7×57 \times 5 with nullity 3, what is the rank?
Solution: rank(A)=53=2\text{rank}(A) = 5 - 3 = 2. Q9: When does N(A) = {0}?
For what type of matrix does N(A)={0}N(A) = \{\mathbf{0}\}?
Solution: When AA has full column rank, i.e., rank(A)=n\text{rank}(A) = n (number of columns). Then nullity = nn=0n - n = 0. Q10: Four subspaces dimensions
For A4×6A_{4 \times 6} with rank 2, give dimensions of all four fundamental subspaces.
Solution:
  • dim(N(A))=62=4\dim(N(A)) = 6 - 2 = 4
  • dim(C(A))=2\dim(C(A)) = 2
  • dim(R(A))=2\dim(R(A)) = 2
  • dim(N(AT))=42=2\dim(N(A^T)) = 4 - 2 = 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.