Linear Independence & Span
2438 words
12 min read
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
# Linear Independence & Span ## 🎯 Learning Objectives After this topic you will be able to: - Define the span of a set of vectors - Determine whether a set of vectors is linearly independent or dependent - Find whether a given vector lies in the span of a set of vectors - Use Gaussian elimination to test linear ind...

Linear Independence & Span
🎯 Learning Objectives
After this topic you will be able to:
- Define the span of a set of vectors
- Determine whether a set of vectors is linearly independent or dependent
- Find whether a given vector lies in the span of a set of vectors
- Use Gaussian elimination to test linear independence
- Describe the geometric meaning of dependence/independence in R2 and R3
- Prove basic facts about independence
📋 Prerequisites
- Vector Spaces and Subspaces (this week) — context for where vectors live
- Gaussian Elimination (Week 2) — the computational tool for testing independence
- Solving homogeneous systems (Week 2) — Ax=0 is the key equation
1. Intuition: Redundant vs. Essential Vectors
1.1 What Does "Independent" Mean?
Imagine you're packing for a trip. You have a set of items:
- A shirt
- Pants
- Shoes
- A jacket These are all independent — none can be made from the others. Now imagine you also pack:
- A shirt that's exactly like the first one (redundant)
- An outfit that's just shirt + pants (composite) These are dependent — they add nothing new to your wardrobe. Linear independence captures this same idea for vectors: a set of vectors is independent if no vector can be expressed as a combination of the others. Every vector contributes a new "direction." (Diagram)
1.2 Span: The Set of All Combinations
The span of a set of vectors is everything you can reach by taking linear combinations of them.
- If you have one vector in R2, its span is a line through the origin
- If you have two linearly independent vectors in R2, their span is the entire plane
- If you have three or more vectors in R2, their span is still just the plane (the extra vectors are redundant)
2. Span
>span{v1,…,vk}={i=1∑kcivici∈R}>Definition (Span). The span of a set of vectors {v1,v2,…,vk} in a vector space V is:
>span{v1,v2}={c1(1,0,1)+c2(0,1,1)∣c1,c2∈R}>It is the set of all linear combinations of the vectors. Key fact: The span of any set of vectors is always a subspace of V. Example 1: Span of two vectors in ℝ³v1=(1,0,1), v2=(0,1,1)
This is the plane x−y+z=0 (check: x=c1, y=c2, z=c1+c2, so x−y+z=c1−c2+c1+c2=2c1, wait... let me recheck). Actually: span{v1,v2}={(c1,c2,c1+c2)∣c1,c2∈R}. This is the plane through origin with equation x+y−z=0 (since x+y−z=c1+c2−(c1+c2)=0).
3. Linear Independence
3.1 Definition
>c1v1+c2v2+⋯+ckvk=0>Definition (Linear Independence). A set of vectors {v1,v2,…,vk} is linearly independent if the only solution to:
vi=−cic1v1−⋯−cici−1vi−1−cici+1vi+1−⋯is the trivial solution c1=c2=⋯=ck=0.If there exists a non-trivial solution (at least one ci=0), the set is linearly dependent. Intuition: A set is dependent if some vector can be written as a combination of the others. In that case, we have:
3.2 Geometric Interpretation
| Dimension | Independent | Dependent |
|---|---|---|
| R2 : 2 vectors | Not collinear (span a parallelogram) | Collinear (one is scalar multiple of other) |
| R3 : 2 vectors | Not collinear (span a plane) | Collinear (lie on same line) |
| R3 : 3 vectors | Not coplanar (span a parallelepiped) | Coplanar (all lie in some plane) |
3.3 Testing Independence with Gaussian Elimination
To test if {v1,v2,…,vk} in Rn are independent:
- Form matrix A with vi as columns
- Solve Ac=0 (row reduce to RREF)
- If the only solution is c=0, the vectors are independent
- If there are free variables, they are dependent Alternatively: form a matrix with vectors as rows and compute the rank. The vectors are independent iff the number of vectors equals the rank.
>A=121012101>Example 2: Independent vectors in ℝ³Test v1=(1,2,1), v2=(0,1,2), v3=(1,0,1).
>121012101∣∣∣000R2−2R1,R3−R11000121−20∣∣∣000>Row reduce Ac=0:
>R3−2R21000101−24∣∣∣000>
>A=123456789>All columns are pivot columns, so only trivial solution. Independent. Example 3: Dependent vectors in ℝ³Test v1=(1,2,3), v2=(4,5,6), v3=(7,8,9).
>R2−2R1,R3−3R11004−3−67−6−12R3−2R21004−307−60>Row reduce:
Column 3 has no pivot (free variable). Dependent. Indeed, v3=2v2−v1 (check: 7=2(4)−1, 8=2(5)−2, 9=2(6)−3).
3.4 Important Facts
| Fact | Explanation |
|---|---|
| Any set containing 0 is dependent | 1⋅0+0⋅v2+⋯=0 is non-trivial |
| A single non-zero vector is independent | cv=0⇒c=0 |
| Two vectors are dependent iff one is a scalar multiple of the other | c1v1+c2v2=0 with c1=0 gives v1=−(c2/c1)v2 |
| In Rn , any set of more than n vectors is dependent | Any n+1 vectors in Rn are linearly dependent |
| If a set is independent, every subset is also independent | Removing vectors preserves independence |
| If a set is dependent, every superset is also dependent | Adding vectors preserves dependence |
4. Wronskian Test for Functions
For function spaces, the Wronskian tests independence of differentiable functions:
>W(f1,…,fn)(x)=detf1(x)f1′(x)⋮f1(n−1)(x)f2(x)f2′(x)⋮f2(n−1)(x)……⋱…fn(x)fn′(x)⋮fn(n−1)(x)>
If W=0 at some point, the functions are linearly independent.
>W(1,x,x2)=det100x10x22x2=1⋅1⋅2=2=0>Example 4: Wronskian of {1,x,x2}
So {1,x,x2} is independent. (This makes sense — no polynomial of degree 2 is a combination of lower-degree polynomials.)
5. Edge Cases & Gotchas
| Situation | What Happens |
|---|---|
| Empty set | Convention: the empty set is linearly independent |
| Single non-zero vector | Always independent |
| Infinite set | A set is independent if every finite subset is independent |
| Vectors with different numbers of components | Cannot be compared directly; they live in different spaces |
6. Common Pitfalls
❌ Pitfall 1: Thinking "independent" means "orthogonal"
Independence does not require orthogonality. (1,0) and (1,1) are independent but not orthogonal (dot product = 1).
❌ Pitfall 2: Testing independence by looking at rows vs. columns
If you put vectors as rows of a matrix, the non-zero rows of RREF are independent. If you put them as columns, the pivot columns pick out independent vectors. Both methods work, but they give different independent subsets!
❌ Pitfall 3: Assuming more vectors than the dimension are independent
In R3, any 4 vectors are automatically dependent, but students sometimes try to check anyway.
❌ Pitfall 4: Forgetting the zero vector case
A set containing 0 is always dependent — you don't need to check further.
7. Formula Summary Table
| Concept | Definition/Test |
|---|---|
| Span | span{v1,…,vk}={∑civi∣ci∈R} |
| Linear independence | ∑civi=0⇒all ci=0 |
| Test using matrix | Form columns A=[v1…vk] , solve Ac=0 |
| Test using rank | Rank of matrix with vectors as rows = number of vectors ⇒ independent |
| Key inequality | In Rn , ≤n vectors can be independent |
| Wronskian | For functions, W=0 at some point ⇒ independent |
8. 📝 Practice Questions
>⎩⎨⎧c1+c3=0c2+c3=0c1+2c2+c3=0>Q1: Span descriptionDescribe span{(1,2),(2,4)}.Solution: The second vector is 2 times the first, so they are collinear. span{(1,2),(2,4)}=span{(1,2)}={(c,2c)∣c∈R}, a line through origin. Q2: Independence test in ℝ²Are v1=(1,3) and v2=(2,−1) linearly independent?Solution: Check if one is a scalar multiple of the other. If v2=cv1, then 2=c(1) and −1=c(3) ⇒ c=2 and c=−1/3, impossible. They are independent. Q3: Independence test in ℝ³Are v1=(1,0,1), v2=(0,1,2), v3=(1,1,1) independent?Solution: Solve c1(1,0,1)+c2(0,1,2)+c3(1,1,1)=(0,0,0):
>121234355R2−2R1,R3−R11002−123−12R3+2R21002−103−10>From first two: c1=−c3, c2=−c3. Substitute into third: (−c3)+2(−c3)+c3=−2c3=0⇒c3=0, then c1=0, c2=0.Only trivial solution. Independent. Q4: Finding a dependency relationFind a dependency relation among v1=(1,2,1), v2=(2,3,4), v3=(3,5,5).Solution: Solve Ac=0:
>⎩⎨⎧c1+c3=0c1+c2=0c2−c3=0>c2=−c3, c1=−2c2−3c3=2c3−3c3=−c3. Choose c3=1: c1=−1, c2=−1, c3=1.Dependency: −v1−v2+v3=0, i.e., v3=v1+v2.Check: (3,5,5)=(1,2,1)+(2,3,4)=(3,5,5) ✓ Q5: Zero vector setIs {(1,2),(0,0),(3,4)} linearly independent?Solution: No, because it contains the zero vector. A non-trivial combination is 0(1,2)+1(0,0)+0(3,4)=(0,0). Q6: Independence of polynomialsAre p1(x)=1+x, p2(x)=x+x2, p3(x)=1−x2 linearly independent in P2?Solution: Set c1(1+x)+c2(x+x2)+c3(1−x2)=0 (the zero polynomial).Group like powers: (c1+c3)+(c1+c2)x+(c2−c3)x2=0.For this to be the zero polynomial, all coefficients must be zero:
>W(sinx,cosx)=det[sinxcosxcosx−sinx]=−sin2x−cos2x=−1=0>From first: c3=−c1. From third: c2=c3=−c1. From second: c1+(−c1)=0 (satisfied automatically).So c1 is free; pick c1=1, then c2=−1, c3=−1.p1−p2−p3=(1+x)−(x+x2)−(1−x2)=1+x−x−x2−1+x2=0.Dependent. Q7: Maximum independent setWhat is the maximum number of linearly independent vectors in R4?Solution: At most 4 (the dimension of R4). Any 5 vectors in R4 are linearly dependent. Q8: Wronskian testAre f(x)=sinx and g(x)=cosx linearly independent?Solution: Compute the Wronskian:
>⎩⎨⎧c1+c2+c3=0c2+c3=0c3=0>Independent. Q9: Span and independenceIf {v1,v2,v3} is linearly independent in R3, what is span{v1,v2,v3}?Solution: Since R3 has dimension 3 and we have 3 independent vectors, they span the entire space: span{v1,v2,v3}=R3. Q10: Proving a propertyProve: If {v1,v2,v3} is independent, then {v1,v1+v2,v1+v2+v3} is also independent.Proof: Suppose c1v1+c2(v1+v2)+c3(v1+v2+v3)=0. Group terms: (c1+c2+c3)v1+(c2+c3)v2+c3v3=0.Since {v1,v2,v3} is independent:
Back-substitute: c3=0⇒c2=0⇒c1=0. Only trivial solution, so the new set is independent. ∎
🔗 Cross-References
- Next topic: Basis & Dimension
- Week 4: A basis is a spanning set that is linearly independent
- Week 1 (Vectors): Dot products provide another way to test independence (orthogonal ⇒ independent)
- Week 8 (Gram-Schmidt): Builds orthogonal/orthonormal independent sets
- BSCS2004 (ML Foundations): Independent features are non-redundant predictors Join Discord Previous3.2 SubspacesNext4.1 Basis & Dimension