II.1 · Linear Algebra
Where do two moves take you?
Place one move after another. The destination reveals component addition, the parallelogram reveals why order does not matter, and the arrow between two tips explains subtraction.
Two moves, one destination
Either head-to-tail order ends at (3, 3). The diagonal from u to v is v − u = (−1, 1); reversing that arrow negates both components.
- first direction
- (2, 1)
- second vector
- (1, 2)
- combined move
- (3, 3)
- from the tip of u to the tip of v
- (−1, 1)
- the reverse move
- (1, −1)
Exact expressions use =. Rounded computations use ≈. All arrows use these same quantities.
Either head-to-tail order ends at (3, 3). The diagonal from u to v is v − u = (−1, 1); reversing that arrow negates both components.
from −4 to 4, up to 2 decimal places
from −4 to 4, up to 2 decimal places
from −4 to 4, up to 2 decimal places
from −4 to 4, up to 2 decimal places
Before reading, predict the destination after swapping the two moves. Then press Swap the two moves. Next choose Opposite moves: the final arrow disappears because the total displacement is zero. The moves still exist; their effects cancel. Try making only one component cancel and observe the axis on which the sum lies.
Intuition: travel by moves
A vector is a displacement, as I.3 Vectors established. Travel two units right and one up, then one right and two up. Your final displacement is three right and three up. Moving the second arrow’s tail to the first arrow’s tip changes its placement, not its components. This head-to-tail picture turns two instructions into one.
Points and moves play different roles. If you begin at point , the intermediate point is and the destination is . The sum names the combined displacement, independent of . Translating an entire journey changes its points but leaves the combined move unchanged.
Definition
For two vectors in , addition combines matching components:
The opposite vector is . Subtraction means addition of the opposite:
Vector equality means equality of both components. Addition returns another vector of the same dimension. It does not concatenate components, add lengths, or choose a starting point.
Mechanics: two paths and one diagonal
The blue arrow is ; the green arrow is . The same labels on the translated arrows identify the unchanged moves. Starting with blue then green and starting with green then blue create the two adjacent sides of a parallelogram. Its diagonal from the origin is .
The purple arrow has a different job. It starts at the tip of and ends at the tip of , so its displacement is destination minus departure, . This arrow generally does not start at the origin. The inspector displays its components, while the picture shows where it is placed.
Derivation: why the paths agree
Each horizontal move contributes to the horizontal total, and each vertical move contributes to the vertical total. This gives the component formula directly. Commutativity follows from real-number addition:
Thus . The intermediate points need not agree; equality concerns the final displacement. Repeating this reasoning for three moves gives associativity, . The zero vector is the identity, and .
For points , the head-to-tail rule also gives
The intermediate point cancels. If every point is translated by a fixed move , then . This is the algebraic reason that arrow placement does not define the vector.
Worked examples
For and , the sum is and the difference from the first tip to the second is . Inspect the component calculations, then step backward to revisit the inputs.
Inspect the worked calculation
Move u = (2, 1), then v = (1, 2): add the horizontal and vertical moves separately.
- first direction
- (2, 1)
- second vector
- (1, 2)
- combined move
- (3, 3)
- from the tip of u to the tip of v
- (−1, 1)
- the reverse move
- (1, −1)
A second journey starts at , moves by , and ends at after an unknown move. The intermediate point is , so the missing move is . Checking tests the answer against the journey.
Executable reference code
The pedagogical version keeps chosen decimal components exact with Python fractions. It spells out the two additions and checks the vector shape. The practical version uses NumPy arrays; its means elementwise addition.
"""Decimal inputs are interpreted exactly; a vector has exactly two components."""
from fractions import Fraction
def vector(values):
if len(values) != 2:
raise ValueError('Expected two components')
return tuple(Fraction(str(x)) for x in values)
def add(u, v):
u, v = vector(u), vector(v)
return (u[0] + v[0], u[1] + v[1])
def subtract(v, u):
v, u = vector(v), vector(u)
return (v[0] - u[0], v[1] - u[1])
if __name__ == '__main__':
assert add((2, 1), (1, 2)) == (3, 3)
assert subtract((1, 2), (2, 1)) == (-1, 1)import numpy as np
u = np.array([2.0, 1.0])
v = np.array([1.0, 2.0])
sum_vector = u + v # elementwise; plain Python lists concatenate
move_from_u_to_v = v - u
assert np.array_equal(sum_vector, [3, 3])
assert np.array_equal(move_from_u_to_v, [-1, 1])Explore
Return to the opening stage. Make and : predict a vertical sum before checking. Make the vectors equal: the arrow between their tips becomes zero, but their sum doubles the move. Finally choose opposite vectors and explain why the parallelogram collapses while the subtraction arrow remains nonzero.
Common mistakes
The length of a sum is generally not the sum of the lengths. For , the result has length , while the separate lengths add to . Opposite unit vectors give an even stronger counterexample: their sum has length . The directions determine how the moves reinforce or cancel.
Numerical considerations
The stage accepts up to two decimal places and computes component arithmetic as exact rational arithmetic. For instance, its decimal equals exactly under that input contract. Ordinary binary64 arithmetic can instead store a nearby approximation. Subtracting nearly equal measured components can expose input error; exact arithmetic on the entered decimals cannot recover precision absent from the measurement. NumPy’s direct sum may also overflow for sufficiently large finite inputs. The bounded stage avoids overflow; it does not promise that arbitrary floating-point data does.
Engineering and ML connections
Combining velocities, forces, or displacement updates uses this same component rule when the units and coordinate frame agree. Adding an update to model parameters applies one move in parameter space. Adding a bias to a transformed vector will later form an affine map. That operation adds a displacement; it does not preserve the origin in the way a linear transformation does.
Exercises
Summary and checkpoints
Two moves combine head-to-tail and component by component. The parallelogram explains commutativity; the arrow between tips explains subtraction. Check that you can name both endpoints of a difference arrow, explain translation invariance, and construct a missing move without confusing a point with a vector. In II.2 Scalar multiplication, a scalar changes the size and sign of one move before it is added to another.