Quiz 2

Basis & Dimension of Vector Spaces

2391 words
12 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

# Basis & Dimension of Vector Spaces ## 🎯 Learning Objectives After this topic you will be able to: - Define a basis of a vector space - Prove that all bases of a finite-dimensional space have the same size (dimension) - Determine whether a given set is a basis for a vector space - Find a basis for a subspace given...

Basis & Dimension of Vector Spaces

🎯 Learning Objectives

After this topic you will be able to:
  • Define a basis of a vector space
  • Prove that all bases of a finite-dimensional space have the same size (dimension)
  • Determine whether a given set is a basis for a vector space
  • Find a basis for a subspace given in parametric or implicit form
  • Compute the dimension of common vector spaces
  • Use dimension to reason about subspaces

📋 Prerequisites

  • Linear Independence and Span (Week 3) — a basis is an independent spanning set
  • Gaussian Elimination (Week 2) — used to find bases computationally
  • A basis is the "minimal" set of vectors you need to describe the whole space

1. Intuition: The Skeleton of a Space

Imagine you're describing locations in a city. You could say:
  • "3 blocks east, 2 blocks north"
  • That's a coordinate relative to two reference directions (east, north). A basis is a set of reference directions that lets you describe every point in a vector space uniquely and efficiently. (Diagram) Key properties of a basis:
  1. Spanning: Every vector in the space can be written as a combination of basis vectors
  2. Independence: The representation is unique (no redundancy)

2. Definition of a Basis

Definition (Basis). A set B={b1,b2,,bn}B = \{\mathbf{b}_1, \mathbf{b}_2, \dots, \mathbf{b}_n\} of vectors in a vector space VV is a basis of VV if:
  1. BB is linearly independent
  2. BB spans VV (i.e., span(B)=V\text{span}(B) = V) Example 1: Standard basis of Rn\mathbb{R}^n
The standard basis of R3\mathbb{R}^3 is:
>e1=(1,0,0),e2=(0,1,0),e3=(0,0,1)>> \mathbf{e}_1 = (1,0,0), \quad \mathbf{e}_2 = (0,1,0), \quad \mathbf{e}_3 = (0,0,1) >
Independence: c1(1,0,0)+c2(0,1,0)+c3(0,0,1)=(c1,c2,c3)=(0,0,0)c1=c2=c3=0c_1(1,0,0) + c_2(0,1,0) + c_3(0,0,1) = (c_1, c_2, c_3) = (0,0,0) \Rightarrow c_1=c_2=c_3=0
Spanning: Any (x,y,z)=xe1+ye2+ze3(x,y,z) = x\mathbf{e}_1 + y\mathbf{e}_2 + z\mathbf{e}_3Example 2: A non-standard basis of R2\mathbb{R}^2
B={(1,2),(3,1)}B = \{(1,2), (3,-1)\}
Independence: Check c1(1,2)+c2(3,1)=(0,0)c_1(1,2) + c_2(3,-1) = (0,0):
>{c1+3c2=02c1c2=0c1=3c2,  2(3c2)c2=7c2=0c2=0c1=0>> \begin{cases} c_1 + 3c_2 = 0 \\ 2c_1 - c_2 = 0 \end{cases} \Rightarrow c_1 = -3c_2, \; 2(-3c_2) - c_2 = -7c_2 = 0 \Rightarrow c_2 = 0 \Rightarrow c_1 = 0 >
Independent ✓
Spanning: For any (x,y)(x,y), solve (x,y)=c1(1,2)+c2(3,1)(x,y) = c_1(1,2) + c_2(3,-1): c1=x+3y7c_1 = \frac{x+3y}{7}, c2=2xy7c_2 = \frac{2x-y}{7} — solution exists for all (x,y)(x,y)
So BB is a basis. Coordinates of (x,y)(x,y) in this basis are (x+3y7,2xy7)\left(\frac{x+3y}{7}, \frac{2x-y}{7}\right).

2.1 Uniqueness of Representation

Theorem. If B={b1,,bn}B = \{\mathbf{b}_1, \dots, \mathbf{b}_n\} is a basis of VV, then every vV\mathbf{v} \in V has a unique representation:
>v=c1b1+c2b2++cnbn>> \mathbf{v} = c_1\mathbf{b}_1 + c_2\mathbf{b}_2 + \cdots + c_n\mathbf{b}_n >
Proof: Since BB spans VV, a representation exists. Suppose two representations exist:
v=c1b1++cnbn=d1b1++dnbn\mathbf{v} = c_1\mathbf{b}_1 + \cdots + c_n\mathbf{b}_n = d_1\mathbf{b}_1 + \cdots + d_n\mathbf{b}_n
Subtracting: (c1d1)b1++(cndn)bn=0(c_1-d_1)\mathbf{b}_1 + \cdots + (c_n-d_n)\mathbf{b}_n = \mathbf{0}. Since BB is independent, all cidi=0c_i - d_i = 0, so ci=dic_i = d_i for all ii. The representation is unique. ∎ The scalars cic_i are called the coordinates of v\mathbf{v} relative to the basis BB, written [v]B[\mathbf{v}]_B.

3. Dimension

3.1 All Bases Have the Same Size

Theorem (Invariance of Dimension). If VV has a basis with nn vectors, then every basis of VV has exactly nn vectors. Proof Sketch
Let B1B_1 have nn vectors and B2B_2 have mm vectors, both bases of VV.
  • Since B1B_1 spans VV and B2B_2 is independent, the Exchange Theorem (Steinitz) gives mnm \leq n.
  • Since B2B_2 spans VV and B1B_1 is independent, nmn \leq m.
  • Therefore m=nm = n. This number is called the dimension of VV, denoted dim(V)\dim(V). Definition (Dimension). The dimension of a vector space VV is the number of vectors in any basis of VV. If V={0}V = \{\mathbf{0}\}, dim(V)=0\dim(V) = 0.

3.2 Dimensions of Common Spaces

Vector SpaceDimensionBasis
Rn\mathbb{R}^nnn{e1,,en}\{\mathbf{e}_1, \dots, \mathbf{e}_n\}
Rm×n\mathbb{R}^{m \times n}mnmnMatrices with a single 1 and rest 0
PnP_n (polynomials n\leq n )n+1n+1{1,x,x2,,xn}\{1, x, x^2, \dots, x^n\}
Line through origin in R3\mathbb{R}^311Any non-zero vector on the line
Plane through origin in R3\mathbb{R}^322Any two independent vectors in the plane
{0}\{\mathbf{0}\}00\emptyset (empty set)
C[a,b]C[a,b] (continuous functions)\inftyNot finite (infinite-dimensional)

4. Finding Bases

4.1 From a Spanning Set to a Basis

Given a spanning set, we can find a basis by discarding dependent vectors. Algorithm (Row method):
  1. Write the vectors as rows of a matrix
  2. Row reduce to RREF
  3. The non-zero rows form a basis for the span Algorithm (Column method):
  4. Write the vectors as columns of a matrix
  5. Row reduce to RREF
  6. The original columns corresponding to pivot columns form a basis
Example 3: Finding a basis from a spanning set
Find a basis for span{(1,2,1),(2,3,4),(3,5,5),(1,1,3)}\text{span}\{(1,2,1), (2,3,4), (3,5,5), (1,1,3)\}.
Row method:
>[121234355113]RREF[105012000000]>> \begin{bmatrix} 1 & 2 & 1 \\ 2 & 3 & 4 \\ 3 & 5 & 5 \\ 1 & 1 & 3 \end{bmatrix} \xrightarrow{\text{RREF}} \begin{bmatrix} 1 & 0 & 5 \\ 0 & 1 & -2 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix} >
Non-zero rows: {(1,0,5),(0,1,2)}\{(1,0,5), (0,1,-2)\} form a basis. Dimension = 2.
Column method:
>[123123511453]RREF[101101110000]>> \begin{bmatrix} 1 & 2 & 3 & 1 \\ 2 & 3 & 5 & 1 \\ 1 & 4 & 5 & 3 \end{bmatrix} \xrightarrow{\text{RREF}} \begin{bmatrix} 1 & 0 & 1 & -1 \\ 0 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 \end{bmatrix} >
Pivots in columns 1 and 2. So original vectors {(1,2,1),(2,3,4)}\{(1,2,1), (2,3,4)\} form a basis.

4.2 Finding a Basis for a Subspace Defined by Equations

For a subspace defined by homogeneous equations (like Ax=0A\mathbf{x} = \mathbf{0}):
  1. Solve the system using Gaussian elimination
  2. Express the solution in parametric form
  3. The vectors multiplying the free parameters form a basis for the null space
Example 4: Basis for a plane subspace
Find a basis for W={(x,y,z)R3x+2yz=0}W = \{(x,y,z) \in \mathbb{R}^3 \mid x + 2y - z = 0\}.
x=2y+zx = -2y + z, y,zy, z free.
>[xyz]=y[210]+z[101]>> \begin{bmatrix} x \\ y \\ z \end{bmatrix} = y\begin{bmatrix} -2 \\ 1 \\ 0 \end{bmatrix} + z\begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix} >
Basis: {(2,1,0),(1,0,1)}\{(-2,1,0), (1,0,1)\}. Dimension = 2.

4.3 Finding a Basis for the Column Space

The pivot columns of AA (original columns, not the RREF columns) form a basis for the column space.
Example 5: Basis for column space
>A=[120101101311]RREF[102101100000]>> A = \begin{bmatrix} 1 & 2 & 0 & 1 \\ 0 & 1 & 1 & 0 \\ 1 & 3 & 1 & 1 \end{bmatrix} \xrightarrow{\text{RREF}} \begin{bmatrix} 1 & 0 & -2 & 1 \\ 0 & 1 & 1 & 0 \\ 0 & 0 & 0 & 0 \end{bmatrix} >
Pivots in columns 1 and 2. Basis for C(A)C(A): columns 1 and 2 of original AA:
>{[101],  [213]}>> \left\{\begin{bmatrix}1\\0\\1\end{bmatrix},\; \begin{bmatrix}2\\1\\3\end{bmatrix}\right\} >

5. Dimension and Subspaces

Theorem. If WW is a subspace of a finite-dimensional vector space VV, then:
  • dim(W)dim(V)\dim(W) \leq \dim(V)
  • dim(W)=dim(V)\dim(W) = \dim(V) if and only if W=VW = V Example 6: Dimensions of subspaces of R3\mathbb{R}^3
Subspace TypeDimension
{0}\{\mathbf{0}\}00
Line through origin11
Plane through origin22
R3\mathbb{R}^333

6. Edge Cases & Gotchas

SituationWhat Happens
**Trivial space {0}\{\mathbf{0}\} **Has dimension 0; its basis is the empty set
Infinite-dimensional spacesC[a,b]C[a,b] , PP_\infty (all polynomials) have no finite basis
Coordinates depend on basisA vector (1,2)(1,2) has different coordinates in different bases
Column vs. row space basesThey come from different methods but have the same dimension

7. Common Pitfalls

❌ Pitfall 1: Confusing dimension of a vector space with number of entries

R3\mathbb{R}^3 has dimension 3, but a plane inside it has dimension 2 (even though vectors in the plane still have 3 components).

❌ Pitfall 2: Taking RREF columns as basis vectors

The pivot columns of the original matrix form a basis for the column space, not the RREF columns (which are in a different coordinate system).

❌ Pitfall 3: Thinking a set must be orthogonal to be a basis

Any independent spanning set is a basis. Orthogonality (Week 8) is a convenience, not a requirement.

❌ Pitfall 4: A spanning set with too few vectors

If you have fewer than dim(V)\dim(V) vectors, they cannot span VV. If you have more than dim(V)\dim(V) vectors, they cannot be independent. Either way, they're not a basis.

8. Formula Summary Table

ConceptKey Fact
BasisIndependent spanning set
DimensionNumber of vectors in any basis
**Standard basis of Rn\mathbb{R}^n **e1,,en\mathbf{e}_1, \dots, \mathbf{e}_n
**Standard basis of PnP_n **{1,x,x2,,xn}\{1, x, x^2, \dots, x^n\}
** dim(Rm×n)\dim(\mathbb{R}^{m \times n}) **mnmn
Basis from spanning setRow reduce; non-zero rows = basis
Basis for null spaceParametric solution vectors
Basis for column spaceOriginal columns at pivot positions

9. 📝 Practice Questions

Q1: Is this a basis?
Is B={(1,1),(1,1)}B = \{(1,1), (1,-1)\} a basis for R2\mathbb{R}^2?
Solution: Check independence: c1(1,1)+c2(1,1)=(c1+c2,c1c2)=(0,0)c_1(1,1)+c_2(1,-1) = (c_1+c_2, c_1-c_2) = (0,0)c1+c2=0c_1+c_2=0, c1c2=0c_1-c_2=0c1=c2=0c_1=c_2=0. Independent ✓
Check spanning: For any (x,y)(x,y), solve c1+c2=xc_1+c_2 = x, c1c2=yc_1-c_2 = yc1=x+y2c_1 = \frac{x+y}{2}, c2=xy2c_2 = \frac{x-y}{2}. Exists for all (x,y)(x,y)
Yes, BB is a basis. Q2: Not a basis — dependent
Is B={(1,2,3),(2,4,6),(1,1,1)}B = \{(1,2,3), (2,4,6), (1,1,1)\} a basis for R3\mathbb{R}^3?
Solution: (2,4,6)=2(1,2,3)(2,4,6) = 2(1,2,3), so the set is dependent. Not a basis.
Dimension of span is at most 2 (actually {(1,2,3),(1,1,1)}\{(1,2,3), (1,1,1)\} spans a plane). Q3: Not a basis — doesn't span
Is B={(1,0,0),(0,1,0)}B = \{(1,0,0), (0,1,0)\} a basis for R3\mathbb{R}^3?
Solution: It spans the xyxy-plane only, not all of R3\mathbb{R}^3 (e.g., (0,0,1)(0,0,1) cannot be formed). Not a basis. Q4: Dimension of a subspace
Find a basis and the dimension of W={(x,y,z,w)xy+2z=0,y+zw=0}W = \{(x,y,z,w) \mid x - y + 2z = 0, y + z - w = 0\}.
Solution: Solve:
>{x=y2zw=y+z>> \begin{cases} x = y - 2z \\ w = y + z \end{cases} >
y,zy, z free.
>[xyzw]=y[1101]+z[2011]>> \begin{bmatrix} x \\ y \\ z \\ w \end{bmatrix} = y\begin{bmatrix} 1 \\ 1 \\ 0 \\ 1 \end{bmatrix} + z\begin{bmatrix} -2 \\ 0 \\ 1 \\ 1 \end{bmatrix} >
Basis: {(1,1,0,1),(2,0,1,1)}\{(1,1,0,1), (-2,0,1,1)\}. Dimension = 2. Q5: Basis for polynomial subspace
Find a basis for W={p(x)P2p(1)=0}W = \{p(x) \in P_2 \mid p(1) = 0\}.
Solution: p(x)=a+bx+cx2p(x) = a + bx + cx^2, p(1)=a+b+c=0p(1) = a + b + c = 0, so a=bca = -b - c.
p(x)=(bc)+bx+cx2=b(x1)+c(x21)p(x) = (-b-c) + bx + cx^2 = b(x-1) + c(x^2-1).
Basis: {x1,x21}\{x-1, x^2-1\}. Dimension = 2. Q6: Extending to a basis
Extend {(1,2,1)}\{(1,2,1)\} to a basis of R3\mathbb{R}^3.
Solution: Add standard basis vectors and eliminate dependent ones.
>[121100010001]RREF[100010001000]>> \begin{bmatrix} 1 & 2 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \xrightarrow{\text{RREF}} \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix} >
Pivots in rows 1-3, so {(1,2,1),(1,0,0),(0,1,0)}\{(1,2,1), (1,0,0), (0,1,0)\} is a basis (we added e1\mathbf{e}_1 and e2\mathbf{e}_2). Q7: Dimension of sum and intersection
In R3\mathbb{R}^3, W1=span{(1,0,0),(0,1,0)}W_1 = \text{span}\{(1,0,0), (0,1,0)\} (xyxy-plane), W2=span{(0,1,0),(0,0,1)}W_2 = \text{span}\{(0,1,0), (0,0,1)\} (yzyz-plane). Find dim(W1W2)\dim(W_1 \cap W_2) and dim(W1+W2)\dim(W_1 + W_2).
Solution: W1W2=span{(0,1,0)}W_1 \cap W_2 = \text{span}\{(0,1,0)\} (yy-axis), dimension 1.
W1+W2=R3W_1 + W_2 = \mathbb{R}^3, dimension 3.
Check: dim(W1+W2)=dim(W1)+dim(W2)dim(W1W2)=2+21=3\dim(W_1 + W_2) = \dim(W_1) + \dim(W_2) - \dim(W_1 \cap W_2) = 2 + 2 - 1 = 3Q8: Basis for matrix space
Find a basis for the subspace of 2×22 \times 2 symmetric matrices.
Solution: A symmetric 2×22 \times 2 matrix is
>[abbc]=a[1000]+b[0110]+c[0001]>> \begin{bmatrix} a & b \\ b & c \end{bmatrix} = a\begin{bmatrix} 1&0\\0&0 \end{bmatrix} + b\begin{bmatrix} 0&1\\1&0 \end{bmatrix} + c\begin{bmatrix} 0&0\\0&1 \end{bmatrix} >
.
Basis:
>{[1000],[0110],[0001]}>> \left\{\begin{bmatrix}1&0\\0&0\end{bmatrix}, \begin{bmatrix}0&1\\1&0\end{bmatrix}, \begin{bmatrix}0&0\\0&1\end{bmatrix}\right\} >
. Dimension = 3. Q9: Proving dimension property
Prove: If WW is a subspace of Rn\mathbb{R}^n and dim(W)=n\dim(W) = n, then W=RnW = \mathbb{R}^n.
Proof: dim(W)=n=dim(Rn)\dim(W) = n = \dim(\mathbb{R}^n). Since WRnW \subseteq \mathbb{R}^n and both have the same finite dimension, they must be equal. Q10: Coordinate vector
Find [v]B[\mathbf{v}]_B where v=(5,3)\mathbf{v} = (5,3) and B={(1,2),(2,1)}B = \{(1,2), (2,1)\}.
Solution: Solve (5,3)=c1(1,2)+c2(2,1)(5,3) = c_1(1,2) + c_2(2,1):
>{c1+2c2=52c1+c2=3>> \begin{cases} c_1 + 2c_2 = 5 \\ 2c_1 + c_2 = 3 \end{cases} >
From first: c1=52c2c_1 = 5-2c_2. Substitute: 2(52c2)+c2=104c2+c2=103c2=3c2=732(5-2c_2) + c_2 = 10 - 4c_2 + c_2 = 10 - 3c_2 = 3 \Rightarrow c_2 = \frac{7}{3}. Then c1=52(73)=5143=13c_1 = 5 - 2(\frac{7}{3}) = 5 - \frac{14}{3} = \frac{1}{3}.
>[v]B=[1/37/3]>> [\mathbf{v}]_B = \begin{bmatrix} 1/3 \\ 7/3 \end{bmatrix} >
.

🔗 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.