Intuitively, if a set of vectors is linearly dependent, then at least one of the vectors is a linear combination of the others. If we think of vectors as building blocks, if a set of vectors is linearly dependent, then at least one of the building blocks is redundant, because you can create it from the other building blocks.
Equivalently, if a set of vectors is linearly dependent, there’s a non-trivial linear combination of the vectors that equals the zero vector (by non-trivial, I mean that at least one of the coefficients is non-zero).
Why are these two conditions equivalent? Here’s one way to see it. Suppose v1=αv2+βv3, meaning that v1 can be written as a linear combination of v2 and v3. Rearranging the equation above gives us
v1−αv2−βv3=0
which shows us a non-trivial linear combination of v1,v2,v3 that gives 0. The converse (reverse direction) is true too: if you start with a non-trivial linear combination of v1,v2,…,vd that gives 0, then you can rearrange it to get v1=some linear combination of v2,…,vd.
Let’s look at several sets of vectors and comment on their linear independence (or lack thereof).
Vectors
Linearly...
Why?
⎣⎡103⎦⎤,⎣⎡215⎦⎤
Independent
Neither is a multiple of the other.
⎣⎡103⎦⎤,⎣⎡215⎦⎤,⎣⎡5210⎦⎤,⎣⎡111⎦⎤
Dependent
These vectors live in R3, which is a universe that only has 3 independent directions, so you only need 3 vectors to span it. Give 4 vectors, we can write at least one of them as a linear combination of the others.
⎣⎡103⎦⎤,⎣⎡215⎦⎤,⎣⎡5213⎦⎤
Dependent
first vector+2(second vector)=third vector
⎣⎡103⎦⎤,⎣⎡215⎦⎤,⎣⎡5210⎦⎤
Independent
The first two were already linearly independent from the first example, and we can’t write the third as a linear combination of the first two.
Note that if a set of vectors is linearly dependent, it doesn’t mean that every vector in the set can be written as a linear combination of the others. It just means that there’s at least one vector that can be written as a linear combination of the others. A good go-to example for this is the one below – v1 and v2 are scalar multiples of each other, making the entire set of three vectors linearly dependent, but v3 is not a linear combination of v1 and v2.
Fact: If a set of vectors v1,v2,…,vd∈Rn is linearly independent, then any vector b∈Rn in the span of the vectors can be written as a unique linear combination of the vectors.
We’ve built intuition for this above; now let’s give a formal proof. But first, note that the statement assumes that b∈span({v1,v2,…,vd}) to begin with: it is not saying that if v1,v2,…,vd∈Rn are linearly independent, then any b∈Rn can be written as a linear combination of the vectors. That’s not true. The vectors v1=⎣⎡100⎦⎤ and v2=⎣⎡010⎦⎤ are linearly independent, but b=⎣⎡001⎦⎤ is not a linear combination of the first two. Hopefully, the fact above is a little more clear now. (Re-read it again before proceeding to the next paragraph.)
Let’s imagine an alternate universe where b∈span({v1,v2,…,vd}) can be written as two different linear combinations of the vectors. (We’re doing a proof by contradiction, if you’re familiar with the idea.) In other words, suppose
a1v1+a2v2+…+advd=b
and
c1v1+c2v2+…+cdvd=b
and not all of the ai and ci are equal, meaning there’s at least one i such that ai=ci.
What happens if we subtract the two equations?
(a1−c1)v1+(a2−c2)v2+…+(ad−cd)vd=0
Since v1,v2,…,vd are linearly independent, the only way this equation can hold is if all of the coefficients on the vi are zero. In other words, we’d need
a1−c1=0a2−c2=0…ad−cd=0
But if that’s the case, then ai=ci for all i, which contradicts our assumption that not all of the ai and ci are equal.
So, this means that it can’t be the case that b can be written as two different linear combinations of the vectors. In other words, if b∈span({v1,v2,…,vd}) and v1,v2,…,vd are linearly independent, then b can be written as a unique linear combination of the vectors.
Linearly independent vectors are desirable, since there’s only one way to use them as building blocks to create any other vector in their span.
Suppose v1,v2,…,vd∈Rn are an orthogonal set of vectors, meaning that for any i=j, vi⋅vj=0. (Assume that the vectors are non-zero.)
In Lab 5, you’ll show that any vector b∈span({v1,v2,…,vd}) can be written as a linear combination of the vectors by projecting b onto each of the vectors vi.
Here, prove that the vectors v1,v2,…,vd are linearly independent. By doing this, you are showing that orthogonality is a stronger condition than linear independence.
Solution
In order for v1,v2,…,vd to be linearly independent, we need to show that the only solution to
a1v1+a2v2+…+advd=0
is a1=a2=…=ad=0. Otherwise, there must exist some other non-zero solution for the ai’s.
Let’s start with the equation above and take the dot product of both sides with v1.
(a1v1+a2v2+…+advd)⋅v1=0⋅v1
This expands to
a1(v1⋅v1)+a2(v2⋅v1)+…+ad(vd⋅v1)=0
Since v1,v2,…,vd are orthogonal, we know that vi⋅vj=0 for all i=j. This means that the only non-zero term in the equation above is a1(v1⋅v1). So, we’re left with
a1(v1⋅v1)=0
Since v1 is non-zero, we can divide both sides by v1⋅v1 to get a1=0.
We can repeat this process for each of the vectors v2,…,vd to show that a2=…=ad=0, meaning that the only solution to a1v1+a2v2+…+advd=0 is a1=a2=…=ad=0, meaning that v1,v2,…,vd are linearly independent.
Algorithm for Finding Linearly Independent Subsets with the Same Span¶
Given a set of vectors v1,v2,…,vd∈Rn, we’d like to find a subset of the vectors that is linearly independent and has the same span as the original set of vectors. In Chapter 4.3, we’ll call this subset a basis for the span of the original set of vectors.
In other words, we’d like to “drop” the vectors that are linearly dependent on the others. For example, if we have 3 vectors in R3 and they span a plane, we can drop one of them and still span the same plane (not just any plane), because a plane is a 2-dimensional space, and you only need 2 vectors to span a plane.
In the example below, we can remove any one of the three vectors (which all point in different directions), and the span of the remaining two is still the exact same plane!
Dropping any “unnecessary” vectors will give us the desirable property that any vector in the span of the original set of vectors can be written as a unique linear combination of the vectors in the subset. (Remember that this has a connection to finding optimal model parameters in linear regression – this is not just an arbitrary exercise in theory.)
One way to produce a linear independent subset is to execute the following algorithm:
given v_1, v_2, ..., v_d
initialize linearly independent set S = {v_1}
for i = 2 to d:
if v_i is not a linear combination of S:
add v_i to S
The vectors we add to S are a basis for the span of the original set of vectors. The number of vectors we’re left with is the dimension of the span of the original set of vectors. Again, these are ideas we formalize in Chapter 4.3.
Let’s evaluate this algorithm on the following set of vectors:
Iteration 1 (i=2): Is v2 a linear combination of the vectors in S? No, since v2 is not a multiple of v1. The first components (3 in v1, 0 in v2) imply that if v2 were a multiple of v1 it’d need to be 0v1, but the other components of v2 are non-zero.
Outcome: Add v2 to S. Now, S={v1,v2}.
Iteration 2 (i=3): Is v3 a linear combination of the vectors in S? To determine the answer, we need to try and find scalars a1 and a2 such that a1v1+a2v2=v3.
The first equation implies a1=−1 and the third equation implies a2=2. Plugging both into the second equation gives 4(−1)+1(2)=−2, which is consistent. This means that v3=−v1+2v2, so v3 is a linear combination of v1 and v2, and we should not add it to S.
Outcome: Leave S unchanged. Now, S={v1,v2}.
Iteration 4 (i=4): Is v4 a linear combination of the vectors in S? To determine the answer, we need to try and find scalars a1 and a2 such that a1v1+a2v2=v4.
Similarly, we see that a1=2 (from the first equation) and a2=−3 (from the third equation) are consistent with the second equation. This means that v4=2v1−3v2, so v4 is a linear combination of v1 and v2, and we should not add it to S.
Outcome: Leave S unchanged. Now, S={v1,v2}.
Iteration 5 (i=5): Is v5 a linear combination of the vectors in S? To determine the answer, we need to try and find scalars a1 and a2 such that a1v1+a2v2=v5.
The first equation implies a1=32 and the third equation implies a2=1. Plugging both into the second equation gives 4(32)+1(1)=311=5, which means the system is inconsistent. So, v5 is not a linear combination of v1 and v2, and we should add it to S.
Outcome: Add v5 to S. Now, S={v1,v2,v5}.
v1,v2,v5 are linearly independent vectors that have the same span as the original set of vectors. And since these are 3 linearly independent vectors in R3, their span is all of R3, since R3 is 3-dimensional and only has 3 independent directions to begin with! If there were more vectors in our list, they would surely be linearly dependent on S={v1,v2,v5}, and so we wouldn’t need to consider them.
Note that the subset that this algorithm produces is not unique, meaning that there exist other subsets of 3 of {v1,v2,v3,v4,v5} that are also linearly independent and have the same span as all of {v1,v2,v3,v4,v5} do (which is also the span of {v1,v2,v5}) If you started with v5, then considered v4, then considered v3, and so on, you’d end up with a subset that includes v4, for instance.
What is fixed, though, is how many linearly independent vectors you need to span the entire subspace that these five vectors span, and the answer to that is 3.
Homework 4 and Lab 5 will have you practice this algorithm several times, though – as mentioned above – we’ll use the power of Python to handle some of this for us, soon.
To recap what we’ve covered in this section, answer the following questions.
Can any three vectors in R2 be linearly independent?
Must any two vectors in R2 be linearly independent?
If two vectors in R3 are linearly independent, what do they span?
If three vectors in R3 are linearly independent, what do they span?
Given d vectors in Rn, what must be true about d and n for it to be possible for the vectors to be linearly independent?
Solutions
Can any three vectors in R2 be linearly independent? No. Any three vectors in R2 must be linearly dependent, since R2 is only 2-dimensional. Intuitively, R2 only has two independent directions, and so you only need two vectors to reach every vector in it. Given a third, you can always write it as a linear combination of the first two.
Must any two vectors in R2 be linearly independent? No. They could be collinear, like with [12] and [24].
If two vectors in R3 are linearly independent, what do they span? A plane.
If three vectors in R3 are linearly independent, what do they span? All of R3.
Given d vectors in Rn, what must be true about d and n for it to be possible for the vectors to be linearly independent? d≤n. If d>n, then at least one of them must be a linear combination of the others, since Rn only has n independent directions.
Here’s one final abstract activity to think about. Answers aren’t provided since there’s a very similar question on Homework 5. But come ask us questions about it in office hours!