Quiz 2

Linear Independence & Span

2438 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

# 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\mathbb{R}^2 and R3\mathbb{R}^3
  • 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=0A\mathbf{x} = \mathbf{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\mathbb{R}^2, its span is a line through the origin
  • If you have two linearly independent vectors in R2\mathbb{R}^2, their span is the entire plane
  • If you have three or more vectors in R2\mathbb{R}^2, their span is still just the plane (the extra vectors are redundant)

2. Span

Definition (Span). The span of a set of vectors {v1,v2,,vk}\{\mathbf{v}_1, \mathbf{v}_2, \dots, \mathbf{v}_k\} in a vector space VV is:
>span{v1,,vk}={i=1kcivi  |  ciR}>> \text{span}\{\mathbf{v}_1, \dots, \mathbf{v}_k\} = \left\{ \sum_{i=1}^k c_i \mathbf{v}_i \;\middle|\; c_i \in \mathbb{R} \right\} >
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 VV. Example 1: Span of two vectors in ℝ³
v1=(1,0,1)\mathbf{v}_1 = (1, 0, 1), v2=(0,1,1)\mathbf{v}_2 = (0, 1, 1)
>span{v1,v2}={c1(1,0,1)+c2(0,1,1)c1,c2R}>> \text{span}\{\mathbf{v}_1, \mathbf{v}_2\} = \{c_1(1,0,1) + c_2(0,1,1) \mid c_1, c_2 \in \mathbb{R}\} >
This is the plane xy+z=0x - y + z = 0 (check: x=c1x = c_1, y=c2y = c_2, z=c1+c2z = c_1 + c_2, so xy+z=c1c2+c1+c2=2c1x - y + z = c_1 - c_2 + c_1 + c_2 = 2c_1, wait... let me recheck). Actually: span{v1,v2}={(c1,c2,c1+c2)c1,c2R}\text{span}\{\mathbf{v}_1, \mathbf{v}_2\} = \{(c_1, c_2, c_1 + c_2) \mid c_1, c_2 \in \mathbb{R}\}. This is the plane through origin with equation x+yz=0x + y - z = 0 (since x+yz=c1+c2(c1+c2)=0x + y - z = c_1 + c_2 - (c_1 + c_2) = 0).

3. Linear Independence

3.1 Definition

Definition (Linear Independence). A set of vectors {v1,v2,,vk}\{\mathbf{v}_1, \mathbf{v}_2, \dots, \mathbf{v}_k\} is linearly independent if the only solution to:
>c1v1+c2v2++ckvk=0>> c_1 \mathbf{v}_1 + c_2 \mathbf{v}_2 + \cdots + c_k \mathbf{v}_k = \mathbf{0} >
is the trivial solution c1=c2==ck=0c_1 = c_2 = \cdots = c_k = 0.
If there exists a non-trivial solution (at least one ci0c_i \neq 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:
vi=c1civ1ci1civi1ci+1civi+1\mathbf{v}_i = -\frac{c_1}{c_i}\mathbf{v}_1 - \cdots - \frac{c_{i-1}}{c_i}\mathbf{v}_{i-1} - \frac{c_{i+1}}{c_i}\mathbf{v}_{i+1} - \cdots

3.2 Geometric Interpretation

DimensionIndependentDependent
R2\mathbb{R}^2 : 2 vectorsNot collinear (span a parallelogram)Collinear (one is scalar multiple of other)
R3\mathbb{R}^3 : 2 vectorsNot collinear (span a plane)Collinear (lie on same line)
R3\mathbb{R}^3 : 3 vectorsNot coplanar (span a parallelepiped)Coplanar (all lie in some plane)

3.3 Testing Independence with Gaussian Elimination

To test if {v1,v2,,vk}\{\mathbf{v}_1, \mathbf{v}_2, \dots, \mathbf{v}_k\} in Rn\mathbb{R}^n are independent:
  1. Form matrix AA with vi\mathbf{v}_i as columns
  2. Solve Ac=0A\mathbf{c} = \mathbf{0} (row reduce to RREF)
  3. If the only solution is c=0\mathbf{c} = \mathbf{0}, the vectors are independent
  4. 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.
Example 2: Independent vectors in ℝ³
Test v1=(1,2,1)\mathbf{v}_1 = (1, 2, 1), v2=(0,1,2)\mathbf{v}_2 = (0, 1, 2), v3=(1,0,1)\mathbf{v}_3 = (1, 0, 1).
>A=[101210121]>> A = \begin{bmatrix} 1 & 0 & 1 \\ 2 & 1 & 0 \\ 1 & 2 & 1 \end{bmatrix} >
Row reduce Ac=0A\mathbf{c} = \mathbf{0}:
>[101021001210]R22R1,R3R1[101001200200]>> \begin{bmatrix} 1 & 0 & 1 & | & 0 \\ 2 & 1 & 0 & | & 0 \\ 1 & 2 & 1 & | & 0 \end{bmatrix} \xrightarrow{R_2 - 2R_1, R_3 - R_1} \begin{bmatrix} 1 & 0 & 1 & | & 0 \\ 0 & 1 & -2 & | & 0 \\ 0 & 2 & 0 & | & 0 \end{bmatrix} >
>R32R2[101001200040]>> \xrightarrow{R_3 - 2R_2} \begin{bmatrix} 1 & 0 & 1 & | & 0 \\ 0 & 1 & -2 & | & 0 \\ 0 & 0 & 4 & | & 0 \end{bmatrix} >
All columns are pivot columns, so only trivial solution. Independent. Example 3: Dependent vectors in ℝ³
Test v1=(1,2,3)\mathbf{v}_1 = (1, 2, 3), v2=(4,5,6)\mathbf{v}_2 = (4, 5, 6), v3=(7,8,9)\mathbf{v}_3 = (7, 8, 9).
>A=[147258369]>> A = \begin{bmatrix} 1 & 4 & 7 \\ 2 & 5 & 8 \\ 3 & 6 & 9 \end{bmatrix} >
Row reduce:
>R22R1,R33R1[1470360612]R32R2[147036000]>> \xrightarrow{R_2 - 2R_1, R_3 - 3R_1} \begin{bmatrix} 1 & 4 & 7 \\ 0 & -3 & -6 \\ 0 & -6 & -12 \end{bmatrix} \xrightarrow{R_3 - 2R_2} \begin{bmatrix} 1 & 4 & 7 \\ 0 & -3 & -6 \\ 0 & 0 & 0 \end{bmatrix} >
Column 3 has no pivot (free variable). Dependent. Indeed, v3=2v2v1\mathbf{v}_3 = 2\mathbf{v}_2 - \mathbf{v}_1 (check: 7=2(4)17 = 2(4)-1, 8=2(5)28 = 2(5)-2, 9=2(6)39 = 2(6)-3).

3.4 Important Facts

FactExplanation
Any set containing 0\mathbf{0} is dependent10+0v2+=01 \cdot \mathbf{0} + 0 \cdot \mathbf{v}_2 + \cdots = \mathbf{0} is non-trivial
A single non-zero vector is independentcv=0c=0c\mathbf{v} = \mathbf{0} \Rightarrow c = 0
Two vectors are dependent iff one is a scalar multiple of the otherc1v1+c2v2=0c_1\mathbf{v}_1 + c_2\mathbf{v}_2 = \mathbf{0} with c10c_1 \neq 0 gives v1=(c2/c1)v2\mathbf{v}_1 = -(c_2/c_1)\mathbf{v}_2
In Rn\mathbb{R}^n , any set of more than nn vectors is dependentAny n+1n+1 vectors in Rn\mathbb{R}^n are linearly dependent
If a set is independent, every subset is also independentRemoving vectors preserves independence
If a set is dependent, every superset is also dependentAdding vectors preserves dependence

4. Wronskian Test for Functions

For function spaces, the Wronskian tests independence of differentiable functions:
>W(f1,,fn)(x)=det[f1(x)f2(x)fn(x)f1(x)f2(x)fn(x)f1(n1)(x)f2(n1)(x)fn(n1)(x)]>> W(f_1, \dots, f_n)(x) = \det\begin{bmatrix} f_1(x) & f_2(x) & \dots & f_n(x) \\ f_1'(x) & f_2'(x) & \dots & f_n'(x) \\ \vdots & \vdots & \ddots & \vdots \\ f_1^{(n-1)}(x) & f_2^{(n-1)}(x) & \dots & f_n^{(n-1)}(x) \end{bmatrix} >
If W0W \neq 0 at some point, the functions are linearly independent.
Example 4: Wronskian of {1,x,x2}\{1, x, x^2\}
>W(1,x,x2)=det[1xx2012x002]=112=20>> W(1, x, x^2) = \det\begin{bmatrix} 1 & x & x^2 \\ 0 & 1 & 2x \\ 0 & 0 & 2 \end{bmatrix} = 1 \cdot 1 \cdot 2 = 2 \neq 0 >
So {1,x,x2}\{1, x, x^2\} is independent. (This makes sense — no polynomial of degree 2 is a combination of lower-degree polynomials.)

5. Edge Cases & Gotchas

SituationWhat Happens
Empty setConvention: the empty set is linearly independent
Single non-zero vectorAlways independent
Infinite setA set is independent if every finite subset is independent
Vectors with different numbers of componentsCannot be compared directly; they live in different spaces

6. Common Pitfalls

❌ Pitfall 1: Thinking "independent" means "orthogonal"

Independence does not require orthogonality. (1,0)(1,0) and (1,1)(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\mathbb{R}^3, any 4 vectors are automatically dependent, but students sometimes try to check anyway.

❌ Pitfall 4: Forgetting the zero vector case

A set containing 0\mathbf{0} is always dependent — you don't need to check further.

7. Formula Summary Table

ConceptDefinition/Test
Spanspan{v1,,vk}={civiciR}\text{span}\{v_1, \dots, v_k\} = \{\sum c_i v_i \mid c_i \in \mathbb{R}\}
Linear independencecivi=0all ci=0\sum c_i v_i = \mathbf{0} \Rightarrow \text{all } c_i = 0
Test using matrixForm columns A=[v1    vk]A = [v_1 \; \dots \; v_k] , solve Ac=0A\mathbf{c} = \mathbf{0}
Test using rankRank of matrix with vectors as rows = number of vectors ⇒ independent
Key inequalityIn Rn\mathbb{R}^n , n\leq n vectors can be independent
WronskianFor functions, W0W \neq 0 at some point ⇒ independent

8. 📝 Practice Questions

Q1: Span description
Describe span{(1,2),(2,4)}\text{span}\{(1,2), (2,4)\}.
Solution: The second vector is 22 times the first, so they are collinear. span{(1,2),(2,4)}=span{(1,2)}={(c,2c)cR}\text{span}\{(1,2), (2,4)\} = \text{span}\{(1,2)\} = \{(c, 2c) \mid c \in \mathbb{R}\}, a line through origin. Q2: Independence test in ℝ²
Are v1=(1,3)\mathbf{v}_1 = (1,3) and v2=(2,1)\mathbf{v}_2 = (2,-1) linearly independent?
Solution: Check if one is a scalar multiple of the other. If v2=cv1\mathbf{v}_2 = c\mathbf{v}_1, then 2=c(1)2 = c(1) and 1=c(3)-1 = c(3)c=2c=2 and c=1/3c=-1/3, impossible. They are independent. Q3: Independence test in ℝ³
Are v1=(1,0,1)\mathbf{v}_1 = (1,0,1), v2=(0,1,2)\mathbf{v}_2 = (0,1,2), v3=(1,1,1)\mathbf{v}_3 = (1,1,1) independent?
Solution: Solve c1(1,0,1)+c2(0,1,2)+c3(1,1,1)=(0,0,0)c_1(1,0,1) + c_2(0,1,2) + c_3(1,1,1) = (0,0,0):
>{c1+c3=0c2+c3=0c1+2c2+c3=0>> \begin{cases} c_1 + c_3 = 0 \\ c_2 + c_3 = 0 \\ c_1 + 2c_2 + c_3 = 0 \end{cases} >
From first two: c1=c3c_1 = -c_3, c2=c3c_2 = -c_3. Substitute into third: (c3)+2(c3)+c3=2c3=0c3=0(-c_3) + 2(-c_3) + c_3 = -2c_3 = 0 \Rightarrow c_3 = 0, then c1=0c_1 = 0, c2=0c_2 = 0.
Only trivial solution. Independent. Q4: Finding a dependency relation
Find a dependency relation among v1=(1,2,1)\mathbf{v}_1 = (1,2,1), v2=(2,3,4)\mathbf{v}_2 = (2,3,4), v3=(3,5,5)\mathbf{v}_3 = (3,5,5).
Solution: Solve Ac=0A\mathbf{c} = \mathbf{0}:
>[123235145]R22R1,R3R1[123011022]R3+2R2[123011000]>> \begin{bmatrix} 1 & 2 & 3 \\ 2 & 3 & 5 \\ 1 & 4 & 5 \end{bmatrix} \xrightarrow{R_2-2R_1, R_3-R_1} \begin{bmatrix} 1 & 2 & 3 \\ 0 & -1 & -1 \\ 0 & 2 & 2 \end{bmatrix} \xrightarrow{R_3+2R_2} \begin{bmatrix} 1 & 2 & 3 \\ 0 & -1 & -1 \\ 0 & 0 & 0 \end{bmatrix} >
c2=c3c_2 = -c_3, c1=2c23c3=2c33c3=c3c_1 = -2c_2 - 3c_3 = 2c_3 - 3c_3 = -c_3. Choose c3=1c_3 = 1: c1=1c_1 = -1, c2=1c_2 = -1, c3=1c_3 = 1.
Dependency: v1v2+v3=0-\mathbf{v}_1 - \mathbf{v}_2 + \mathbf{v}_3 = \mathbf{0}, i.e., v3=v1+v2\mathbf{v}_3 = \mathbf{v}_1 + \mathbf{v}_2.
Check: (3,5,5)=(1,2,1)+(2,3,4)=(3,5,5)(3,5,5) = (1,2,1) + (2,3,4) = (3,5,5)Q5: Zero vector set
Is {(1,2),(0,0),(3,4)}\{(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)0(1,2) + 1(0,0) + 0(3,4) = (0,0). Q6: Independence of polynomials
Are p1(x)=1+xp_1(x) = 1 + x, p2(x)=x+x2p_2(x) = x + x^2, p3(x)=1x2p_3(x) = 1 - x^2 linearly independent in P2P_2?
Solution: Set c1(1+x)+c2(x+x2)+c3(1x2)=0c_1(1+x) + c_2(x+x^2) + c_3(1 - x^2) = 0 (the zero polynomial).
Group like powers: (c1+c3)+(c1+c2)x+(c2c3)x2=0(c_1 + c_3) + (c_1 + c_2)x + (c_2 - c_3)x^2 = 0.
For this to be the zero polynomial, all coefficients must be zero:
>{c1+c3=0c1+c2=0c2c3=0>> \begin{cases} c_1 + c_3 = 0 \\ c_1 + c_2 = 0 \\ c_2 - c_3 = 0 \end{cases} >
From first: c3=c1c_3 = -c_1. From third: c2=c3=c1c_2 = c_3 = -c_1. From second: c1+(c1)=0c_1 + (-c_1) = 0 (satisfied automatically).
So c1c_1 is free; pick c1=1c_1 = 1, then c2=1c_2 = -1, c3=1c_3 = -1.
p1p2p3=(1+x)(x+x2)(1x2)=1+xxx21+x2=0p_1 - p_2 - p_3 = (1+x) - (x+x^2) - (1-x^2) = 1+x-x-x^2-1+x^2 = 0.
Dependent. Q7: Maximum independent set
What is the maximum number of linearly independent vectors in R4\mathbb{R}^4?
Solution: At most 4 (the dimension of R4\mathbb{R}^4). Any 5 vectors in R4\mathbb{R}^4 are linearly dependent. Q8: Wronskian test
Are f(x)=sinxf(x) = \sin x and g(x)=cosxg(x) = \cos x linearly independent?
Solution: Compute the Wronskian:
>W(sinx,cosx)=det[sinxcosxcosxsinx]=sin2xcos2x=10>> W(\sin x, \cos x) = \det\begin{bmatrix} \sin x & \cos x \\ \cos x & -\sin x \end{bmatrix} = -\sin^2 x - \cos^2 x = -1 \neq 0 >
Independent. Q9: Span and independence
If {v1,v2,v3}\{\mathbf{v}_1, \mathbf{v}_2, \mathbf{v}_3\} is linearly independent in R3\mathbb{R}^3, what is span{v1,v2,v3}\text{span}\{\mathbf{v}_1, \mathbf{v}_2, \mathbf{v}_3\}?
Solution: Since R3\mathbb{R}^3 has dimension 3 and we have 3 independent vectors, they span the entire space: span{v1,v2,v3}=R3\text{span}\{\mathbf{v}_1, \mathbf{v}_2, \mathbf{v}_3\} = \mathbb{R}^3. Q10: Proving a property
Prove: If {v1,v2,v3}\{\mathbf{v}_1, \mathbf{v}_2, \mathbf{v}_3\} is independent, then {v1,v1+v2,v1+v2+v3}\{\mathbf{v}_1, \mathbf{v}_1+\mathbf{v}_2, \mathbf{v}_1+\mathbf{v}_2+\mathbf{v}_3\} is also independent.
Proof: Suppose c1v1+c2(v1+v2)+c3(v1+v2+v3)=0c_1\mathbf{v}_1 + c_2(\mathbf{v}_1+\mathbf{v}_2) + c_3(\mathbf{v}_1+\mathbf{v}_2+\mathbf{v}_3) = \mathbf{0}. Group terms: (c1+c2+c3)v1+(c2+c3)v2+c3v3=0(c_1 + c_2 + c_3)\mathbf{v}_1 + (c_2 + c_3)\mathbf{v}_2 + c_3\mathbf{v}_3 = \mathbf{0}.
Since {v1,v2,v3}\{\mathbf{v}_1, \mathbf{v}_2, \mathbf{v}_3\} is independent:
>{c1+c2+c3=0c2+c3=0c3=0>> \begin{cases} c_1 + c_2 + c_3 = 0 \\ c_2 + c_3 = 0 \\ c_3 = 0 \end{cases} >
Back-substitute: c3=0c2=0c1=0c_3 = 0 \Rightarrow c_2 = 0 \Rightarrow c_1 = 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
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.