determin.ant
01-vectors / 1.6

Module 1: Vectors

Linear Independence

Where you'll see this: multicollinearity in regression happens when two features are linearly dependent — one is nearly a multiple of the other. The model can't tell them apart, the normal matrix becomes singular, and the solution becomes numerically unstable or non-unique.

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

The definition

A set of vectors {v1,v2}\{\mathbf{v}_1, \mathbf{v}_2\} is linearly independent if the only solution to:

c1v1+c2v2=0c_1 \mathbf{v}_1 + c_2 \mathbf{v}_2 = \mathbf{0}

is c1=c2=0c_1 = c_2 = 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.

Geometrically

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.

Linear independence = the vectors point in genuinely different directions. They span a 2D region, not just a line.

The connection to span

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.

In higher 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?

Try it

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.

Checking independence in NumPy:
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 — dependent
SpanCross Product
-6-6-5-5-4-4-3-3-2-2-1-1112233445566abv

a 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 ℝ².