Chapter 18 Quiz — Dot Products, Norms, and Angles
Twelve quick checks on the dot product, the norm, orthogonality, the angle in $n$ dimensions, Cauchy–Schwarz, and cosine similarity. Try each before opening the answer. Most are conceptual; a couple need a little arithmetic.
Q1. Give the two formulas for $\mathbf{u}\cdot\mathbf{v}$ — algebraic and geometric — and say what each contributes.
Answer
Algebraic: $\mathbf{u}\cdot\mathbf{v}=\sum_i u_i v_i$ (multiply matching components and add). Geometric: $\mathbf{u}\cdot\mathbf{v}=\lVert\mathbf{u}\rVert\lVert\mathbf{v}\rVert\cos\theta$ (lengths times the cosine of the angle). The algebraic form is how you *compute* it — in any dimension, with no angle needed; the geometric form is what it *means* — aligned length. The whole chapter rests on the fact (proved in §18.3 via the law of cosines) that the two are equal.Q2. Is $\mathbf{u}\cdot\mathbf{v}$ a scalar or a vector? Why is that the right kind of output?
Answer
A **scalar** — a single number. That is exactly what we want, because the dot product measures things that are themselves single numbers: length (dot a vector with itself, then square-root) and the cosine of an angle. A common beginner error, fresh from Chapter 2 where every operation returned a vector, is to expect the dot product to have components. It does not.Q3. How is the norm defined in terms of the dot product, and why is that definition powerful?
Answer
$\lVert\mathbf{v}\rVert=\sqrt{\mathbf{v}\cdot\mathbf{v}}$, because $\mathbf{v}\cdot\mathbf{v}=\sum v_i^2=\lVert\mathbf{v}\rVert^2$. It is powerful because length is then *not a separate idea* — every fact and manipulation we have for dot products immediately applies to lengths. (For instance, the triangle inequality falls out of Cauchy–Schwarz, which is a statement about dot products.)Q4. State the algebraic test for orthogonality and the geometric reason behind it.
Answer
$\mathbf{u}$ and $\mathbf{v}$ are orthogonal exactly when $\mathbf{u}\cdot\mathbf{v}=0$. Geometrically, orthogonal means the angle is $90^\circ$, and $\cos 90^\circ=0$, so the geometric dot product $\lVert\mathbf{u}\rVert\lVert\mathbf{v}\rVert\cos\theta$ collapses to zero. The test turns a geometric question (perpendicular?) into a one-line arithmetic check that works in any dimension.Q5. A vector $\mathbf{w}$ has $\mathbf{w}\cdot\mathbf{w}=64$. What is $\lVert\mathbf{w}\rVert$? What is $\lVert 3\mathbf{w}\rVert$?
Answer
$\lVert\mathbf{w}\rVert=\sqrt{64}=8$. By absolute homogeneity, $\lVert 3\mathbf{w}\rVert=|3|\cdot\lVert\mathbf{w}\rVert=3\cdot 8=24$ — no components required. This is the payoff of defining length through the dot product and knowing the norm's four properties.Q6. State the Cauchy–Schwarz inequality, its conditions, and its equality case.
Answer
For **all** vectors $\mathbf{u},\mathbf{v}\in\mathbb{R}^n$ (no restrictions), $|\mathbf{u}\cdot\mathbf{v}|\le\lVert\mathbf{u}\rVert\lVert\mathbf{v}\rVert$. Equality holds **if and only if $\mathbf{u}$ and $\mathbf{v}$ are parallel** (one is a scalar multiple of the other, including when either is the zero vector). It holds for every pair — that universality is exactly why it can license the angle formula in any dimension.Q7. Why does Cauchy–Schwarz guarantee the angle formula makes sense?
Answer
Dividing $|\mathbf{u}\cdot\mathbf{v}|\le\lVert\mathbf{u}\rVert\lVert\mathbf{v}\rVert$ by the positive product $\lVert\mathbf{u}\rVert\lVert\mathbf{v}\rVert$ gives $\left|\frac{\mathbf{u}\cdot\mathbf{v}}{\lVert\mathbf{u}\rVert\lVert\mathbf{v}\rVert}\right|\le 1$. So the fraction always lies in $[-1,1]$ — exactly the domain of $\arccos$. Without this bound, $\arccos$ of the fraction could be undefined, and "the angle between two vectors in $\mathbb{R}^{300}$" would be meaningless.Q8. What is cosine similarity, what is its range, and why is it length-invariant?
Answer
$\operatorname{cossim}(\mathbf{u},\mathbf{v})=\frac{\mathbf{u}\cdot\mathbf{v}}{\lVert\mathbf{u}\rVert\lVert\mathbf{v}\rVert}=\cos\theta$. Its range is $[-1,1]$ (by Cauchy–Schwarz): near $+1$ = same direction, $0$ = orthogonal, near $-1$ = opposite. It is length-invariant because scaling $\mathbf{u}$ by any positive $c$ multiplies the numerator by $c$ and the denominator by $c$ (through $\lVert c\mathbf{u}\rVert=c\lVert\mathbf{u}\rVert$), so the $c$'s cancel. That is why it judges documents by content mix, not length.Q9. True or false: cosine similarity is a distance. Explain.
Answer
**False.** A distance is *small* when things are alike; cosine similarity is *large* (near $1$) when things are alike — the opposite sense. People sometimes form **cosine distance** $=1-\operatorname{cossim}$, but even that is not a true metric (it can violate the triangle inequality). Always check whether your tool wants "bigger means closer" (similarity) or "smaller means closer" (distance).Q10. Two vectors are chosen at random in $\mathbb{R}^{1000}$. What is the most likely angle between them, and why?
Answer
About $90^\circ$ — they are almost certainly **nearly orthogonal**. In the dot product $\sum u_i v_i$, the many terms are equally likely positive or negative and largely cancel, keeping the dot product small, while each norm grows like $\sqrt{n}$; so $\cos\theta\to 0$ and $\theta\to 90^\circ$. High-dimensional space is mostly right angles, which is why a genuinely high cosine similarity stands out so sharply (the basis of similarity search in embedding spaces).Q11. Why does the Euclidean ($\ell^2$) norm "carry angles" while the $\ell^1$ and $\ell^\infty$ norms do not?
Answer
Because the Euclidean norm comes from a **dot product**: $\lVert\mathbf{v}\rVert_2=\sqrt{\mathbf{v}\cdot\mathbf{v}}$, and the dot product is what defines angle via $\cos\theta=\frac{\mathbf{u}\cdot\mathbf{v}}{\lVert\mathbf{u}\rVert\lVert\mathbf{v}\rVert}$. The $\ell^1$ norm ($\sum|v_i|$) and $\ell^\infty$ norm ($\max|v_i|$) are legitimate measures of length — they obey all four norm properties — but no inner product generates them, so there is no associated notion of angle or orthogonality.Q12. Connect the dot product to the four fundamental subspaces: why is the null space orthogonal to the row space?