Lecture 2 · Week 1· 14:05
Adding and scaling vectors
Vector operations, the rules they obey, Rn.
Saved in this browser only. No account needed.
TranscriptThe full text of the lecture. Click any sentence to play the video from there.
Where we are
In the last lecture we met vectors in two costumes: as arrows, and as lists of numbers. We also saw, briefly, that vectors can be added and scaled. Today we take those two operations seriously. We will define them precisely in R n, see what each one means as a picture, and then collect the rules they obey. Those rules matter more than they might seem. Later in the course they become the definition of a vector space, and everything we prove from them will hold far beyond lists of numbers.
By the end of this lecture you should be able to compute with vectors confidently, explain each operation with a picture, and prove simple facts about vectors using only the rules.
Adding vectors
Here is the definition. Let v and w be two vectors in R n, with the same number of components. Their sum, v plus w, is the vector whose entries are the sums of the matching entries of v and w. So the first entry of the sum is v one plus w one, the second entry is v two plus w two, and so on, down to the last entry, v n plus w n. Let's add two vectors in R three. Take v equal to (one, four, minus two), and w equal to (three, minus one, five).
In the first coordinate, the entry of v is one, and the entry of w is three. One plus three equals four. In the second coordinate, the entry of v is four, and the entry of w is minus one. Four plus minus one equals three. In the third coordinate, the entry of v is minus two, and the entry of w is five. Minus two plus five equals three.
So v plus w is the vector (four, three, three). Notice one restriction. We only add vectors of the same size. A vector in R two and a vector in R three have no sum, because the third entry has nothing to be added to. Now the picture. In the plane, take v equal to (two, one), and w equal to (one, two). Place the tail of w at the tip of v. The sum is the arrow from the tail of v to the tip of w.
Why does this agree with the formula? Walking along v moves us two across and one up. Walking along w moves us one more across and two more up. Altogether that is three across and three up: exactly the entries of the sum. We could also walk along w first, and then along v. That route ends at the same point. The two routes are the sides of a parallelogram, and the sum is its diagonal. This is called the parallelogram rule. The parallelogram already shows our first rule: v plus w equals w plus v. The order of addition does not matter. We will prove this properly in a moment.
Try it yourself (lesson widget, part of Section 2)
You can try this yourself. The lesson page for this lecture, on opensemester dot com, has a figure where you drag v and w. Here are our two vectors again, (two, one) and (one, two). Their sum, (three, three), is the far corner of the parallelogram, and the line under the figure shows all three. Drag w to (minus two, one). The parallelogram changes shape, and the sum becomes (zero, two): first entries added, second entries added.
Now drag v anywhere you like. However the two arrows point, their sum is always the diagonal. Try a few pairs of your own, and predict the sum before you look.
Scaling vectors
The second operation multiplies a vector by a scalar, that is, by a real number. For a scalar c and a vector v in R n, the vector c v is obtained by multiplying every entry of v by c. Let's compute three times the vector (two, minus one, four). In the first coordinate, three times two is six.
In the second coordinate, three times minus one is minus three. In the third coordinate, three times four is twelve. So three times this vector is (six, minus three, twelve).
As a picture, multiplying by a positive number stretches the arrow. Two times v is twice as long as v. One half times v is half as long. Both still point the same way as v. A negative scalar also reverses the direction. Minus one times v has the same length as v, but points the opposite way. Minus two times v is twice as long, and reversed. And zero times v is the zero vector, since every entry becomes zero. In general, scaling by c multiplies the length by the size of c, and flips the arrow when c is negative.
Notice that all the multiples of v lie on one line through the origin. Scaling slides the tip along that line, but never leaves it.
Negatives and subtraction
Two special vectors deserve names. The zero vector in R n, written as a zero with an arrow on top, is the vector whose entries are all zero. Adding it to any vector changes nothing. The negative of v, written minus v, is minus one times v. Its entries are the entries of v with their signs flipped, and v plus minus v is the zero vector. Subtraction is defined through the negative: v minus w means v plus minus w. As lists, we simply subtract matching entries.
For example, take v equal to (four, one), and w equal to (one, three). In the first coordinate, four minus one equals three. In the second coordinate, one minus three equals minus two. So v minus w is the vector (three, minus two).
Here is the picture. Draw v and w from the origin. Then v minus w is the arrow from the tip of w to the tip of v. Indeed, starting at w and adding v minus w brings us exactly to v. This gives a useful habit. To get from a point P to a point Q, the step to take is Q minus P: the end, minus the start.
The rules of vector algebra
We now have two operations, and the key fact about them is that they obey eight simple rules. Here they are, for all vectors u, v and w in R n, and all scalars a and b. First, the rules for addition. Addition is commutative: v plus w equals w plus v. And it is associative: u plus v, then plus w, is the same as u, plus v plus w. The zero vector changes nothing: v plus zero equals v. And every vector has a negative: v plus minus v equals zero.
Next, the rules for scaling. Scaling by one changes nothing: one times v is v. And scaling twice is the same as scaling once by the product: a times b v equals a b, times v. Finally, two distributive laws connect the operations. a times, v plus w, equals a v plus a w. And a plus b, times v, equals a v plus b v. Every one of these rules is proved the same way. Compare the two sides one entry at a time, and use the matching rule for ordinary numbers. Let's do two of them carefully.
Proofs like these are demanding the first time you meet them, so it is worth pausing here, or rewatching this part slowly. First, commutativity. Write v with entries v one up to v n, and w with entries w one up to w n. Pick any position i between one and n. By the definition of addition, entry i of v plus w is v i plus w i.
Addition of real numbers is commutative, so v i plus w i equals w i plus v i. And w i plus v i is exactly entry i of w plus v. The two vectors agree in every position, so by the definition of equality, v plus w equals w plus v. Now the first distributive law. Entry i of a times, v plus w, is a times, v i plus w i.
By the distributive law for real numbers, that equals a v i plus a w i. And that is entry i of a v plus a w. Again the two sides agree in every position, so they are equal. The other six rules are proved in exactly the same way, and the book writes out every one. Each rule also has a picture. Associativity says that walking along u, then v, then w ends in the same place, however we group the steps.
And the distributive law says that scaling a parallelogram scales its diagonal by the same factor. Doubling v and w doubles the whole parallelogram, so the new diagonal, two v plus two w, is twice the old one. These eight rules are the heart of the subject. Later in the course we will turn them around: any collection of objects that can be added and scaled while obeying these eight rules will be called a vector space.
Working with the rules
Here is why that is powerful. A fact proved from the eight rules alone, without ever looking at entries, will automatically hold in every vector space. Let's prove one. Claim: for every vector v, zero times v is the zero vector. The proof is only a few lines, but every line uses one of the rules, and that makes it demanding at first. It is worth pausing on each step, or watching it again slowly.
Start with zero times v. The scalar here is the number zero, and zero equals zero plus zero. So zero times v equals, zero plus zero, times v. By the second distributive law, that is zero v plus zero v. So zero v equals zero v plus zero v. Now add the negative of zero v to both sides. On the left we get the zero vector. On the right, by associativity and the rule for negatives, we are left with just zero v. So zero v is the zero vector.
In R n we could also see this directly, since every entry becomes zero. The point of the proof is that it never looks at entries, so it will still work when our vectors are polynomials, matrices, or functions. This may look like a lot of effort for something obvious, but it is foundational. In a general vector space the eight rules are all we are given, so even a fact as simple as zero times v equals zero has to be earned from them. Everything we build later stands on small steps like this one. In the same way one proves that minus one times v is the negative of v, and that if a times v is the zero vector, then either a is zero, or v is the zero vector. Those proofs are in the book.
The rules also let us solve equations with vectors, just like equations with numbers. Suppose two x plus (one, minus three) equals (seven, five), and we want the vector x. Subtract (one, minus three) from both sides. Then two x equals (seven, five) minus (one, minus three). In the first coordinate, seven minus one is six.
In the second coordinate, five minus minus three is eight. So two x equals (six, eight). Finally, multiply both sides by one half. By the rule for scaling twice, one half of two x is just x. One half of six is three, and one half of eight is four. So x is the vector (three, four).
Geometry with vectors
Vector algebra can also prove facts about geometry. Fix an origin, and describe each point P by its position vector p, the arrow from the origin to P. The step from P to Q is q minus p. So the midpoint M of the segment from P to Q is reached by starting at P and going half of that step. That means m equals p, plus one half of, q minus p. Using the rules, this simplifies to one half p plus one half q: the average of the two position vectors.
Now a theorem from geometry. In any parallelogram, the two diagonals cut each other in half. Put the corners of the parallelogram at the origin, at v, at w, and at v plus w. One diagonal runs from the origin to v plus w, and its midpoint is one half of, v plus w. The other diagonal runs from v to w. Its midpoint is the average of v and w, which is one half v plus one half w.
By the distributive law, these two vectors are equal. So the two diagonals share their midpoint, which means each one cuts the other in half. No angles and no triangles, just the rules of vector algebra.
Summary
Let's summarise. We add vectors of the same size entry by entry. As arrows, we add tip to tail, or take the diagonal of a parallelogram. We scale a vector by multiplying every entry. As an arrow, it stretches by the size of the scalar, and reverses when the scalar is negative. Subtracting means adding the negative, and Q minus P is the step from P to Q. The two operations obey eight rules, each proved entry by entry from the rules of ordinary arithmetic. Facts proved from the rules alone, like zero times v equals the zero vector, hold in every vector space.
Before the next lecture, read section one point two of the course book, and try the problems on sheet one about adding and scaling. Next time, we combine the two operations into linear combinations, and ask which vectors we can reach. See you there.
In this lecture
Materials
Try it
Adding two vectors
Drag the dots at the tips of v and w. The sum is the far corner of the parallelogram: walk along v, then along w.
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
Compute .
Hint 1 of 2
Scale first: multiplying by multiplies every entry.
Hint 2 of 2
. Now add entry by entry.
Worked solution
- .
- .
- Question 2 of 3 Core
Solve for .
Hint 1 of 2
Undo the subtraction first: add to both sides.
Hint 2 of 2
That gives . Now multiply both sides by .
Worked solution
- Add to both sides: .
- Multiply both sides by : .
- Check: .
- Question 3 of 3 Stretch
Find the number for which .
Hint 1 of 2
Work out the left side as one vector: .
Hint 2 of 2
Set the entries equal: and . Both must hold.
Worked solution
- The left side is .
- Matching entries: gives , and gives . Both agree.
- Check: .
How did it go?