Recommended resources
The freely available resources this lesson will direct you to.
Hello! Welcome back to our course on the mathematical foundations of AI.
In our previous lesson, we established the formal definition of a vector space—the "arena" where vectors exist and interact according to a strict set of axiomatic rules. We also learned how to identify subspaces within these larger spaces.
Today, we will build directly on that foundation to explore the relationships between vectors. This lesson addresses the learning outcome: to determine linear independence/dependence of vectors and define the span of a set of vectors. We will answer two fundamental questions:
- Given a set of vectors, what is the entire region of the space they can "reach"? This is the concept of span.
- Is our set of vectors efficient, or does it contain redundant information? This is the crucial distinction between linear independence and linear dependence.
These concepts are at the heart of linear algebra and are essential for understanding data representation, dimensionality reduction (like PCA, which we'll see later), and the behavior of many machine learning models.
1. Linear Combinations and Span
The most basic way to combine vectors is through a linear combination. Given a set of vectors in a vector space and a set of scalars , the vector defined as:
is a linear combination of those vectors.
The span of the set of vectors is simply the set of all possible linear combinations of these vectors.
To get a formal introduction to this idea, let's turn to a lecture by Professor Gilbert Strang.
9. Independence, Basis, and Dimension
This short clip from an MIT OpenCourseWare lecture concisely defines what it means for a set of vectors to 'span' a space. It directly relates this concept to the column space of a matrix, which you might be familiar with from a more applied context.
Watch the segment from 18:09 to 20:57. Focus on the core definition: the space spanned by a set of vectors consists of all their linear combinations.
As Professor Strang explained, we can formally define the span as follows:
A key property is that the span of any set of vectors in a vector space is always a subspace of . We can prove this using the Subspace Test from our last lesson:
- Zero Vector: The zero vector is in the span, as we can choose all scalars .
- Closure under Addition: The sum of any two linear combinations is itself a linear combination of the same vectors.
- Closure under Scalar Multiplication: A scalar multiple of a linear combination is also a linear combination.
Geometrically, in :
- The span of a single non-zero vector is the line passing through the origin in the direction of .
- The span of two non-collinear vectors and is the plane passing through the origin containing both vectors.
2. Linear Independence and Dependence
Now we turn to the second, related question: is our set of vectors efficient? Or is one of the vectors "redundant" because it's already in the span of the others? This brings us to the idea of linear independence.
To explore the formal definition, we will continue with Professor Strang's lecture.
9. Independence, Basis, and Dimension
This segment introduces the formal definition of linear independence and dependence. It frames the concept around the question: what combinations of a set of vectors produce the zero vector?
Watch from 04:28 to 10:01. Pay close attention to the core definition: a set of vectors is independent if the only linear combination that equals the zero vector is the one where all scalar coefficients are zero.
As defined in the video, a set of vectors is linearly independent if the vector equation:
has only the trivial solution, where .
If there exists a solution where at least one scalar is non-zero, the set is linearly dependent. Such an equation is called a linear dependency relation.
The Equivalence of Definitions
This formal definition might seem abstract. It is, however, equivalent to the more intuitive idea that one vector is a combination of the others. Proving this equivalence is a perfect exercise in the rigorous thinking you aim to develop.
Linear Dependence and Linear Independence
This excerpt from a linear algebra text provides the formal proof for a crucial theorem (Theorem 4.5.6) that bridges the two ways of thinking about linear dependence.
Read the sections 'DEFINITION 4.5.3', 'DEFINITION 4.5.4', and 'Theorem 4.5.6' with its proof. Understand how the proof formally demonstrates that linear dependence is equivalent to one vector being expressible as a linear combination of the others.
The theorem you just read is fundamental. It proves that a set of two or more vectors is linearly dependent if and only if at least one vector in the set is a linear combination of the others. This formally justifies the idea of "redundancy."
3. How to Determine Linear Independence
So, how do we check for linear independence in practice? We can transform the vector equation into a matrix equation.
Consider the vectors in . We can form a matrix where these vectors are the columns: . The linear combination is equivalent to the matrix-vector product , where .
Therefore, the independence condition becomes:
This is a homogeneous system of linear equations. The vectors are linearly independent if and only if this system has only the trivial solution . This occurs precisely when the null space of contains only the zero vector.
The next segment of Professor Strang's lecture explains this crucial connection.
9. Independence, Basis, and Dimension
Here, Professor Strang connects the abstract definition of independence to the practical task of solving a system of linear equations. He explains how the null space of a matrix tells us everything about the dependence or independence of its columns.
Watch from 10:01 to 18:09. Focus on how the problem of determining linear independence is transformed into analyzing the null space of a matrix A. Note the connection between free variables and linear dependence.
This method gives us a concrete algorithm:
- Place the vectors as columns in a matrix .
- Solve the system , typically by row-reducing the augmented matrix .
- If the only solution is (i.e., there are no free variables), the vectors are linearly independent.
- If there are non-trivial solutions (i.e., there is at least one free variable), the vectors are linearly dependent. Any non-trivial solution provides the coefficients for a linear dependency relation.
The image below shows a complete, hand-written example of this process.

Test your understanding!
Consider the vectors , , and in . Are these vectors linearly independent or dependent? Justify your answer by setting up and solving the appropriate system of equations.
Show answer
We want to find scalars such that . This gives the system:
Which corresponds to the system of equations:
From (1), we get . From (2), we get . The third equation is redundant. Since we can choose a non-zero value for (e.g., ), we can find a non-trivial solution. For instance, if , then and .
This gives the linear dependency relation:
Which we can rewrite as .
Since a non-trivial solution exists, the vectors are linearly dependent.
Some Important Consequences
This matrix-based view leads to a very powerful and practical result. Remember that a system of linear equations with more unknowns than equations must have free variables, and therefore must have non-trivial solutions.
In our context, the unknowns are the coefficients , and the number of unknowns is the number of vectors, . The number of equations is the dimension of the space each vector lives in, .
This leads to a key theorem:
Theorem: Any set of vectors in is linearly dependent if .
For example, any set of 3 (or more) vectors in must be linearly dependent. Similarly, any 4 (or more) vectors in must be linearly dependent.
Conclusion
In this lesson, we have explored the fundamental relationships between vectors within a vector space. These concepts are not just abstract definitions; they provide the language to describe the structure of data.
Here are the key takeaways:
- The span of a set of vectors is the subspace of all possible vectors that can be formed by their linear combinations.
- A set of vectors is linearly independent if no vector in the set can be written as a linear combination of the others. Formally, the only way to sum them to the zero vector is by using all-zero coefficients.
- A set of vectors is linearly dependent if it contains at least one "redundant" vector that is already in the span of the others.
- The standard method for determining independence is to form a matrix with the vectors as columns and test if the system has non-trivial solutions. The existence of free variables implies linear dependence.
- A set of vectors in is guaranteed to be linearly dependent if .
Now that we understand how to generate a space (span) and how to describe an efficient set of vectors (linear independence), the next logical step is to combine them. In our next lesson, we will define a basis for a vector space—a special set of vectors that is both linearly independent and spans the entire space. This will lead us to one of the most important concepts in linear algebra: the dimension of a vector space.