Chapter 1: Vectors and Their Algebra#
Have you ever wondered how a video game keeps track of where everything is, or how a pilot plots a straight-line course from one city to another? Behind both is a simple but powerful idea: the vector. In this chapter, we’ll meet vectors as both arrows in space and lists of numbers. We’ll learn the basic algebra to add them, stretch them, and measure their lengths and angles.
The Big Picture#
This chapter answers a core question: what is a vector, and how can we combine and compare them? Vectors are the building blocks of linear algebra. By the end, you’ll be able to manipulate vectors algebraically and visualize them geometrically — a skill that opens the door to everything from computer graphics to machine learning.
What Is a Vector?#
A vector is a mathematical object that has two separate properties: a magnitude (how big it is) and a direction. Think of an arrow: its length tells you “how much,” and the way it points tells you “which way.” That’s the geometric picture.
For calculations, we usually write vectors as lists of numbers, called components. A vector in the plane, for instance, can be written as
where
Vector: An object with magnitude and direction; algebraically, an ordered list of real numbers
.
When we draw a vector as an arrow, we usually place its tail at the origin
📝 Section Recap: A vector is both a geometric arrow (with length and direction) and an algebraic list of numbers. These two views are equivalent and we’ll switch between them freely.
Adding and Scaling Vectors#
The two most basic things you can do with vectors are add them together and multiply them by an ordinary number (a scalar).
Vector addition works componentwise. If
Geometrically, addition follows the “tip-to-tail” rule. Place the tail of
Scalar multiplication stretches or shrinks a vector, and can reverse its direction. For a scalar
If
These operations follow the usual rules of arithmetic: addition is commutative (
Scalar: An ordinary real number used to scale a vector.
📝 Section Recap: Vector addition combines arrows tip-to-tail or componentwise; scalar multiplication stretches, shrinks, or reverses a vector. Together they form the foundation of vector algebra.
Linear Combinations and Span#
Once you can add and scale vectors, you can build new vectors by mixing several of them. A linear combination of vectors
where the
The span of a set of vectors is the collection of all possible linear combinations you can make from them. If we say “the span of
Linear combination: A sum of scalar multiples of vectors:
. Span: The set of all linear combinations of a given set of vectors.
Geometrically, the span of a single non-zero vector is a line through the origin (all scalar multiples of that vector). The span of two non-parallel vectors in the plane is the entire plane. If the two vectors happen to be parallel, their span is only a line — they don’t give you any “new” direction. This idea of direction independence is a preview of linear independence, which we’ll explore later.
📝 Section Recap: Linear combinations let us mix vectors using scalars; the span of a set of vectors is all the points we can reach by such mixing. Span tells us how much of space a set of vectors can “cover.”
The Dot Product and Length#
So far we’ve talked about adding and scaling, but how do we measure a vector’s length or the angle between two vectors? That’s where the dot product (or inner product) comes in.
For two vectors
In higher dimensions, you simply sum the products of corresponding components:
The dot product gives a single number that captures both the lengths of the vectors and how much they point in the same direction.
The length (also called the norm or magnitude) of a vector
This matches the familiar distance from the origin to the point
A unit vector is a vector whose length is exactly 1. You can turn any non-zero vector into a unit vector that points the same way by dividing it by its length:
Unit vectors are handy for describing pure direction, ignoring magnitude.
Dot product: The sum of componentwise products; a scalar that measures how much two vectors “align.”
Length (norm):
, the distance from the origin to the tip of the vector. Unit vector: A vector with length 1, obtained by dividing a vector by its length.
📝 Section Recap: The dot product multiplies corresponding components and sums them. The length of a vector is the square root of its dot product with itself, and unit vectors give us pure direction.
Angles and Inequalities#
The dot product does more than give length — it lets us find the angle between two vectors. If
This formula follows from the law of cosines using the triangle formed by
Since
Equality holds exactly when one vector is a scalar multiple of the other — that is, when they point in the same or opposite direction. This inequality is one of the most useful tools in all of linear algebra; it guarantees that the angle formula always yields a valid cosine.
A direct consequence is the triangle inequality:
Geometrically, it says that the straight-line distance from the tail of
When the dot product is exactly zero, the angle is
Cauchy–Schwarz inequality:
; the absolute dot product is bounded by the product of lengths. Triangle inequality:
; the direct path is never longer than the sum of the legs. Orthogonal vectors: Vectors whose dot product is zero; they meet at a right angle.
📝 Section Recap: The dot product defines the angle between vectors via the cosine formula. The Cauchy–Schwarz inequality ensures the formula is well-behaved, and the triangle inequality bounds the length of a sum. A zero dot product means the vectors are perpendicular.
Summary#
We started with the simple idea of an arrow — a vector — and turned it into a list of numbers. Adding and scaling vectors showed us that every linear combination builds new vectors. The dot product gave us tools to measure length, direction, and angle, linking algebra back to geometry. The Cauchy–Schwarz and triangle inequalities keep these measurements consistent. Now you’re ready to explore matrices, linear systems, and beyond.
| Key idea | What it means (plain English) | Why it matters |
|---|---|---|
| Vector | An arrow with length and direction, or a list of numbers. | The fundamental object we study; everything else is built from vectors. |
| Scalar multiplication | Multiplying a vector by a number stretches, shrinks, or reverses it. | Lets us change magnitude and direction independently. |
| Linear combination | A sum of scalar multiples of vectors, like |
The basic way to build new vectors from old ones; the heart of linear algebra. |
| Span | All vectors you can reach by taking linear combinations of a given set. | Tells you how much of space a set of vectors can “cover.” |
| Dot product | Sum of componentwise products; a single number. | Measures alignment and gives us length, angle, and orthogonality. |
| Length (norm) | Quantifies the size of a vector. | |
| Unit vector | A vector scaled to have length exactly 1. | Captures pure direction, ignoring magnitude. |
| Cauchy–Schwarz inequality | $ | \mathbf{v}\cdot\mathbf{w} |
| Triangle inequality | Confirms that vector addition behaves like ordinary distance. | |
| Orthogonal vectors | Vectors with zero dot product; at right angles. | Signals complete directional independence; essential for coordinate systems. |