A feature vector's "size" sounds like one number. Drag this arrow around — watch three different rulers disagree about how big it is.
Same arrow, three measurements. One adds up the straight-line steps along each axis, one measures the direct diagonal distance, and one just asks "what's the single biggest component?"
Those three rulers are the L1, L2, and L∞ norms of a vector —
- — the L1 (Manhattan) norm: sum of absolute components, like walking city blocks.
- — the L2 (Euclidean) norm: straight-line length, the one "distance" usually means.
- — the L∞ norm: just the largest component in absolute value.
- They never disagree about ordering
For any vector, — the diagonal is never longer than the sum of the legs, and the single biggest leg is never longer than the diagonal.
- They disagree about how much a large single component matters
- L1 punishes every nonzero component equally.
- L∞ only ever cares about the worst one.
That difference is exactly why L1 vs. L2 regularization (a few chapters ahead) produce such different behavior.
Norms measure the size of one vector. Drag around the fixed and watch cosine similarity — the same dot-product machinery, but normalized by both magnitudes so it only measures direction, not size.
- Compute all three norms of v = (3, 4)
Exactly the ordering the Formalize step predicted: .
- Compute cosine similarity and distance for a=(4,0), b=(3,4)
Two feature vectors can point in a similar direction (cosine close to 1) even if their L2 norms are wildly different sizes — which is exactly why cosine similarity, not raw distance, is the standard way to compare documents or embeddings of different lengths.
Drag b until it’s perpendicular to the fixed vector a — the exact point where cosine similarity crosses zero.
Norms measure how big a single vector is — L1, L2, and L∞ disagree about how to measure it. Cosine similarity ignores size entirely and measures only direction, which is why it's the default way to compare feature vectors in machine learning.