A column of numbers can be read as an arrow in space, and the two readings support exactly the same arithmetic, which is what makes the geometry of the previous lesson available to systems of any size.
The previous lesson ended by writing a system of three equations as a statement about three columns of coefficients, . Two things happened to those columns there: they were multiplied by numbers, and they were added. This lesson takes those two operations as the definition of the objects, and then shows that measurement, length and angle and perpendicularity, comes from one further product that is not part of the definition at all.
An arrow and a list
A vector in the plane can be pictured as an arrow with a length and a direction, and represented by the pair of numbers saying how far it goes across and how far up: is three to the right and four up. The arrow is not anchored anywhere. An arrow from to and an arrow from the origin to are the same vector, because both are three across and four up, and it is convenient to draw every vector from the origin so that vectors and points can be identified.
In three dimensions the same works with triples, and beyond three the picture stops but the arithmetic does not. A vector in is an ordered list of real numbers, and can be a million. This is not an abstraction for its own sake. A greyscale image of 1000 by 1000 pixels is a vector in , one coordinate per pixel. A month of daily closing prices for thirty stocks is a vector in . The word "direction" is unvisualisable in those spaces and remains perfectly well defined.
Two vectors are equal when every component matches. The zero vector has every component zero, and it is the one vector with no direction. Vectors are written in bold, , and their components with subscripts, so . Throughout this course a vector written in round brackets is a column, which matters from the lesson on matrices onward.
Two operations, and only two
Addition works component by component: . Geometrically it is tip to tail. Draw the first arrow, start the second where the first ended, and the sum runs from the original start to the final tip. Equivalently, complete the parallelogram with the two arrows as sides and take its diagonal. That the two constructions agree is the statement that , which is obvious from the components and not obvious from the picture.
Scalar multiplication multiplies every component by a number: and . The number is called a scalar to distinguish it from a vector. Geometrically, multiplying by stretches the arrow by a factor , and reverses it when is negative. All the scalar multiples of one non-zero vector, taken together, form an infinite straight line through the origin.
Subtraction is not a third operation, being , and it is worth reading geometrically: is the arrow from the tip of to the tip of . That reading is used constantly, because the vector between two points is the difference of their position vectors.
There is deliberately no multiplication of two vectors in this list, and no division at all. The reason is that the operations are chosen to be exactly those that a system of linear equations performs, and the definition is worth stating in that spirit: a vector space is any set on which addition and scalar multiplication are defined and obey eight rules, that addition is commutative and associative, that a zero exists and each element has a negative, that scaling distributes over both kinds of sum, that , and that . Lists of numbers satisfy them. So do polynomials of degree at most five, which can be added and scaled and form a space of a size worked out two lessons from now. So do all real-valued functions on an interval, and so do the solutions of a differential equation like . Every result in this course rests on the eight rules alone, so every result applies to all of those, which is the return on the abstraction.
Example. With and , compute .
Scale first: and . Subtract component by component: .
Now you. With the same and , compute and check that it equals .
Answer
, so . The check is componentwise, and each one has to work independently.
Length
Nothing said so far measures anything. Length has to be added, and in the plane Pythagoras supplies it: the arrow is the hypotenuse of a right triangle with legs and , so its length is . In three dimensions apply Pythagoras twice, once in the base plane and once vertically, giving . The vector has length exactly.
In dimensions the same formula is taken as the definition, since there is no triangle to appeal to:
The double bars distinguish it from the absolute value of a number, which it generalises. Length is never negative, and is zero only for the zero vector. Scaling behaves as the picture demands: , because every component is multiplied by and every square by .
A vector of length one is a unit vector, and dividing any non-zero vector by its own length produces one pointing the same way, an operation called normalising. This separates a vector into a direction and a magnitude, which is what makes it useful.
Example. Find the length of and the unit vector in its direction.
. Dividing gives , and as a check .
Now you. Find the length of and normalise it.
Answer
, so the unit vector is . Squaring and adding gives .
The dot product
Angles need one more construction, and it is the single most useful formula in the subject. The dot product of two vectors with the same number of components multiplies them componentwise and adds the results:
The output is a number, not a vector, which is why it is also called the scalar product. For and it is . It is commutative, it distributes over addition, and it relates to length by , straight from the definitions.
Its geometric meaning is not visible in that formula and has to be derived. Take two vectors and with angle between them. The three arrows , and form a triangle, so the law of cosines from Mathematical Foundations gives
Now expand the left side algebraically instead. Since , distributing gives , which is . Setting the two expressions equal, the squared lengths cancel from both sides and what remains is
So a formula built out of nothing but multiplication and addition of coordinates knows the angle. Rearranged, , and this is taken as the definition of angle in dimensions too high to draw.
One consequence deserves its own name. Since , two non-zero vectors are orthogonal, meaning perpendicular, exactly when their dot product is zero. Checking perpendicularity is therefore a multiplication and an addition, with no trigonometry and no picture. Almost everything later in this course that involves a right angle is really this test being applied.
A second consequence is that forces , the Cauchy-Schwarz inequality, holding in every dimension. For and it reads , with equality only when the vectors are parallel.
Example. Find the angle between and .
The dot product is . The lengths are and , whose product is . So , and exactly, since .
Now you. Find the angle between and .
Answer
The dot product is , and the lengths are again and , so and . The negative dot product is the signal that the angle is obtuse, which is worth recognising without computing the arccosine.
What the dot product measures
Physics fixed the meaning before linear algebra did. Work is force times distance only when the two point the same way, and in general the work done by a constant force through a displacement is . Take a force newtons dragging an object through a displacement metres. The dot product is joules. Checking against the other formula: the force has magnitude N, the displacement m, and the angle between them is , so J. The two routes agree, as the derivation says they must, and the second one shows what is happening: only the part of the force lying along the displacement does any work.
That reading, how much of one vector lies along another, is what the dot product measures. If is a unit vector then is exactly the length of the shadow casts on 's line, signed so that a shadow falling the other way counts negative. Take and : the dot product is , which is the coordinate, which is the shadow on the horizontal axis. Coordinates are dot products with the axis directions, a fact that looks like a triviality here and becomes a labour-saving device in the lesson on orthogonality.
Projection
Make that precise for a general direction. Given and a non-zero , the projection of onto is the multiple of that lies directly under , meaning the multiple for which the leftover is perpendicular to . That one condition determines : orthogonality means , so and
with the projection itself being . Nothing was assumed about the dimension, so this works in as readily as in the plane.
The projection splits into two pieces, one along and one perpendicular to it, and that decomposition is used everywhere from resolving forces on a slope to the least squares fitting three lessons ahead.
Example. Project onto , and split into parallel and perpendicular parts.
and , so and the projection is . The leftover is , and its dot product with is , confirming the right angle. The two pieces sum back to .
Now you. Project onto and check the leftover is perpendicular.
Answer
and , so and the projection is . The leftover is , whose dot product with is .
Honest limits
The dot product formula is not a property of the vectors alone: it assumes the coordinates are measured along axes that are themselves perpendicular and equally scaled. Write the same arrows in a slanted coordinate system and the componentwise formula stops giving the right angles. The lesson on change of basis returns to this, and orthogonal bases matter later precisely because they are the ones where the easy formula stays true.
Two other cautions. The cross product, which takes two vectors to a third, exists only in three dimensions and is not part of this course. And the dot product of two vectors of the same length is a poor measure of similarity when the vectors have very different magnitudes, which is why applied work usually normalises first and compares rather than the raw product.
Addition and scaling are now the whole toolkit, and length and angle sit on top of them. Applying those two operations to a fixed collection of vectors, over and over, generates everything the collection can reach, and the next lesson asks what that reachable set looks like and when one of the vectors in the collection is contributing nothing.