Articles / Linear Algebra · Part 9

Dimension and Linear Independence

Understand linear independence, linear dependence, and dimension with step-by-step examples. Learn how to test vectors using row reduction and discover how dimension describes independent directions in vector spaces.

Dimension and Linear Independence

Introduction

In linear algebra, a collection of vectors may contain information that is essential, redundant, or even insufficient to represent an entire vector space.

For example, two vectors may point in different directions and provide independent information. But if one vector can be constructed from the other, adding it does not provide a new direction.

This leads us to two important concepts: linear independence and dimension.

Linear independence helps us determine whether vectors contain redundant information. Dimension tells us how many independent directions are needed to describe a vector space.

In this article, we’ll explore:

  1. What is linear independence?
  2. Linear dependence.
  3. How to test vectors for independence.
  4. Using systems of equations and row reduction.
  5. What is dimension?
  6. Dimension of common vector spaces.
  7. Relationship between basis and dimension.
  8. Applications in computer science and machine learning.

1. What Is Linear Independence?

A collection of vectors is called linearly independent if none of the vectors can be expressed as a linear combination of the others.

In other words, every vector contributes a unique direction or piece of information.

Consider two vectors:

\[
\mathbf{v}_1=
\begin{bmatrix}
1\
0
\end{bmatrix},
\qquad
\mathbf{v}_2=
\begin{bmatrix}
0\
1
\end{bmatrix}
\]

Neither vector can be obtained by multiplying the other by a scalar.

They point in different directions and are linearly independent.

Formal Definition

A set of vectors (\mathbf{v}_1,\mathbf{v}_2,\ldots,\mathbf{v}_n) is linearly independent if the equation

\[
c_1\mathbf{v}_1+c_2\mathbf{v}_2+\cdots+c_n\mathbf{v}_n=\mathbf{0}
\]

has only the trivial solution:

\[
c_1=c_2=\cdots=c_n=0
\]

The trivial solution means that every coefficient is zero.

If there is any other solution where at least one coefficient is nonzero, the vectors are linearly dependent.


2. What Is Linear Dependence?

A collection of vectors is linearly dependent if at least one vector can be expressed as a linear combination of the others.

This means the collection contains redundant information.

Consider:

\[
\mathbf{v}_1=
\begin{bmatrix}
1\
2
\end{bmatrix},
\qquad
\mathbf{v}_2=
\begin{bmatrix}
2\
4
\end{bmatrix}
\]

Notice that:

\[
\mathbf{v}_2=2\mathbf{v}_1
\]

The second vector is simply twice the first vector.

It does not introduce a new direction.

Therefore, these vectors are linearly dependent.

Using the Formal Definition

Let’s check using the equation:

\[
c_1\mathbf{v}_1+c_2\mathbf{v}_2=\mathbf{0}
\]

Substitute the vectors:

\[
\begin{bmatrix}
0\
0
\end{bmatrix}
\]

This gives:

\[
\begin{aligned}
c_1+2c_2&=0\
2c_1+4c_2&=0
\end{aligned}
\]

The second equation is simply twice the first equation.

Therefore, there are infinitely many solutions.

For example, choosing (c_2=1) gives (c_1=-2).

So we have a nontrivial solution:

\[
c_1=-2,\qquad c_2=1
\]

Since a nontrivial solution exists, the vectors are linearly dependent.


3. How to Test Linear Independence

We can determine whether vectors are linearly independent by checking whether the equation formed by their linear combination equaling the zero vector has only the trivial solution.

Let’s examine an example.

Consider:

\[
\mathbf{v}_1=
\begin{bmatrix}
1\
2
\end{bmatrix},
\qquad
\mathbf{v}_2=
\begin{bmatrix}
3\
1
\end{bmatrix}
\]

We want to determine whether they are linearly independent.

Start with:

\[
c_1\mathbf{v}_1+c_2\mathbf{v}_2=\mathbf{0}
\]

Substitute:

\[
\begin{bmatrix}
0\
0
\end{bmatrix}
\]

This gives the system:

\[
\begin{aligned}
c_1+3c_2&=0\
2c_1+c_2&=0
\end{aligned}
\]

From the first equation:

\[
c_1=-3c_2
\]

Substitute into the second:

\[
2(-3c_2)+c_2=0
\]

\[
-6c_2+c_2=0
\]

\[
-5c_2=0
\]

\[
c_2=0
\]

Therefore:

\[
c_1=0
\]

The only solution is:

\[
\boxed{c_1=c_2=0}
\]

Hence, the vectors are linearly independent.


4. Testing Independence Using Row Reduction

For larger collections of vectors, solving equations manually can become difficult.

We can arrange the vectors into a matrix and use Gaussian elimination or row reduction.

Consider three vectors:

\[
\mathbf{v}_1=
\begin{bmatrix}
1\
2\
1
\end{bmatrix},
\quad
\mathbf{v}_2=
\begin{bmatrix}
2\
1\
0
\end{bmatrix},
\quad
\mathbf{v}_3=
\begin{bmatrix}
3\
3\
1
\end{bmatrix}
\]

Place them as columns of a matrix:

\[
A=
\begin{bmatrix}
1&2&3\
2&1&3\
1&0&1
\end{bmatrix}
\]

To test linear independence, we solve:

\[
A\mathbf{c}=\mathbf{0}
\]

Where:

\[
\mathbf{c}=
\begin{bmatrix}
c_1\
c_2\
c_3
\end{bmatrix}
\]

We row-reduce the matrix.

Starting with:

\[
\begin{bmatrix}
1&2&3\
2&1&3\
1&0&1
\end{bmatrix}
\]

Apply:

\[
R_2\rightarrow R_2-2R_1
\]

\[
R_3\rightarrow R_3-R_1
\]

We obtain:

\[
\begin{bmatrix}
1&2&3\
0&-3&-3\
0&-2&-2
\end{bmatrix}
\]

Now eliminate the entry in the third row:

\[
R_3\rightarrow 3R_3-2R_2
\]

This gives:

\[
\begin{bmatrix}
1&2&3\
0&-3&-3\
0&0&0
\end{bmatrix}
\]

The matrix contains a zero row, meaning there is not a pivot in every column.

Therefore, the vectors are linearly dependent.

Indeed, notice that:

\[
\mathbf{v}_3=\mathbf{v}_1+\mathbf{v}_2
\]

The third vector can be constructed from the first two, so it is redundant.

The Pivot Rule

When vectors are placed as columns of a matrix:

  • A pivot in every column means the vectors are linearly independent.
  • If at least one column has no pivot, the vectors are linearly dependent.

This is a very useful method when dealing with larger collections of vectors.


5. What Is Dimension?

Dimension describes the number of independent directions in a vector space.

More formally, the dimension of a vector space is the number of vectors in any basis of that space.

A basis must:

  1. Span the vector space.
  2. Be linearly independent.

The number of vectors in a basis is therefore the dimension.

Example: Dimension of (\mathbb{R}^2)

The standard basis is:

\[
\mathbf{e}_1=
\begin{bmatrix}
1\
0
\end{bmatrix},
\qquad
\mathbf{e}_2=
\begin{bmatrix}
0\
1
\end{bmatrix}
\]

These two vectors are linearly independent and span the entire plane.

Therefore:

\[
\boxed{\dim(\mathbb{R}^2)=2}
\]

The plane has two independent directions.

Example: Dimension of (\mathbb{R}^3)

The standard basis is:

\[
\mathbf{e}_1=
\begin{bmatrix}
1\
0\
0
\end{bmatrix},
\quad
\mathbf{e}_2=
\begin{bmatrix}
0\
1\
0
\end{bmatrix},
\quad
\mathbf{e}_3=
\begin{bmatrix}
0\
0\
1
\end{bmatrix}
\]

These three vectors span three-dimensional space and are linearly independent.

Therefore:

\[
\boxed{\dim(\mathbb{R}^3)=3}
\]

Example: Dimension of a Line Through the Origin

A line through the origin can be represented using one nonzero vector.

For example:

\[
\mathbf{v}=
\begin{bmatrix}
2\
3
\end{bmatrix}
\]

Every vector on the line can be represented as:

\[
c\mathbf{v}
\]

Only one independent direction is needed.

Therefore, the dimension of the line is 1.


6. Dimension and Basis

Dimension tells us how many vectors are required in a basis, but a vector space may have many different bases.

Consider \(\mathbb{R}^2\).

Its standard basis is:

\[
\left\{
\begin{bmatrix}
1\
0
\end{bmatrix},
\begin{bmatrix}
0\
1
\end{bmatrix}
\right\}
\]

Another possible basis is:

\[
\left\{
\begin{bmatrix}
1\
1
\end{bmatrix},
\begin{bmatrix}
1\
-1
\end{bmatrix}
\right\}
\]

Both sets contain two linearly independent vectors and span the entire plane.

Therefore, both are bases of (\mathbb{R}^2).

The dimension remains 2 regardless of which basis we choose.

This is an important property:

Every basis of a vector space contains the same number of vectors.

That number defines the dimension of the space.


7. Important Results About Linear Independence and Dimension

Some useful results follow from these concepts.

1. More Vectors Than the Dimension Means Dependence

If we have more vectors than the dimension of the space, those vectors must be linearly dependent.

For example, in \(\mathbb{R}^2\), any collection of three vectors must be linearly dependent.

There cannot be three linearly independent vectors in a two-dimensional space.

2. Fewer Vectors Than the Dimension Cannot Span the Entire Space

In \(\mathbb{R}^3\), two vectors cannot span the entire three-dimensional space.

At most, they can span a plane or a line.

3. A Basis Contains Exactly the Required Independent Directions

A basis contains enough vectors to span the space, but no redundant vectors.

For \(\mathbb{R}^3\), a basis contains exactly three linearly independent vectors.

For \(\mathbb{R}^5\), a basis contains exactly five.

4. The Zero Vector Makes a Set Dependent

Any collection containing the zero vector is linearly dependent.

For example:

\[
\begin{bmatrix}
0\
0
\end{bmatrix}
\]

This equation has nontrivial solutions, such as (c=1).

Therefore, a set containing the zero vector cannot be linearly independent.


8. Applications in Computer Science and Machine Learning

Linear independence and dimension are not just mathematical concepts. They help us understand data, algorithms, and computational systems.

1. Detecting Redundant Features

Suppose a dataset contains three features:

  • Height in centimetres.
  • Height in metres.
  • A third feature calculated as twice the height in metres.

These features contain redundant information because some can be derived from others.

Redundant features may create problems in models and calculations.

Linear independence helps identify such redundancy.

2. Data Dimensionality

Suppose a dataset has 100 features.

However, if only 10 independent directions are needed to represent its information, the data may contain redundant dimensions.

Understanding dimension helps us think about reducing unnecessary complexity.

3. Solving Linear Systems

The independence of columns in a coefficient matrix helps determine whether a system has unique solutions.

When the columns are independent, the matrix has full column rank.

This is important in solving systems of equations and understanding their behaviour.

4. Machine Learning Models

Linear models combine features using weighted sums.

If some features are linearly dependent, different combinations of weights may produce the same predictions.

This can affect how uniquely model parameters can be determined.

Understanding independence helps explain these situations.


9. Summary

In this article, we explored linear independence, linear dependence, and dimension.

  • Linear Independence: A set of vectors is independent if the only combination producing the zero vector is the trivial solution.
  • Linear Dependence: A set is dependent if a nontrivial combination produces the zero vector.
  • Dimension: The number of vectors in a basis of a vector space.
  • Basis: A set of vectors that spans a space and is linearly independent.
  • Row Reduction: A practical method for testing independence by checking whether every column contains a pivot.

We learned that independent vectors provide unique directions, while dependent vectors contain redundancy.

Dimension tells us how many independent directions are required to describe a space.

These concepts are essential for understanding vector spaces, matrix rank, systems of equations, and dimensionality reduction.

What’s Next?

We now understand how to identify independent vectors and determine the dimension of a vector space.

But matrices contain more structure than just their columns. They also have row spaces, column spaces, and null spaces.

How are these spaces related? What does the rank of a matrix tell us? And how does the number of independent columns relate to the solutions of a system?

These questions lead us to our next article:

Article 10: Rank-Nullity Theorem: Row Space, Column Space, and Null Space

We’ll explore the fundamental spaces associated with matrices, understand rank and nullity, and learn how they are connected by the Rank-Nullity Theorem.

Quick quiz

5 questions
When are vectors linearly independent?
If one vector can be expressed as a linear combination of the others, the vectors are:
What does the dimension of a vector space represent?
Three vectors in \(\mathbb{R}^2\) must be:
What does a pivot in every column of a matrix indicate when its columns represent vectors?

Keep a copy

Read offline as a printout or PDF.

farhanpaal.com

Keep reading

Ask Farhan

Ask anything about Farhan