The span of some vectors is every place you can reach by scaling and adding them.
Yesterday ended with the combinations av+bw covering the whole plane. That raises today's question: given a few vectors, which targets can their combinations reach? We give that set a name, the span, and learn to test whether one particular vector belongs to it. The test turns into a system of equations, which is why Day 3 teaches a method for solving systems and Day 4 rewrites the same question as Ax=b.
Each section below opens with a problem. Try it before you open the walkthrough, even if you only get partway. The box after the walkthrough names what you just did.
Span
Let v=[32] and w=[−12]. Write down five different vectors of the form av+bw. Is the zero vector one of them? Is v itself?
Walk through the solutionHide the walkthrough
We are free to pick any weights, so start with the easiest ones. Setting both weights to 0 gives
0[32]+0[−12]=[00],
so the zero vector is reachable. Setting a=1 and b=0 gives v itself, and a=0, b=1 gives w.
We could keep going forever, because every new pair of weights gives another vector. The list had two vectors, but the set of their combinations has infinitely many.
Span
If v1,…,vp are in Rn, then Span{v1,…,vp} is the set of all linear combinations
c1v1+c2v2+⋯+cpvp
where c1,…,cp can be any scalars. We say the vectors span (or generate) this set.
Problem 1 found three members that every span has. The zero vector is in every span, because all the weights can be 0. Each vi is in the span too, along with all of its multiples, since cv1=cv1+0v2+⋯+0vp.
Let a1=[10] and a2=[01]. Which statement is true?
Two vectors in the plane
Problem 1's vectors seemed to reach everywhere. Now we ask when two vectors can fail to reach a point.
Let v=[21] and w=[−4−2]. Can a combination av+bw reach [13]?
Walk through the solutionHide the walkthrough
Before solving anything, compare the two vectors. Each entry of w is −2 times the matching entry of v, since −2⋅2=−4 and −2⋅1=−2. So w=−2v.
That lets us rewrite every combination using v alone:
av+bw=av+b(−2v)=(a−2b)v.
Every combination is a multiple of v=(2,1), so its second entry is half of its first. The target (1,3) has second entry 3, which is not half of 1. No weights reach it.
The span here is the line through the origin in the direction of v. Adding w gave us nothing new, because it already lay on that line.
Let v=[11] and w=[1−1]. Find weights that reach [51]. Then find weights that reach any point [hk].
Walk through the solutionHide the walkthrough
We want a[11]+b[1−1]=[51]. The left side is the single vector [a+ba−b], and two vectors are equal when their entries match, so we need
a+ba−b=5=1.
Adding the two equations cancels b and leaves 2a=6, so a=3. Then the first equation gives b=5−3=2.
Nothing about the numbers 5 and 1 mattered. With a general target, the same two moves give 2a=h+k and 2b=h−k, so
a=2h+k,b=2h−k.
These weights exist for every h and k, so every point of the plane is in Span{v,w}.
Two vectors span a line or the whole plane
In R2 the span of two vectors is one of three sets. It is the whole plane when the vectors point in different directions, as in Problem 3. It is a line through the origin when one vector is a multiple of the other, as in Problem 2. It is just {0} when both vectors are zero.
The same elimination as Problem 3 works for any v=(v1,v2) and w=(w1,w2). It gives
In Problem 3 the bottom number is 1⋅(−1)−1⋅1=−2, and in Problem 2 it is 2⋅(−2)−1⋅(−4)=0. Whenever v1w2−v2w1=0, the weights exist for every target and the span is R2. For nonzero vectors, the number is zero exactly when w is a multiple of v. Day 7 names it the determinant, and Day 25 shows that it measures area.
Drag either arrow and watch the teal grid of combinations. The number v1w2−v2w1 in the readout drops to 0 at the moment the grid folds onto one line.
The teal lines show where av+bw can land. Move w until the span shrinks to a single line.
Now w is a multiple of v, so every combination is a multiple of v and lands on the one teal line.
Span{[32],[−12]}=R2
v1w2−v2w1=8
When the span is a line, you can tell whether a point is in it by asking whether the point is a multiple of v. Try it on these dots.
Tap every dot that is in Span{v,w} and leave the others alone.
That’s the whole set. Every combination is a multiple of v, so the span is the teal line, and the origin is on it.
w=−2v
av+bw=(a−2b)v
Membership as an equation
Problems 2 and 3 both came down to matching entries and solving equations. This section turns that into a routine that works for any target.
Is b=[5−2] in Span{[32],[−12]}? If it is, find the weights.
Walk through the solutionHide the walkthrough
The question asks whether some weights x1,x2 make a combination equal b. Write that down as one equation between vectors and solve it.
1
Write the vector equation, with the unknown weights in front of the vectors:
x1[32]+x2[−12]=[5−2]
2
Combine the left side into one vector. Its top entry is 3x1−x2 and its bottom entry is 2x1+2x2. Matching entries gives one equation per row:
3x1−x22x1+2x2=5=−2
3
Row 2 has every number even, so halve it to get x1+x2=−1. Now the x2 terms in the two rows are −x2 and +x2, and adding the rows cancels them: 4x1=4, so x1=1.
4
Put x1=1 into x1+x2=−1 to get x2=−2. Check both original rows: 3(1)−(−2)=5 and 2(1)+2(−2)=−2.
So b=v−2w, and b is in the span.
The picture shows the answer as a trip. Go once along v to (3,2), then go −2 times along w, which is (2,−4). The trip ends at (5,−2), the tip of b.
Membership is a system of equations
Asking whether b is in Span{a1,…,an} is the same as asking whether the vector equation
x1a1+x2a2+⋯+xnan=b
has a solution. Matching entries turns it into a linear system with one equation per entry. If the system has a solution, the solution is the list of weights. If it has none, b is not in the span.
The augmented matrix of that system keeps only the numbers. Its columns are the vectors themselves, in order, so we write it [a1⋯anb]. For Problem 4 it is
[32−125−2].
On Day 3 this grid of numbers is exactly what we row reduce to solve the system.
The translation also runs backward. The system 2x1−x2=4, x1+3x2=−5 is the vector equation x1[21]+x2[−13]=[4−5], because the coefficients of x1 read down the rows form the first vector.
Which vector equation has the same solutions as the system x1+4x2=7, 3x1−2x2=0?
Solve one more membership question with the sliders. Set up the two equations first, and then check your weights on the picture.
Choose weights a and b so that av+bw lands on the ringed point [4−4].
You found it: 3v−1w=[4−4]. Those weights are the only pair that works.
1[2−1]+0[21]=[2−1]
A plane in space
The same routine works in R3, with one new twist. Now there are three equations but still only two unknowns.
Let u=2−11 and v=121. Is b=43−1 in Span{u,v}?
Walk through the solutionHide the walkthrough
Write the vector equation x1u+x2v=b and match the three entries:
2x1+x2−x1+2x2x1+x2=4=3=−1
Two unknowns are usually pinned down by two equations, so solve the first two and then test the third. Adding twice row 2 to row 1 cancels x1, because 2x1+2(−x1)=0. That leaves x2+4x2=4+6, so 5x2=10 and x2=2. Row 1 then gives 2x1+2=4, so x1=1.
These are the only weights that satisfy rows 1 and 2. Row 3 asks for x1+x2=−1, but 1+2=3. Row 3 fails, so no weights satisfy all three rows, and b is not in the span.
The figure shows why. The combinations of u and v fill a flat plane through the origin. The point (4,3,−1) sits below that plane, while (4,3,3) lies on it.
Keep u and v from Problem 5. For which value of h is 43h in Span{u,v}?
Walk through the solutionHide the walkthrough
The first two rows do not involve h, so they are the same as in Problem 5, and they still force x1=1 and x2=2. The third row now reads x1+x2=h, which says 1+2=h. It holds only when h=3.
Check the whole vector: 1u+2v=(2+2,−1+4,1+2)=(4,3,3).
Two vectors in space span a plane
In R3, two vectors that are not multiples of each other span a plane through the origin. Most points of space are off that plane. The system for b has three equations and two unknowns, and a point is in the span only when one pair of weights satisfies all three at once.
Here is Problem 6 as a picture of the weights. Each row of the system is a line in the (x1,x2) plane, and a pair of weights satisfies a row when it lies on that row's line. Rows 1 and 2 cross at (1,2). Slide h and watch the pink third line.
Each row of the system is a line of weights. Slide h until all three lines meet, then drag the teal weight point onto the meeting point.
All three rows hold at x1=1,x2=2 when h=3. For any other h the pink line misses that crossing.
2x1+x2−x1+2x2x1+x2=4=3=−2✓✓✓
(x1,x2)=(0,0)
The same idea works in the plane with parallel vectors. Below, w=−2v, so the span is one line, and only one height h puts b on it.
Every b=[4h] sits on the dashed line. Find the h that puts b in Span{v,w}.
Right, h=2. The dashed line crosses the span in exactly one place, so only one h works.
x1[21]+x2[−4−2]=[4−3]
Closed under addition
A span has one more useful property. Adding two vectors from a span never takes you out of it.
Let v1=102 and v2=01−1. Take x=2v1+v2 and y=−v1+3v2, which are both in Span{v1,v2}. Find weights that write x+y as a combination of v1 and v2.
Walk through the solutionHide the walkthrough
One way is to compute both vectors and add them. x=(2,0,4)+(0,1,−1)=(2,1,3) and y=(−1,0,−2)+(0,3,−3)=(−1,3,−5), so x+y=(1,4,−2). Then we would still have to find the weights.
A faster way is to add the combinations themselves and group the terms that share a vector:
Check: (1,0,2)+(0,4,−4)=(1,4,−2), which matches. The weights of a sum are the sums of the weights.
Sums stay in the span
If x=c1v1+c2v2 and y=d1v1+d2v2, then
x+y=(c1+d1)v1+(c2+d2)v2.
The sums ci+di are ordinary numbers, so x+y is another combination of v1 and v2. The same grouping works for any number of vectors, and scaling works the same way, since kx=(kc1)v1+(kc2)v2. On Day 11 these two facts make every span a subspace.
Each membership test today ended in a small system solved by hand. Larger systems need a method that always works, and tomorrow's lesson teaches it: row reduction on the augmented matrix.
Practice
Warm-up
Find the vector in Span⎩⎨⎧1−20,314⎭⎬⎫ that uses the weights 2 and −1. (Modeled on Lay §1.3 #15.)
Show the solutionHide the solution
21−20−314=2−3−4−10−4=−1−5−4
Write the augmented matrix of the vector equation x1[14]+x2[−23]=[5−1]. Enter it row by row.
Show the solutionHide the solution
The three vectors become the three columns, in order:
[14−235−1]
Row 1 is the equation x1−2x2=5 and row 2 is 4x1+3x2=−1.
What is Span⎩⎨⎧2−46,−36−9⎭⎬⎫? (Modeled on Lay §1.3 #19.)
Core
Let a1=13−1, a2=2−14 and b=−111−11. Find weights with x1a1+x2a2=b. (Modeled on Lay §1.3, Example 5.)
Show a hintHide the hint
Write the three equations. Use the first to express x1 in terms of x2, substitute into the second, and then test the third.
Show the solutionHide the solution
The system is x1+2x2=−1, 3x1−x2=11 and −x1+4x2=−11. The first row gives x1=−1−2x2. Substituting into the second gives −3−6x2−x2=11, so −7x2=14 and x2=−2. Then x1=−1+4=3.
The third row must agree too, and it does: −3+4(−2)=−11. So b=3a1−2a2 is in Span{a1,a2}.
Let v1=1−23, v2=21−1 and y=4h5. For what value of h is y in Span{v1,v2}? (Modeled on Lay §1.3 #17.)
Show a hintHide the hint
Two of the three rows do not contain h. Solve those two for the weights first.
Show the solutionHide the solution
The first and third rows do not involve h:
x1+2x23x1−x2=4=5
Adding twice the second row to the first gives 7x1=14, so x1=2, and then x2=1. The second row says −2x1+x2=h, so h=−4+1=−3. For any other h that row is false, so y is in the span only when h=−3.
Is 152 in Span⎩⎨⎧111,132⎭⎬⎫? (Modeled on Lay §1.3, Example 6.)
A workshop has two production lines. One hour on line A makes 4 chairs and 1 table. One hour on line B makes 2 chairs and 3 tables. Write a vector equation for running A for x1 hours and B for x2 hours to make 16 chairs and 14 tables, then solve it. (Modeled on Lay §1.3 #27.)
Show a hintHide the hint
Each line's hourly output is a vector (chairs, tables). The total output is a linear combination of those two vectors.
Show the solutionHide the solution
x1[41]+x2[23]=[1614]
The rows are 4x1+2x2=16 and x1+3x2=14. The first gives x2=8−2x1. Substituting, x1+24−6x1=14, so −5x1=−10 and x1=2. Then x2=4. Run line A for 2 hours and line B for 4 hours.
Let u=[12] and v=[3−1]. Find the weights that reach [70]. Then explain why Span{u,v}=R2. (Modeled on Lay §1.3 #21.)
Show a hintHide the hint
The second row, 2x1−x2=0, tells you x2 in terms of x1. For the second part, redo the elimination with a general target (h,k).
Show the solutionHide the solution
The rows are x1+3x2=7 and 2x1−x2=0. The second gives x2=2x1, so the first becomes 7x1=7. That gives x1=1 and x2=2.
For a general target, the rows are x1+3x2=h and 2x1−x2=k. Adding 3 times row 2 to row 1 gives 7x1=h+3k, and subtracting 2 times row 1 from row 2 gives −7x2=k−2h. So
x1=7h+3k,x2=72h−k,
and these exist for every h and k. Every point is reachable, so the span is R2. The number v1w2−v2w1=1(−1)−2(3)=−7 is not zero, which says the same thing.
Challenge
Let v1=101, v2=213, v3=011 and y=32h. For which h is y in Span{v1,v2,v3}? (Modeled on Lay §1.3, Practice Problem 2.)
Show a hintHide the hint
Three vectors in R3 do not always reach everything. Subtract row 1 from row 3 and compare the result with row 2.
Show the solutionHide the solution
The rows are
x1+2x2x2+x3x1+3x2+x3=3=2=h.
Subtracting row 1 from row 3 gives x2+x3=h−3. Row 2 says x2+x3=2, so both can hold only when h−3=2, which means h=5.
The reason is that v3=v2−2v1, so the three vectors all lie in one plane. Having three vectors did not guarantee a third direction.
Suppose u and v are both in Span{w1,w2,w3}. Show that u+v is in that span too. (Modeled on Lay §1.3, Practice Problem 3.)
Show a hintHide the hint
Being in the span means having weights. Write u and v with weights c1,c2,c3 and d1,d2,d3, add, and group.
Show the solutionHide the solution
Since u and v are in the span, there are scalars with u=c1w1+c2w2+c3w3 and v=d1w1+d2w2+d3w3. Then