Module 1: Vectors
Linear independence is the condition that makes a basis work. It's the precise way of saying "these vectors aren't redundant — each one adds new information."
A set of vectors {v1,v2} is linearly independent if the only solution to:
is c1=c2=0. In other words: you can't write zero as a non-trivial combination of them.
They are linearly dependent if some non-zero scalars exist that make the combination zero — meaning one vector is a multiple of the other.
Two vectors in ℝ² are linearly dependent if and only if they point in the same (or opposite) direction — they're collinear. Two vectors that aren't parallel are always independent.
Two linearly independent vectors span all of ℝ². Two dependent vectors only span a line. Independence is what gives a basis its power — it means there are no redundant directions and no wasted dimensions.
Three vectors in ℝ³ are dependent if one lies in the plane spanned by the other two. In general, n vectors are independent if none is in the span of the rest. Checking independence means asking: does row reduction leave any zero rows?
Drag the blue vector a and the pink vector b. The purple vector v is always expressible as a combination when a and b are independent. Make a and b parallel — they become dependent, and v can only be reached if it happens to lie on the same line.
import numpy as np
# Two vectors as columns of a matrix
A = np.array([[2, 1], [0, 2]])
rank = np.linalg.matrix_rank(A)
print(rank) # 2 — independent
B = np.array([[1, 2], [2, 4]]) # second = 2 * first
print(np.linalg.matrix_rank(B)) # 1 — dependenta and b are linearly independent — they span all of ℝ².
v = 1·a + 1·b
Drag a or b to make them parallel — they become dependent and can no longer reach all of ℝ².