← mapVectors & Matrices

Vectors

⚗ Dr. Möbius, from the lab

You already know how to describe a location — just two numbers on the coordinate plane. But a location isn't the same as a displacement, and today we're going to tear that distinction open and stuff vectors inside. This is where numbers grow a direction. This is where linear algebra begins to actually give a damn about the physical universe. And this, you magnificent idiot, is where the real machinery of this course begins.

THE BIG IDEA

A vector is a magnitude paired with a direction — stored as a tuple of components, visualized as an arrow, and operated on by addition and scalar multiplication.

Arrows and tuples: two faces of one beast

Here's an observation so obvious you'll be annoyed I'm saying it: when you drive to the store, you don't just need to know how far you drove — you need to know which direction you went. Ten kilometers north and ten kilometers south are not the same trip. The thing that captures both magnitude AND direction simultaneously is a vector.

We write a vector in R2\mathbb{R}^2 as a column of components: v=(v1v2)\vec{v} = \begin{pmatrix} v_1 \\ v_2 \end{pmatrix}

or inline as v=(v1,v2)\vec{v} = (v_1, v_2). The v1v_1 is how far you move horizontally; v2v_2 is how far you move vertically. Draw it as an arrow from some starting point in the direction of those components — that arrow is the vector. The position of the tail doesn't matter; two arrows with the same length and direction are the same vector. This is the crucial thing the Federation of Boring Textbooks glosses over, and I am furious about it every semester: vectors are not stuck to the origin. They're free. A vector is a displacement, not a point. Do not mix them up or I will make you re-read this section.

Vector addition: tip-to-tail

Adding two vectors is stupidly natural. The tip-to-tail rule: put w\vec{w}'s tail at v\vec{v}'s tip. The sum v+w\vec{v} + \vec{w} is the arrow from v\vec{v}'s tail to w\vec{w}'s tip. Draw it and it's obvious.

Componentwise, it's even simpler: (v1v2)+(w1w2)=(v1+w1v2+w2)\begin{pmatrix} v_1 \\ v_2 \end{pmatrix} + \begin{pmatrix} w_1 \\ w_2 \end{pmatrix} = \begin{pmatrix} v_1 + w_1 \\ v_2 + w_2 \end{pmatrix}

Add the first components; add the second components. No interaction between components. This works in Rn\mathbb{R}^n for any nn — just add all the corresponding components.

The zero vector 0=(0,0)\vec{0} = (0, 0) is the additive identity: v+0=v\vec{v} + \vec{0} = \vec{v}. It's the arrow with zero length — a point, conceptually. It sits at the origin and does absolutely nothing, which is precisely its job.

Vector subtraction vw\vec{v} - \vec{w} is the arrow from the tip of w\vec{w} to the tip of v\vec{v} (when both are drawn from the same base point). Componentwise: subtract the components. File that picture away — it's how you compute "the displacement from w\vec{w} to v\vec{v}."

Drag the vectors below and watch how the sum moves as you manipulate each one:

vector playground — addition
u = (2, 1)v = (-1, 2)u + v = (1, 3)

Scalar multiplication: stretch, shrink, flip

A scalar is just a real number — the word "scalar" is fancy for "something that scales". Multiply a vector by a scalar cc:

c(v1v2)=(cv1cv2)c \cdot \begin{pmatrix} v_1 \\ v_2 \end{pmatrix} = \begin{pmatrix} c v_1 \\ c v_2 \end{pmatrix}

Geometrically: c>1c > 1 stretches, 0<c<10 < c < 1 shrinks, c<0c < 0 reverses direction, c=0c = 0 collapses to 0\vec{0}.

In particular, 1v=v-1 \cdot \vec{v} = -\vec{v} is the additive inverse: v+(v)=0\vec{v} + (-\vec{v}) = \vec{0}. This is the "undo" operation for vectors, exactly like negative numbers were the undo for addition (remember the integers? same move).

All the usual arithmetic laws hold: scalar multiplication distributes over vector addition, and vector addition is commutative and associative. These aren't miracles — they're inherited directly from the real-number laws applied componentwise. If you're not sure, try checking c(v+w)=cv+cwc(\vec{v} + \vec{w}) = c\vec{v} + c\vec{w} yourself. It takes twelve seconds and requires zero equipment. Do it. I'll wait.

Length: Pythagoras cashes in

How long is the vector v=(v1,v2)\vec{v} = (v_1, v_2)? Draw it as an arrow from the origin. It's the hypotenuse of a right triangle with legs v1|v_1| and v2|v_2|. The Pythagorean theorem gives us the answer immediately:

v=v12+v22\|\vec{v}\| = \sqrt{v_1^2 + v_2^2}

This is the norm or magnitude or length of v\vec{v} — three words for the same thing, because mathematicians are apparently committed to keeping beginners in a state of low-grade panic. They all mean the same damn thing: how long is the arrow. In Rn\mathbb{R}^n, the same formula extends:

v=v12+v22++vn2\|\vec{v}\| = \sqrt{v_1^2 + v_2^2 + \cdots + v_n^2}

A unit vector has length exactly 1. The two flagship unit vectors in R2\mathbb{R}^2 are: e^1=(10),e^2=(01)\hat{e}_1 = \begin{pmatrix} 1 \\ 0 \end{pmatrix}, \quad \hat{e}_2 = \begin{pmatrix} 0 \\ 1 \end{pmatrix}

These are the standard basis vectors (file that word away for the next stratum — it'll be very important). Normalizing a vector means dividing by its length to get a unit vector:

v^=vv\hat{v} = \frac{\vec{v}}{\|\vec{v}\|}

This gives you a vector pointing the same direction as v\vec{v} but with length 1. Useful whenever you care about direction but not magnitude.

Into higher dimensions

Here's where it gets philosophically interesting. In R3\mathbb{R}^3, a vector is (v1,v2,v3)(v_1, v_2, v_3) — three components. You can still picture it as an arrow in 3D space. The length formula is v12+v22+v32\sqrt{v_1^2 + v_2^2 + v_3^2}, and that's still just Pythagoras, applied twice.

In Rn\mathbb{R}^n, there's a vector with nn components: (v1,v2,,vn)(v_1, v_2, \ldots, v_n). You cannot picture it as a geometric arrow when n>3n > 3. Your brain fails. The pictures fade, the components keep working, and that is the whole fucking point of the algebraic formulation — it doesn't require your visual cortex to cooperate. The machinery works regardless of whether you can visualize it. Welcome to genuine abstraction. It will feel strange. Push through.

This is the first taste of genuine abstraction: we build up intuition in R2\mathbb{R}^2 and R3\mathbb{R}^3, and then the algebra carries us forward where pictures cannot. Get comfortable with that feeling, because it's how the next several strata operate.

🔬 SPECIMENS (worked examples)

Worked example 1 — adding and stretching

Let u=(31)\vec{u} = \begin{pmatrix} 3 \\ -1 \end{pmatrix} and w=(14)\vec{w} = \begin{pmatrix} -1 \\ 4 \end{pmatrix}. Compute (a) u+w\vec{u} + \vec{w} and (b) 2uw2\vec{u} - \vec{w}.

(a) Add componentwise: u+w=(3+(1)1+4)=(23)\vec{u} + \vec{w} = \begin{pmatrix} 3 + (-1) \\ -1 + 4 \end{pmatrix} = \begin{pmatrix} 2 \\ 3 \end{pmatrix}

Picture: put w\vec{w}'s tail at u\vec{u}'s tip; the result arrow reaches (2,3)(2, 3) from the origin.

(b) First compute 2u2\vec{u}: 2u=(232(1))=(62)2\vec{u} = \begin{pmatrix} 2 \cdot 3 \\ 2 \cdot (-1) \end{pmatrix} = \begin{pmatrix} 6 \\ -2 \end{pmatrix}

Now 2uw=2u+(1)w2\vec{u} - \vec{w} = 2\vec{u} + (-1)\vec{w}: (62)(14)=(6(1)24)=(76)\begin{pmatrix} 6 \\ -2 \end{pmatrix} - \begin{pmatrix} -1 \\ 4 \end{pmatrix} = \begin{pmatrix} 6 - (-1) \\ -2 - 4 \end{pmatrix} = \begin{pmatrix} 7 \\ -6 \end{pmatrix}

Check: 2(3)(1)=72(3) - (-1) = 7. 2(1)4=62(-1) - 4 = -6. Both components verified.

Worked example 2 — length and normalization

Find the length of v=(34)\vec{v} = \begin{pmatrix} -3 \\ 4 \end{pmatrix} and then compute its unit vector v^\hat{v}.

Length: v=(3)2+42=9+16=25=5\|\vec{v}\| = \sqrt{(-3)^2 + 4^2} = \sqrt{9 + 16} = \sqrt{25} = 5

This is a 33-44-55 right triangle wearing different signs. The length is 5.

Unit vector: v^=vv=15(34)=(3/54/5)\hat{v} = \frac{\vec{v}}{\|\vec{v}\|} = \frac{1}{5}\begin{pmatrix} -3 \\ 4 \end{pmatrix} = \begin{pmatrix} -3/5 \\ 4/5 \end{pmatrix}

Verify: v^=(3/5)2+(4/5)2=9/25+16/25=25/25=1\|\hat{v}\| = \sqrt{(-3/5)^2 + (4/5)^2} = \sqrt{9/25 + 16/25} = \sqrt{25/25} = 1. It works. You should always verify that your unit vector actually has length 1 — it's a free check.

Worked example 3 — the trap: normalizing zero is not just wrong, it's incoherent

A student tries to normalize the zero vector: 0^=00\hat{0} = \frac{\vec{0}}{\|\vec{0}\|}. What goes wrong, and why?

The zero vector 0=(0,0)\vec{0} = (0, 0) has length 0=02+02=0\|\vec{0}\| = \sqrt{0^2 + 0^2} = 0.

So the "normalization formula" would require dividing by zero: 0^=00=undefined\hat{0} = \frac{\vec{0}}{0} = \text{undefined}

This isn't a computational accident — it's conceptually forced. Normalizing a vector extracts its direction. The zero vector has NO direction; it's a point, not an arrow. There is no "unit vector in the direction of 0\vec{0}" because 0\vec{0} has no direction to point. Division by zero is just the algebra's way of telling you the question doesn't make sense.

This is why in every theorem about unit vectors and normalized vectors, you'll see the hypothesis "v0\vec{v} \ne \vec{0}." That condition isn't laziness — it's the theorem needing the division to be defined.

☠ KNOWN HAZARDS

  • Confusing vectors with points. A vector (3,4)(3, 4) is NOT the point (3,4)(3, 4) — it's the displacement (3,4)(3, 4). Vectors can sit with their tails anywhere; points are fixed. This matters when you add: you can add two vectors (displacements), but "adding two points" is nonsense.

  • Computing length as v1+v2|v_1| + |v_2| instead of v12+v22\sqrt{v_1^2 + v_2^2}. The first formula is "taxicab distance" — useful in other contexts, completely wrong for Euclidean length. Always Pythagoras. If you use taxicab distance on a Euclidean-length problem I will personally send your answer back with a sad beaker emoji.

  • Forgetting the sign when negating. v=(v1,v2)-\vec{v} = (-v_1, -v_2), not (v1,v2)(-v_1, v_2). Both components flip. The whole vector reverses direction, not just the first component.

  • Trying to "add" vectors of different dimensions. (1,2)(1, 2) and (1,2,3)(1, 2, 3) cannot be added — the dimensions must match. The formula requires corresponding components.

TL;DR

  • A vector is a magnitude + direction, stored as a tuple (v1,v2,,vn)(v_1, v_2, \ldots, v_n) and drawn as a free arrow — tail position is irrelevant.

  • Addition is tip-to-tail geometrically, and componentwise numerically: (v1,v2)+(w1,w2)=(v1+w1,v2+w2)(v_1, v_2) + (w_1, w_2) = (v_1+w_1, v_2+w_2).

  • Scalar multiplication stretches/shrinks/flips a vector: cvc\vec{v} has components (cv1,cv2)(cv_1, cv_2).

  • Length: v=v12+v22++vn2\|\vec{v}\| = \sqrt{v_1^2 + v_2^2 + \cdots + v_n^2}, by Pythagoras. Normalizing divides by v\|\vec{v}\| to get a unit vector.

  • In Rn\mathbb{R}^n for large nn, the pictures fade but the algebra doesn't — the whole game is that the formulas work in any dimension.

unlocks