Quant Memo
Core

Cauchy-Schwarz as a Puzzle Tool

How the Cauchy-Schwarz inequality — a bound on the dot product of two vectors — turns up as a quick trick for solving interview optimization and inequality puzzles.

The Cauchy-Schwarz inequality says that for any two lists of numbers (a1,,an)(a_1,\dots,a_n) and (b1,,bn)(b_1,\dots,b_n), (aibi)2(ai2)(bi2)\left(\sum a_i b_i\right)^2 \le \left(\sum a_i^2\right)\left(\sum b_i^2\right), with equality exactly when the two lists are proportional to each other. In plain terms: the "alignment" between two vectors, measured by their dot product, can never exceed the product of their individual sizes — you can't get more out of combining two vectors than their lengths allow, and you only get the maximum when they point in exactly the same direction.

In interview puzzles this shows up as a fast way to prove a bound or find an optimum without calculus. A classic instance: minimize x2+y2x^2 + y^2 subject to x+y=10x + y = 10. Writing 10=x+y=1x+1y10 = x + y = 1\cdot x + 1\cdot y and applying Cauchy-Schwarz with a=(x,y)a=(x,y), b=(1,1)b=(1,1) gives 102(x2+y2)(12+12)10^2 \le (x^2+y^2)(1^2+1^2), so x2+y250x^2+y^2 \ge 50, with equality when x=y=5x=y=5 — the minimum is 50, found in two lines instead of a Lagrange multiplier setup. Interviewers like this problem because it tests whether a candidate recognizes the inequality's shape rather than reaching straight for calculus.

Cauchy-Schwarz bounds a dot product by the product of vector lengths, which turns many "minimize a sum of squares subject to a linear constraint" puzzles into a one-line algebraic bound instead of a calculus optimization.

Related concepts

Practice in interviews

Further reading

  • Steele, The Cauchy-Schwarz Master Class
ShareTwitterLinkedIn