Search

Search papers and lessons

Linear Independence

Level 2 · 9 min read

A set of vectors is linearly independent when none of them can be built from the others, so each one adds a genuinely new direction.

On this page

  • Colour = topic mix
  • Linear algebra
  • Discrete math
  • Sign in to see your progress

TL;DR

A list of vectors is linearly independent when no vector in it can be written as a combination of the others. Each vector then points in a direction the rest cannot reach. If some vector can be built from the others, the list is linearly dependent, and that vector is redundant.

Where you'll see it: deciding whether a system of equations has a unique solution, counting the real dimensions of a data set, and spotting redundant features in a regression.

Intuition

Redundant arrows

Take two arrows in a flat plane. If they point in different directions, you can reach any point in the plane by stretching and adding them. If one arrow is just a longer or shorter copy of the other, the second one adds nothing. You could have left it out and lost no reach.

Three arrows in a plane always have one redundant member. If two of them point in different directions they already cover the whole plane, so the third can be built from those two. A set of arrows is independent exactly when every arrow pulls its weight: removing any one of them shrinks what you can reach.

That is the whole idea. "Linear" refers to the two operations that build new vectors, scaling and adding. A vector is dependent when scaling and adding the others produces it.

Why it matters

The count of independent vectors is the number of genuinely different directions in a set. In a space with nn coordinates, you can have at most nn independent vectors, and a set of nn independent vectors can reach every point. This is the idea behind a basis, and it is how linear algebra decides when a system of equations has exactly one answer. Redundancy shows up as a rank that is smaller than expected, which in data means features that carry no new information.

flowchart TD
  A["Set of vectors"] --> B{"Can one be written as a combination of the others?"}
  B -- Yes --> C["Linearly dependent: remove the redundant vector"]
  B -- No --> D["Linearly independent: each adds a new direction"]

The math

Definition

Definition: Linear independence

Vectors v1,…,vk\mathbf{v}_1, \dots, \mathbf{v}_k in a vector space are linearly independent if the only solution to

c1v1+c2v2+⋯+ckvk=0c_1 \mathbf{v}_1 + c_2 \mathbf{v}_2 + \cdots + c_k \mathbf{v}_k = \mathbf{0}

is c1=c2=⋯=ck=0c_1 = c_2 = \cdots = c_k = 0. If some choice of coefficients that is not all zero makes the sum zero, the vectors are linearly dependent.

Here each cic_i is a number (a scalar) that scales one vector, and 0\mathbf{0} is the zero vector. The all-zero choice always works, so the definition asks whether any other choice does.

Dependence has an equivalent form that is often easier to read. If cj≠0c_j \neq 0 in a dependent relation, then you can solve for vj\mathbf{v}_j:

vj=−1cj∑i≠jcivi.\mathbf{v}_j = -\frac{1}{c_j} \sum_{i \neq j} c_i \mathbf{v}_i.

So "dependent" means exactly "one vector is a combination of the others".

Matrix form

Stack the vectors as the columns of a Matrix AA and collect the coefficients into a column vector c\mathbf{c}. The definition becomes

Ac=0.A\mathbf{c} = \mathbf{0}.

The vectors are independent exactly when this equation has only the trivial solution c=0\mathbf{c} = \mathbf{0}. This is the form you will use in practice, because it is what Gaussian elimination solves. The number of independent columns is the rank of AA.

Key facts

  1. Two vectors are dependent exactly when one is a scalar multiple of the other.
  2. Any set that contains the zero vector is dependent. Take the coefficient of 0\mathbf{0} to be 1 and all others to be 0.
  3. Any subset of an independent set is independent.
  4. In Rn\mathbb{R}^n, any set of more than nn vectors is dependent.
  5. For nn vectors in Rn\mathbb{R}^n, placed as the columns of a square matrix AA, the vectors are independent exactly when det⁡(A)≠0\det(A) \neq 0. This is the Determinant test.

Fact 4 is worth pausing on. Four arrows in ordinary three-dimensional space cannot all be independent, because the three coordinates leave no room for a fourth direction.

Worked examples

Example
Two vectors that are multiples of each other

Let v1=(1,2)\mathbf{v}_1 = (1, 2) and v2=(2,4)\mathbf{v}_2 = (2, 4). Solve c1v1+c2v2=0c_1 \mathbf{v}_1 + c_2 \mathbf{v}_2 = \mathbf{0} coordinate by coordinate:

  1. First coordinate: c1+2c2=0c_1 + 2c_2 = 0.
  2. Second coordinate: 2c1+4c2=02c_1 + 4c_2 = 0.
  3. The second equation is twice the first, so there is only one condition: c1=−2c2c_1 = -2c_2.
  4. Choose c2=1c_2 = 1 and c1=−2c_1 = -2. Check: −2(1,2)+1(2,4)=(−2+2,−4+4)=(0,0)-2(1, 2) + 1(2, 4) = (-2 + 2, -4 + 4) = (0, 0).

A nonzero choice of coefficients gives zero, so the vectors are dependent. This matches fact 1, since v2=2v1\mathbf{v}_2 = 2\mathbf{v}_1. The second arrow lies on the first and adds no direction.

Example
Three vectors in space, one dependent and one not

Consider a=(1,0,1)\mathbf{a} = (1, 0, 1), b=(0,1,1)\mathbf{b} = (0, 1, 1) and c=(1,1,2)\mathbf{c} = (1, 1, 2).

  1. Add the first two: a+b=(1,1,2)=c\mathbf{a} + \mathbf{b} = (1, 1, 2) = \mathbf{c}.
  2. So a+b−c=0\mathbf{a} + \mathbf{b} - \mathbf{c} = \mathbf{0}, a nonzero relation. The set is dependent.
  3. Confirm with the determinant of the matrix whose columns are a\mathbf{a}, b\mathbf{b}, c\mathbf{c}. Expanding along the first row gives 1(1⋅2−1⋅1)−0+1(0⋅1−1⋅1)=1−1=01(1 \cdot 2 - 1 \cdot 1) - 0 + 1(0 \cdot 1 - 1 \cdot 1) = 1 - 1 = 0. A zero determinant agrees with dependence.

Now swap c\mathbf{c} for d=(1,1,0)\mathbf{d} = (1, 1, 0).

  1. Solve c1a+c2b+c3d=0c_1 \mathbf{a} + c_2 \mathbf{b} + c_3 \mathbf{d} = \mathbf{0}. The three coordinates give c1+c3=0c_1 + c_3 = 0, c2+c3=0c_2 + c_3 = 0 and c1+c2=0c_1 + c_2 = 0.
  2. From the first two, c1=−c3c_1 = -c_3 and c2=−c3c_2 = -c_3. Substituting into the third gives −2c3=0-2c_3 = 0, so c3=0c_3 = 0, and then c1=c2=0c_1 = c_2 = 0.
  3. Only the trivial solution exists, so a\mathbf{a}, b\mathbf{b}, d\mathbf{d} are independent. The determinant is 1(1⋅0−1⋅1)−0+1(0⋅1−1⋅1)=−2≠01(1 \cdot 0 - 1 \cdot 1) - 0 + 1(0 \cdot 1 - 1 \cdot 1) = -2 \neq 0, which agrees.
Example
Realistic case: a feature that carries no new information

A regression predicts weight from a column of ones (for the intercept), height in centimetres, and height in inches. Every person's inches value is their centimetre value divided by 2.542.54. For a person who is 170 cm tall, the row of the design matrix is (1,170,66.93)(1, 170, 66.93), since 170/2.54≈66.93170 / 2.54 \approx 66.93. Call the three columns u\mathbf{u} (ones), hcm\mathbf{h}_{cm} and hin\mathbf{h}_{in}. The same relation holds in every row, so as columns

0⋅u+1⋅hcm−2.54⋅hin=0.0 \cdot \mathbf{u} + 1 \cdot \mathbf{h}_{cm} - 2.54 \cdot \mathbf{h}_{in} = \mathbf{0}.

For the row above, 170−2.54×66.93=170−170.00≈0170 - 2.54 \times 66.93 = 170 - 170.00 \approx 0 (the tiny gap is rounding). The coefficients are not all zero, and the inches column is a multiple of the centimetres column, so the design matrix is rank-deficient. Many coefficient choices fit the data equally well, and the individual height coefficients are not identifiable. The fix is to drop one of the two height columns, which removes the redundant direction.

Tradeoffs and failure modes

Linear independence is an exact property, and real measurements are not exact. Most failures come from confusing the exact idea with a noisy version of it.

SituationWhat goes wrongBetter choice
Vectors are nearly but not exactly dependentDeterminant is tiny but nonzero, so the exact test says "independent" while the answer is unstableUse the singular value decomposition and its condition number
Regression features are correlatedCoefficients swing wildly and are not stableDrop redundant features or use L2 Regularization
Checking dependence of many vectors by handErrors pile upRow reduction or a computer rank routine
Asking for a determinant of a non-square setDeterminant is defined only for square matricesCompute the rank of the matrix instead

A useful habit: when a model or solver behaves strangely, check the rank of its design or coefficient matrix before anything else. A rank smaller than the number of columns is the warning sign.

History

The idea was present long before it had a name. Gaussian elimination, the procedure that reveals dependence in practice, was described by Gauss in the early 1800s while he solved systems of equations, and earlier mathematicians used similar elimination steps.

The abstract notion of linear dependence came from Hermann Grassmann, whose 1844 book Die lineale Ausdehnungslehre treated sets of quantities built by adding and scaling, and studied which ones could be expressed in terms of others. Giuseppe Peano gave the first axiomatic definition of a vector space in 1888, which put the notion on the footing it still uses. Its importance grew with matrix algebra in the 20th century, because the rank of a matrix became the standard measure of how much information a linear system carries.

Check yourself

QuestionIn your own words, what does it mean for a set of vectors to be linearly independent?Show answer

No vector in the set can be written as a combination of the others. Equivalently, the only way to make a sum of scaled vectors equal the zero vector is to scale every one of them by zero. Each vector adds a direction that the others do not provide.

QuestionAre the vectors (1,2,3)(1, 2, 3), (2,4,6)(2, 4, 6) and (0,1,0)(0, 1, 0) linearly independent? Give a nonzero relation if they are not.Show answer

They are dependent. The second vector is twice the first, so 2(1,2,3)−1(2,4,6)+0(0,1,0)=(0,0,0)2(1, 2, 3) - 1(2, 4, 6) + 0(0, 1, 0) = (0, 0, 0). The coefficients (2,−1,0)(2, -1, 0) are not all zero, which is a nonzero relation. The third vector is still a new direction, but the first two already contain the redundancy.

QuestionWhy can four vectors in three-dimensional space never all be linearly independent?Show answer

Each coordinate gives one equation in the unknown coefficients. Four unknown coefficients with only three equations leave a nonzero solution to the homogeneous system, so there is always a nontrivial relation. Geometrically, three coordinates can only support three independent directions, so a fourth arrow must be a combination of the others.

QuestionA regression has 50 features. You find that the feature matrix has rank 47. What does this tell you about the features, and what would you do?Show answer

Three columns are redundant in the sense that they can be built from the others, so the matrix has three dependencies. The least-squares solution is not unique, and the coefficients for those features are not reliable. You would find the dependent columns, usually by inspecting correlations or row reducing the matrix, then drop them or apply L2 Regularization to make the solution unique and stable.

Sources