Lecture 3 · Week 1· 20:52
Linear combinations and span
Combinations a v + b w, span of one, two, three vectors.
Saved in this browser only. No account needed.
TranscriptThe full text of the lecture. Click any sentence to play the video from there.
Linear combinations
Welcome back. In the last lecture we met the two basic operations on vectors. We can add two vectors, placing them tip to tail. And we can scale a vector, multiplying it by a number. Today we put the two operations together. Take two vectors, v and w. First, scale each one: multiply v by a number a, and multiply w by a number b. Then add the two results, tip to tail. The vector a v plus b w is called a linear combination of v and w. The numbers a and b are its weights, or coefficients. There is nothing special about two vectors. Here is the general definition. Given vectors v one up to v k in R n, and scalars c one up to c k, the vector c one v one, plus c two v two, and so on up to c k v k, is a linear combination of v one through v k, with weights c one through c k.
The weights can be any real numbers: positive, negative, fractions, or zero. And the result is always a vector in the same space, R n. Let's compute one. Take v equal to (two, one), and w equal to (minus one, one), and form three times v plus two times w. First we scale. Three times v multiplies each entry by three. Three times two is six, and three times one is three.
Two times w multiplies each entry by two. Two times minus one is minus two, and two times one is two. Now we add, one coordinate at a time. In the first coordinate, six plus minus two is four. In the second coordinate, three plus two is five.
So three v plus two w is the vector (four, five). On the plane, we walk three copies of v, then two copies of w, and we land at the point (four, five). Notice two special cases. If every weight is zero, we get the zero vector. And if one weight is one and all the others are zero, we get that vector itself. So the zero vector, and each of the vectors we started with, are always linear combinations of them.
All combinations of two vectors
Now fix v and w, and let the weights vary. Each choice of a and b gives one vector. What do we get when we try every possible choice? Hold b at zero, and let a vary. The combinations a v trace out the whole line through the origin in the direction of v. In the same way, the multiples of w fill the line through the origin along w. Now let both weights vary. Draw the lines where a is a whole number, and the lines where b is a whole number. Together they form a slanted grid, built from v and w the same way the usual grid is built from the two axes.
Every crossing point of this grid is a combination with whole number weights. Here is three v plus two w, at the point (four, five). And here is minus v plus w, at the point (minus three, zero). Points between the grid lines need fractional weights. The weights work like coordinates, measured along v and w instead of along the axes. As a and b sweep through all real numbers, the combinations seem to cover the plane, with no gaps. In lecture one we asked whether we could reach the point (one, five) using these two vectors. On the slanted grid we can read off the answer: two steps along v, and three steps along w. That matches the solution we found then, x equals two and y equals three.
But can we really reach every point? And how would we know for sure? To answer that, we need a name for the set of all combinations.
Span
Here is the central definition of today's lecture. The span of vectors v one through v k is the set of all their linear combinations. In symbols, the span of v one through v k is the set of all vectors c one v one, plus up to c k v k, where the weights c one through c k range over all real numbers. Notice the difference between the two ideas. A linear combination is a single vector. The span is a set: usually an infinite set, containing every combination at once.
To say that a vector b is in the span means that b can be built from v one through v k. There are weights that combine them to give exactly b. Here is one way to picture a span. The vectors are the directions you are allowed to travel in, and you may go any distance along each of them, forwards or backwards. The span is every place you can reach. Let's start with the smallest case, the span of a single vector. A combination of one vector v is just a multiple, c times v. So the span of v is the set of all multiples of v.
If v is not the zero vector, its multiples fill the whole line through the origin in the direction of v. Positive multiples lie on one side, negative multiples on the other, and zero times v sits at the origin. For example, the vector (six, three) is three times (two, one), so it lies in the span. But the vector (one, one) does not. Every multiple of (two, one) has a first entry twice its second. If v is the zero vector, every multiple of it is zero. So the span of the zero vector is the set containing only the zero vector: a single point.
One consequence is worth noticing. Every span contains the zero vector, the combination with all weights zero. So a line through the origin is a span, but a line that misses the origin is never a span.
Two vectors in the plane
Now two vectors in the plane. Take v equal to (two, one) and w equal to (minus one, one) again. The slanted grid suggested that their span is the whole plane. Let's prove it. Pick any vector in the plane, with entries x and y. We want weights a and b so that a v plus b w equals the vector (x, y). Compare the entries, one coordinate at a time. In the first coordinate, two a minus b must equal x.
In the second coordinate, a plus b must equal y. Now we solve. Adding the two equations eliminates b. The left sides add up to three a, and the right sides add up to x plus y. So three a equals x plus y. Dividing by three, a is x plus y, over three.
For b, the second equation says that b equals y minus a. That is y, minus x plus y over three. Writing y as three y over three, this becomes three y minus x minus y, over three, which is two y minus x, over three. So what have we found? Choose any point in the plane, with coordinates x and y. These two formulas turn x and y into weights a and b, and the combination a v plus b w lands exactly on that point. Wherever the point is, we can reach it. That is a strong claim, so let's check carefully that these weights really work, one coordinate at a time.
Start with the first coordinate. There we need two a minus b to equal x. So we put in the two formulas, and see whether we really get x. Two times x plus y over three is two x plus two y, over three. Then we subtract b, which is two y minus x, over three. Both fractions have the same denominator, so we get two x plus two y minus two y plus x, all over three.
The two y terms cancel, and two x plus x is three x. Three x over three is x. So the first coordinate is right. Now the second coordinate. There we need a plus b to equal y. Putting in the formulas, a plus b is x plus y, plus two y minus x, all over three.
This time the x terms cancel, and y plus two y is three y. Three y over three is y. So the second coordinate is right too. So every vector in the plane is a combination of v and w. The span of v and w is all of R two. Let's see the formulas at work on a point we already know. For the point (one, five), x is one and y is five.
Then a is one plus five, over three, which is six over three, so two. And b is two times five minus one, over three, which is nine over three, so three. Let's plug in and check. Two times v is (four, two), and three times w is (minus three, three). In the first coordinate, four plus minus three is one. In the second coordinate, two plus three is five. We land exactly on (one, five), just as the slanted grid showed.
When does this fail? Take v equal to (two, one), and w equal to (four, two). Now w is just two times v. Every combination a v plus b w equals a plus two b, times v. That is a multiple of v, so the span is only the line through v. The same thing happens whenever one of the two vectors is a multiple of the other. Such vectors are called parallel. Adding a parallel vector gives us no new direction. Notice that the zero vector counts as parallel to every vector, because it is zero times any vector. That fits: the zero vector adds no new direction either. Here is the general statement. Theorem: two vectors in R two span the whole plane exactly when neither one is a multiple of the other. Otherwise their span is a line through the origin, or just the origin if both vectors are zero.
The next part is the most demanding step of the lecture, so it is worth pausing here, or rewatching it slowly. Write v as (p, q) and w as (r, s), and look for weights a and b with a v plus b w equal to (x, y). Comparing entries gives two equations. p a plus r b equals x, and q a plus s b equals y. To eliminate b, multiply the first equation by s, multiply the second by r, and subtract. The b terms cancel, and we are left with p s minus q r, times a, equals s x minus r y.
To eliminate a, multiply the second equation by p, multiply the first by q, and subtract. This time we get p s minus q r, times b, equals p y minus q x. Both equations share the number p s minus q r. If it is not zero, we divide by it. Then a is s x minus r y, over p s minus q r, and b is p y minus q x, over the same number. Substituting back confirms that these weights work. In the first coordinate, p times s x minus r y, plus r times p y minus q x, simplifies to p s minus q r, times x. In the second coordinate, the same steps give p s minus q r, times y. Dividing by p s minus q r leaves exactly x and y.
So if p s minus q r is not zero, every vector of the plane can be reached. And this number is zero exactly when the two vectors are parallel, including the case where one of them is the zero vector. If w is c times v, then r is c p and s is c q, so p s minus q r is p c q minus q c p, which is zero. Conversely, suppose p s minus q r is zero. If p is not zero, then s equals q r over p, so w is r over p, times v. The cases where p is zero are just as short, and the book writes them out. This number, p s minus q r, will come back in week nine. It is the determinant, and it measures the area of the parallelogram that v and w span.
Try it yourself (lesson widget, part of Section 4)
You can explore this yourself. The lesson page for this lecture, on opensemester dot com, has a figure where you move v, w and a target point. Here are our two vectors and their slanted grid. The sliders set the weights: a copies of v, then b copies of w. With three and two, we land on (four, five) again. Now drag the gold target anywhere in the plane, and press find a and b. Because v and w are not parallel, every target can be reached, with exactly one pair of weights.
Next, drag w until it lines up with v. The grid collapses onto a single gold line. Every combination stays on that line, and a target off the line can no longer be reached. Try a few pairs of your own, and predict the shape of the span before you look.
Spans in three dimensions
In R three there is more room, and spans come in more shapes. The span of a single nonzero vector is still a line through the origin. Two vectors that are not parallel span a plane through the origin. Every combination a v plus b w lies in the flat sheet that contains both arrows, and the slanted grid of v and w covers that whole sheet. But a plane is not all of R three. For example, take v equal to (one, zero, zero) and w equal to (zero, one, zero). They span the horizontal plane, made of the vectors whose third entry is zero. The vector (zero, zero, one) points straight up, and no combination of the first two can reach it.
Now add a third vector, u. If u already lies in the plane of v and w, it adds nothing, and the span is still that plane. For example, the vector (one, one, zero) is v plus w, and including it leaves the span unchanged. If u points out of the plane, the three vectors span all of R three. To reach any point in space, go along u until you are level with the point, then move within a copy of the plane. So in R three, a span always has one of four shapes: the origin alone, a line through the origin, a plane through the origin, or the whole space. Which shape we get depends not on how many vectors we have, but on how many genuinely new directions they contribute.
Counting those new directions precisely leads to linear independence and to dimension, the subjects of lecture eleven and of week five.
Properties of the span
Spans have a few properties that we will use constantly. Let S be the span of v one through v k. First, S contains the zero vector, and it contains each of the vectors v one through v k. We saw why: choose all weights zero, or choose one weight equal to one and the rest zero. Second, S is closed under addition. If two vectors are in S, so is their sum. This may look obvious, but it is what lets us work inside a span without ever falling out of it, and the same argument returns for every subspace in the course. Here is the proof.
Suppose x equals c one v one, plus up to c k v k, and y equals d one v one, plus up to d k v k. Then x plus y is the sum of these two long expressions. Using commutativity and associativity from the last lecture, we may reorder the terms, so that the two terms with v one sit together, then the two terms with v two, and so on up to v k.
By the distributive law, c one v one plus d one v one is c one plus d one, times v one. The same happens for every other vector. The result is again a linear combination of v one through v k, so x plus y is in S. Third, S is closed under scalar multiplication. Take x in S, and any scalar t.
Multiplying by t and distributing gives t times c one v one, plus up to t times c k v k. Grouping each t with its weight, this is t c one, times v one, and so on. Again a combination, so t x is in S. A set that contains the zero vector and is closed under addition and scaling is called a subspace. Spans are the most important example, and subspaces are a main topic of week five. One more fact. Adding a vector that is already in the span does not make the span any bigger. Theorem: if u is in the span of v one through v k, then the span of v one through v k together with u is the same set as the span of v one through v k.
The proof is short but dense, so take it slowly, and pause if you need to. First, every combination of the v's is also a combination of the v's and u, with weight zero on u. So the old span is contained in the new one. For the other direction, write u as a combination, d one v one, plus up to d k v k. Now take any combination of all the vectors: c one v one, up to c k v k, plus c times u. Substitute the expression for u.
Distributing c, and grouping the terms with each v, we get c one plus c d one, times v one, and so on, up to c k plus c d k, times v k. That is a combination of the v's alone. So the new span is contained in the old one, and the two sets are equal. That is exactly what we saw in R three. The vector (one, one, zero) was already in the span of the first two, so including it added nothing.
Is a vector in the span?
We end with the central computational question. Given vectors v one through v k and a target vector b, is b in their span? Let's try it in R three. Let v be (one, zero, one), let w be (zero, one, one), and let b be the vector (one, two, three). Is b in the span of v and w? We need weights x and y so that x times v plus y times w equals b. Substituting the three vectors, this becomes a single equation between columns.
Compare the entries, one coordinate at a time. In the first coordinate, x times one plus y times zero is x, so x must equal one. In the second coordinate, x times zero plus y times one is y, so y must equal two. In the third coordinate, x plus y must equal three. With x equal to one and y equal to two, x plus y is three. It works.
So b equals one times v plus two times w, and b is in the span. Now change the target to (one, two, four). The first two coordinates still force x equal to one and y equal to two. But then the third coordinate gives three, not four. No weights work, so this vector is not in the span. Geometrically, it lies off the plane spanned by v and w. In both cases the question was really a system of linear equations, with one equation for each coordinate and one unknown for each weight. Asking whether b is in the span is the same as asking whether that system has a solution.
In weeks two and three we will learn Gaussian elimination, a method that answers this question for any number of vectors, in any dimension.
Summary
Let's summarise. A linear combination of v one through v k is a sum c one v one, plus up to c k v k, with any real weights. We compute it one coordinate at a time. The span of v one through v k is the set of all their linear combinations. It always contains the zero vector and each of the v's, and it is closed under addition and scaling. A nonzero vector spans a line through the origin. In the plane, two vectors that are not parallel span everything. In space, a span is the origin, a line, a plane, or all of R three.
Adding a vector that is already in the span changes nothing. And deciding whether a vector is in a span means solving a system of linear equations. Before the next lecture, read section one point three of the course book, and try the problems on span in sheet one. Next time, we start measuring vectors, with the dot product, length, and angle. See you there.
In this lecture
Materials
Try it
Reach a target with a v + b w
Drag the tips of v and w, or the gold target. The sliders walk a copies of v, then b copies of w; "Find a and b" walks to the target. Line w up with v and watch the span collapse to a line.
Check yourself
3 questions, from warm-up to stretch
Work each one out on paper, type your answer and press Check. Stuck? Open a hint; the worked solution is there when you need it.
- Question 1 of 3 Warm-up
Write as a linear combination . Find and .
Hint 1 of 2
Compare the two vectors entry by entry. The top entries give one equation in and , the bottom entries another.
Hint 2 of 2
The bottom entries give , so start with . Then put it into the top equation, .
Worked solution
- Entry by entry: (top) and (bottom).
- The bottom equation is , so .
- The top equation becomes , so and .
- Check: .
- Question 2 of 3 Core
Is in ?
Hint 1 of 2
Compare the two spanning vectors. Is one of them a multiple of the other?
Hint 2 of 2
, so every combination is a multiple . Can be written that way?
Worked solution
- , so . Every vector in the span has the form .
- For we would need and , that is . That is impossible, so the answer is no.
- Question 3 of 3 Stretch
Is ? First compute , where and .
Hint 1 of 2
Read off the four numbers: , , , .
Hint 2 of 2
Theorem 1.3.8: two vectors and span exactly when .
Worked solution
- .
- , so by Theorem 1.3.8 the two vectors span all of . The answer is yes. (The same theorem says this means the two vectors are not parallel, unlike the pair in Question 2.)
How did it go?