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 coordinates, you can have at most independent vectors, and a set of 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
Vectors in a vector space are linearly independent if the only solution to
is . If some choice of coefficients that is not all zero makes the sum zero, the vectors are linearly dependent.
Here each is a number (a scalar) that scales one vector, and 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 in a dependent relation, then you can solve for :
So "dependent" means exactly "one vector is a combination of the others".
Matrix form
Stack the vectors as the columns of a Matrix and collect the coefficients into a column vector . The definition becomes
The vectors are independent exactly when this equation has only the trivial solution . 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 .
Key facts
- Two vectors are dependent exactly when one is a scalar multiple of the other.
- Any set that contains the zero vector is dependent. Take the coefficient of to be 1 and all others to be 0.
- Any subset of an independent set is independent.
- In , any set of more than vectors is dependent.
- For vectors in , placed as the columns of a square matrix , the vectors are independent exactly when . 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
Let and . Solve coordinate by coordinate:
- First coordinate: .
- Second coordinate: .
- The second equation is twice the first, so there is only one condition: .
- Choose and . Check: .
A nonzero choice of coefficients gives zero, so the vectors are dependent. This matches fact 1, since . The second arrow lies on the first and adds no direction.
Consider , and .
- Add the first two: .
- So , a nonzero relation. The set is dependent.
- Confirm with the determinant of the matrix whose columns are , , . Expanding along the first row gives . A zero determinant agrees with dependence.
Now swap for .
- Solve . The three coordinates give , and .
- From the first two, and . Substituting into the third gives , so , and then .
- Only the trivial solution exists, so , , are independent. The determinant is , which agrees.
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 . For a person who is 170 cm tall, the row of the design matrix is , since . Call the three columns (ones), and . The same relation holds in every row, so as columns
For the row above, (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.
| Situation | What goes wrong | Better choice |
|---|---|---|
| Vectors are nearly but not exactly dependent | Determinant is tiny but nonzero, so the exact test says "independent" while the answer is unstable | Use the singular value decomposition and its condition number |
| Regression features are correlated | Coefficients swing wildly and are not stable | Drop redundant features or use L2 Regularization |
| Checking dependence of many vectors by hand | Errors pile up | Row reduction or a computer rank routine |
| Asking for a determinant of a non-square set | Determinant is defined only for square matrices | Compute 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 , and linearly independent? Give a nonzero relation if they are not.Show answer
They are dependent. The second vector is twice the first, so . The coefficients 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
- Linear independence (Wikipedia): https://en.wikipedia.org/wiki/Linear_independence
- Vector space (Wikipedia): https://en.wikipedia.org/wiki/Vector_space
- Gaussian elimination (Wikipedia): https://en.wikipedia.org/wiki/Gaussian_elimination