Adding and scaling vectors in n dimensions
A day at a creamery produces five numbers, not one. How do you add, compare and scale whole lists like that in one move?
Where you are 8 in Vectors in n dimensions
When you reach for it
Anela, Kailani and Brynjar run a creamery. Each evening they record the day’s output as five numbers in a fixed order: gallons of milk, pounds of butter, quarts of yogurt, pints of ice cream and pounds of cheese. Monday might be (120, 35, 60, 80, 18). That list is one object. The total for two days, the change from one day to the next, and the output of five days at Monday’s rate all come from adding, subtracting and scaling whole lists, one position at a time.
In the plane and in space these moves were arrows, tip to tail and stretched (Vector addition and scalar multiplication). Nothing in the rules depends on there being two or three entries. This lesson sets up the arithmetic of lists of any length n: equality, adding, scaling, the zero vector and negatives, and the eight properties that let vector expressions be rearranged as freely as number expressions. A list written as a column is an n \times 1 matrix, so the arithmetic is that of adding and scaling matrices. What is new is treating the lists as the points of one space, \mathbb{R}^n, and proving the properties for every n at once.
Reach for it whenever several numbers belong together and are always combined position by position. Every list must use one order and one unit per position; otherwise a sum is defined and means nothing.
The procedure
Vectors in \mathbb{R}^n
For a positive integer n, \mathbb{R}^n is the set of all ordered lists of n real numbers. An element of \mathbb{R}^n is a vector, and its numbers are its entries, or components. We write a vector as a column,
or, inside a line of text, as \mathbf{u} = (4, -2, 7, 0, 1), which means the same column. Both are vectors in \mathbb{R}^5. The i-th entry of \mathbf{u} is u_i, so u_3 = 7 and v_4 = 6.
Order matters: (1, 2) and (2, 1) are different vectors, just as 35 pounds of butter is not 35 pints of ice cream. Two vectors are equal when they have the same number of entries and agree in every position: for \mathbf{x} and \mathbf{y} in \mathbb{R}^n, \mathbf{x} = \mathbf{y} means x_i = y_i for every i = 1, \dots, n. So one equation between vectors in \mathbb{R}^n is n equations between numbers, all of which must hold.
Adding
The sum of two vectors in \mathbb{R}^n is the vector of sums of matching entries:
For the two vectors above,
At the creamery, two days’ butter adds to butter and two days’ milk to milk. In \mathbb{R}^2 the same definition is the parallelogram rule: placing \mathbf{b} at the tip of \mathbf{a} adds the horizontal steps together and the vertical steps together. Past three entries there is no picture, but the arithmetic is unchanged.
Scaling
A real number that multiplies a vector is a scalar. The scalar multiple c\mathbf{u} multiplies every entry by c:
So 2\mathbf{u} = (8, -4, 14, 0, 2), two days at the rate \mathbf{u}. In \mathbb{R}^2, c\mathbf{a} is the arrow \mathbf{a} scaled by the factor |c|, and reversed when c < 0.
Zero, negatives and subtraction
The zero vector of \mathbb{R}^n is \mathbf{0} = (0, 0, \dots, 0), with n zeros; each \mathbb{R}^n has its own. The negative of \mathbf{v} is -\mathbf{v} = (-1)\mathbf{v} = (-v_1, \dots, -v_n), and subtraction is adding the negative:
For our pair, -\mathbf{v} = (3, -5, -1, -6, 2) and \mathbf{u} - \mathbf{v} = (7, -7, 6, -6, 3). In the plane, \mathbf{u} - \mathbf{v} is the arrow from the tip of \mathbf{v} to the tip of \mathbf{u}, because \mathbf{v} + (\mathbf{u} - \mathbf{v}) = \mathbf{u}.
The properties, and why they hold
For all \mathbf{u}, \mathbf{v}, \mathbf{w} in \mathbb{R}^n and all scalars c, d:
| Property | Name | |
|---|---|---|
| 1 | \mathbf{u} + \mathbf{v} = \mathbf{v} + \mathbf{u} | addition is commutative |
| 2 | (\mathbf{u} + \mathbf{v}) + \mathbf{w} = \mathbf{u} + (\mathbf{v} + \mathbf{w}) | addition is associative |
| 3 | \mathbf{u} + \mathbf{0} = \mathbf{u} | \mathbf{0} is an additive identity |
| 4 | \mathbf{u} + (-\mathbf{u}) = \mathbf{0} | -\mathbf{u} is an additive inverse |
| 5 | c(\mathbf{u} + \mathbf{v}) = c\mathbf{u} + c\mathbf{v} | scaling distributes over vector addition |
| 6 | (c + d)\mathbf{u} = c\mathbf{u} + d\mathbf{u} | scaling distributes over scalar addition |
| 7 | c(d\mathbf{u}) = (cd)\mathbf{u} | scaling is associative |
| 8 | 1\mathbf{u} = \mathbf{u} | the scalar 1 changes nothing |
Each is proved the same way: compare the i-th entries of the two sides, use the matching property of real numbers, and conclude by the definition of equality, since i was any position.
Property 1: the i-th entry of \mathbf{u} + \mathbf{v} is u_i + v_i, and that of \mathbf{v} + \mathbf{u} is v_i + u_i. These are equal by the commutative property of real numbers, for every i, so the vectors are equal.
Property 5: the i-th entry of c(\mathbf{u} + \mathbf{v}) is c(u_i + v_i), and that of c\mathbf{u} + c\mathbf{v} is cu_i + cv_i. These are equal by the The distributive property of real numbers, for every i.
The number n never enters, so one proof covers \mathbb{R}^2, \mathbb{R}^5 and \mathbb{R}^{1000}. The examples below name the property behind each rearranging step.
Worked examples
Combinations in \mathbb{R}^5
With \mathbf{u} = (4, -2, 7, 0, 1) and \mathbf{v} = (-3, 5, 1, 6, -2), find (a) 3\mathbf{u} - 2\mathbf{v} and (b) \displaystyle -\frac{1}{2}\mathbf{u} + \mathbf{v}. (c) Is \mathbf{u} + (1, 2, 3) defined?
Solution(a) Scale each vector, then subtract position by position.
(b) Halving the odd entries gives fractions: \displaystyle -\frac{1}{2}\mathbf{u} = \left(-2, 1, -\frac{7}{2}, 0, -\frac{1}{2}\right). Adding \mathbf{v},
(c) No. \mathbf{u} is in \mathbb{R}^5 and (1, 2, 3) is in \mathbb{R}^3, so u_4 and u_5 have no partner.
A creamery’s two days
Monday’s output was \mathbf{m} = (120, 35, 60, 80, 18) and Tuesday’s was \mathbf{t} = (110, 40, 55, 90, 20), in the order milk (gallons), butter (pounds), yogurt (quarts), ice cream (pints), cheese (pounds). Find the two-day total, the change from Monday to Tuesday, and the output of five days at Monday’s rate.
SolutionEach position keeps its product and unit, so adding by position adds like to like:
The change is Tuesday minus Monday, \mathbf{t} - \mathbf{m} = (-10, 5, -5, 10, 2): ten fewer gallons of milk, five more pounds of butter, five fewer quarts of yogurt, ten more pints of ice cream, two more pounds of cheese. Check: \mathbf{m} + (\mathbf{t} - \mathbf{m}) = (110, 40, 55, 90, 20) = \mathbf{t}.
Five days at Monday’s rate is 5\mathbf{m} = (600, 175, 300, 400, 90). The scalar 5 counts days and carries no unit; it multiplies every entry alike.
Vector equality, entry by entry
(a) Find all numbers x, y, z with (x + y, x - y, 2z, z + x) = (7, 1, 6, 7). (b) Do the same with the last entry on the right changed to 8.
Solution(a) Both sides are in \mathbb{R}^4, so the equation is four equations, one per position:
Adding the first two gives 2x = 8, so x = 4 and y = 3. The third gives z = 3. The fourth is an extra condition, and it holds: 3 + 4 = 7. The only solution is x = 4, y = 3, z = 3.
(b) The first three equations still force x = 4, y = 3, z = 3, and then z + x = 7 \neq 8, so there is no solution. With more positions than unknowns, a vector equation can fail even when most positions match.
Subtraction undoes addition
With \mathbf{u} and \mathbf{v} as in Example 1, find every \mathbf{x} in \mathbb{R}^5 with \mathbf{u} + \mathbf{x} = \mathbf{v}, naming the property behind each step.
SolutionSuppose \mathbf{u} + \mathbf{x} = \mathbf{v}. Add -\mathbf{u} to both sides:
The second line regroups the left side (property 2) and reorders the right (property 1). The third uses properties 1 and 4, (-\mathbf{u}) + \mathbf{u} = \mathbf{u} + (-\mathbf{u}) = \mathbf{0}. The fourth uses properties 1 and 3. So a solution must be
It is one: \mathbf{u} + \mathbf{x} = (4 - 7, -2 + 7, 7 - 6, 0 + 6, 1 - 3) = \mathbf{v}. So there is exactly one solution, and it is the negative of \mathbf{u} - \mathbf{v}; order matters in subtraction.
Simplify first, then compute
Prove property 6. Then write 2(\mathbf{u} + 3\mathbf{v}) - 3(\mathbf{v} - \mathbf{u}) as a\mathbf{u} + b\mathbf{v} and evaluate it for the vectors of Example 1.
SolutionProperty 6: the i-th entry of (c + d)\mathbf{u} is (c + d)u_i, and that of c\mathbf{u} + d\mathbf{u} is cu_i + du_i; they agree by the distributive property of real numbers, for every i.
Distribute with property 5 and combine scalars with property 7: 2(\mathbf{u} + 3\mathbf{v}) = 2\mathbf{u} + 6\mathbf{v} and -3(\mathbf{v} - \mathbf{u}) = -3\mathbf{v} + 3\mathbf{u}. Reorder and regroup (properties 1 and 2), then combine each pair by property 6:
With the numbers,
Check: working the original expression as written, 2(-5, 13, 10, 18, -5) - 3(-7, 7, -6, 6, -3) gives the same vector, at the cost of three scalings and three additions or subtractions instead of two and one.
When a multiple is zero
(a) Prove that if c\mathbf{u} = \mathbf{0}, then c = 0 or \mathbf{u} = \mathbf{0}. (b) Find every scalar k with k(3, 0, -6, 9) = (-2, 0, 4, -6).
Solution(a) Suppose c\mathbf{u} = \mathbf{0} and c \neq 0. By equality, cu_i = 0 for every i. A product of real numbers is zero only when a factor is zero, and c is not, so every u_i = 0: \mathbf{u} = \mathbf{0}.
A consequence: if c\mathbf{u} = d\mathbf{u} and \mathbf{u} \neq \mathbf{0}, then c = d. Adding -(d\mathbf{u}) to both sides, which is (-d)\mathbf{u} by property 7, and using property 6 gives (c - d)\mathbf{u} = \mathbf{0}, so part (a) forces c - d = 0.
(b) The positions say 3k = -2, 0k = 0, -6k = 4 and 9k = -6. The first forces \displaystyle k = -\frac{2}{3}, the second holds for every k, and the last two hold for \displaystyle k = -\frac{2}{3}. So \displaystyle k = -\frac{2}{3}, and it is the only scalar that works, by the consequence above, since (3, 0, -6, 9) \neq \mathbf{0}.
Points between two points
Treat \mathbf{p} = (1, 4, -2, 6) and \mathbf{q} = (7, -2, 10, 0) as points of \mathbb{R}^4. Find the midpoint of the segment from \mathbf{p} to \mathbf{q}, and the point one third of the way from \mathbf{p} to \mathbf{q}.
SolutionThe step from \mathbf{p} to \mathbf{q} is \mathbf{q} - \mathbf{p} = (6, -6, 12, -6), since \mathbf{p} + (\mathbf{q} - \mathbf{p}) = \mathbf{q}. Going the fraction t of the way adds t times that step, and the eight properties rewrite the result:
With \displaystyle t = \frac{1}{2} in \mathbb{R}^2 this is the midpoint formula, and nothing in it depends on n.
Midpoint: \displaystyle \frac{1}{2}(\mathbf{p} + \mathbf{q}) = \frac{1}{2}(8, 2, 8, 6) = (4, 1, 4, 3).
One third of the way:
Check with the other form: \displaystyle \frac{2}{3}\mathbf{p} + \frac{1}{3}\mathbf{q} = \frac{1}{3}(9, 6, 6, 12) = (3, 2, 2, 4).
The same formula with \mathbf{x} in place of \mathbf{q} is the dilation with center \mathbf{p} and factor t, now in any \mathbb{R}^n.
Boundaries
- One n at a time. Sums and equality are defined only for vectors with the same number of entries; (1, 2, 3) + (1, 2) is undefined. Padding the shorter list with a zero is a choice, not a rule.
- No vector plus number. \mathbf{u} + 3 is undefined, because 3 is a scalar. Adding 3 to every entry is \mathbf{u} + (3, 3, \dots, 3).
- No product or quotient of two vectors here. Dividing by a nonzero scalar c means multiplying by \displaystyle \frac{1}{c}; dividing by a vector has no meaning. The dot product, which takes two vectors to a number, comes next.
- Scalars are real numbers. Complex entries and complex scalars obey the same eight properties, outside this lesson.
Where this goes next
Adding and scaling together give the linear combination c_1\mathbf{v}_1 + \dots + c_k\mathbf{v}_k (Linear combination), the move the rest of the subject is built from. Everything reachable that way from a fixed set is its span, and a set closed under adding and scaling is a subspace. Multiplying matching entries and adding the products gives the dot product, which brings length and angle into \mathbb{R}^n. Later the eight properties become a definition: any set whose addition and scaling obey them is a vector space, and whatever was proved from the properties alone, such as the single solution in Example 4, holds there too. The whole area is mapped in Vectors in n dimensions.
Exercises
In Exercises 1 to 6, \mathbf{a} = (2, -1, 0, 3), \mathbf{b} = (-4, 5, 1, -2) and \mathbf{w} = (1, 1, -3, 0).
Computing in \mathbb{R}^n
- Find \mathbf{a} + \mathbf{b}.
- Find \mathbf{b} - \mathbf{a}.
- Find -3\mathbf{w}.
- Find 2\mathbf{a} - \mathbf{b} + 3\mathbf{w}.
- Find \displaystyle \frac{1}{2}(\mathbf{a} + \mathbf{b}).
- Which of these are defined? (a) \mathbf{a} + (1, 2, 3) (b) \mathbf{w} - \mathbf{0}, with \mathbf{0} in \mathbb{R}^4 (c) 3 + \mathbf{a}
Equality and unknowns
- Find x, y, z with (x - 1, 2y, z + y) = (4, -6, 0).
- Find all s, t with (s + 2t, 3s - t, s + t) = (4, 5, 3).
- Find all s, t with (s + 2t, 3s - t, s + t) = (4, 5, 2).
- Find every scalar k with (a) k(2, -1, 4) = (-6, 3, -12) (b) k(2, -1, 4) = (6, -3, 10).
Solving and simplifying
- Solve \mathbf{x} + (3, -2, 5, 1) = (1, 4, -1, 7) for \mathbf{x} in \mathbb{R}^4.
- Solve 5\mathbf{x} = (10, -5, 0, 15, 1) for \mathbf{x} in \mathbb{R}^5.
- Write 2(3\mathbf{u} - \mathbf{v}) - 3(\mathbf{u} + \mathbf{v}) as a\mathbf{u} + b\mathbf{v}, then evaluate it for \mathbf{u} = (1, 0, 2, -1) and \mathbf{v} = (0, 3, -1, 4).
- Wednesday’s creamery output was \mathbf{r} = (105, 30, 70, 75, 22) and Thursday’s \mathbf{s} = (130, 33, 52, 96, 15), ordered as in Example 2. Find the two-day total and the change from Wednesday to Thursday. What does the change say about yogurt and cheese?
- Brynjar fills a standing order of \mathbf{o} = (40, 10, 25, 30, 6) every day. Find the order’s total over four days, and what is left of Thursday’s output \mathbf{s} once the order is filled.
- Find the midpoint of \mathbf{p} = (2, 0, -4, 8) and \mathbf{q} = (10, 4, 4, 0), and the point one quarter of the way from \mathbf{p} to \mathbf{q}.
- Check property 7 for c = -2, d = 3 and \mathbf{u} = (1, -4, 0, 2) by computing both sides.
Reasoning
- Prove property 2 entry by entry.
- Prove properties 7 and 8.
- Prove that 0\mathbf{u} = \mathbf{0} and c\mathbf{0} = \mathbf{0} for every \mathbf{u} in \mathbb{R}^n and every scalar c.
- Prove that if \mathbf{u} + \mathbf{z} = \mathbf{u} for even one vector \mathbf{u}, then \mathbf{z} = \mathbf{0}.
- Prove that -(\mathbf{u} - \mathbf{v}) = \mathbf{v} - \mathbf{u}.
- Prove that if c \neq 0 and c\mathbf{u} = c\mathbf{v}, then \mathbf{u} = \mathbf{v}.
- Give a counterexample to the claim “if c\mathbf{u} = d\mathbf{u}, then c = d”, and name the hypothesis from Example 6 that it lacks.
Answers
- (-2, 4, 1, 1). Add position by position.
- (-6, 6, 1, -5). For example, the second entry is 5 - (-1).
- (-3, -3, 9, 0). Every entry of \mathbf{w} times -3.
- (11, -4, -10, 8). Add 2\mathbf{a} = (4, -2, 0, 6), -\mathbf{b} = (4, -5, -1, 2) and 3\mathbf{w} = (3, 3, -9, 0).
- \displaystyle \left(-1, 2, \frac{1}{2}, \frac{1}{2}\right). Half of \mathbf{a} + \mathbf{b} = (-2, 4, 1, 1).
- Only (b), and \mathbf{w} - \mathbf{0} = \mathbf{w}. In (a) the sizes differ; in (c) a number is added to a vector.
- x = 5, y = -3, z = 3. Position by position: x - 1 = 4, 2y = -6, z + (-3) = 0.
- s = 2, t = 1. The second position gives t = 3s - 5, so the first is 7s - 10 = 4; the third holds, 2 + 1 = 3.
- No solution. The first two positions still force s = 2, t = 1, and then s + t = 3 \neq 2.
- (a) k = -3, from 2k = -6; it also gives 3 and -12. (b) None: 2k = 6 forces k = 3, but then the third entry is 12 \neq 10.
- \mathbf{x} = (-2, 6, -6, 6). As in Example 4, \mathbf{x} = (1, 4, -1, 7) - (3, -2, 5, 1).
- \displaystyle \mathbf{x} = \left(2, -1, 0, 3, \frac{1}{5}\right). Multiply both sides by \displaystyle \frac{1}{5}; by properties 7 and 8, \displaystyle \frac{1}{5}(5\mathbf{x}) = \mathbf{x}.
- 3\mathbf{u} - 5\mathbf{v} = (3, -15, 11, -23). Distributing gives 6\mathbf{u} - 2\mathbf{v} - 3\mathbf{u} - 3\mathbf{v}; then (3, 0, 6, -3) - (0, 15, -5, 20).
- Total (235, 63, 122, 171, 37); change \mathbf{s} - \mathbf{r} = (25, 3, -18, 21, -7). Thursday made 18 fewer quarts of yogurt and 7 fewer pounds of cheese.
- 4\mathbf{o} = (160, 40, 100, 120, 24), and \mathbf{s} - \mathbf{o} = (90, 23, 27, 66, 9) is left.
- Midpoint (6, 2, 0, 4) and quarter point (4, 1, -2, 6): \displaystyle \frac{1}{2}(12, 4, 0, 8), and \displaystyle \mathbf{p} + \frac{1}{4}(8, 4, 8, -8).
- Both sides are (-6, 24, 0, -12): -2 times 3\mathbf{u} = (3, -12, 0, 6), and -6 times \mathbf{u}.
- The i-th entries are (u_i + v_i) + w_i and u_i + (v_i + w_i), equal by the associative property of real addition, for every i.
- Property 7: the i-th entries are c(du_i) and (cd)u_i, equal by the associative property of real multiplication. Property 8: the i-th entry of 1\mathbf{u} is 1 \cdot u_i = u_i.
- The i-th entry of 0\mathbf{u} is 0 \cdot u_i = 0, and that of c\mathbf{0} is c \cdot 0 = 0. Every entry is 0, so both are \mathbf{0}.
- Position by position, u_i + z_i = u_i; subtracting the real number u_i gives z_i = 0 for every i, so \mathbf{z} = \mathbf{0}.
- The i-th entry of -(\mathbf{u} - \mathbf{v}) is -(u_i - v_i) = v_i - u_i, the i-th entry of \mathbf{v} - \mathbf{u}.
- Since c \neq 0, multiply both sides by \displaystyle \frac{1}{c}. By properties 7 and 8 the sides become 1\mathbf{u} = \mathbf{u} and 1\mathbf{v} = \mathbf{v}.
- Take \mathbf{u} = \mathbf{0}, c = 1 and d = 2: 1\mathbf{0} = 2\mathbf{0}, but 1 \neq 2. Example 6 needs \mathbf{u} \neq \mathbf{0}.