Quant Memo
Core

Classic Inequalities: Cauchy-Schwarz and AM-GM

Two inequalities that show up in half of all quant interview maths. Cauchy-Schwarz caps how large a product-sum can be; AM-GM says an average never falls below a geometric average. Together they bound correlations, explain volatility drag, and solve optimisation problems without calculus.

Prerequisites: Expected Value, Correlation

Some questions ask for the exact answer. Others only ask how big can this possibly get? — how large a correlation is even legal, how fast a portfolio can compound, whether a covariance matrix someone handed you is physically possible. Those do not need solving; they need a ceiling. Two inequalities supply almost every ceiling a quant needs, and they turn up constantly in interviews because they answer in one line what looks like a page of calculus.

First, a picture with no symbols in it

Stand a pencil upright in sunlight and look at its shadow on the desk. The shadow can be as long as the pencil, but never longer — and it reaches full length only when the pencil is lying flat, pointing exactly along the shadow's direction. Tilt the pencil at all and the shadow shortens. That is Cauchy-Schwarz: a quantity built from two things is capped by the sizes of those two things, and the cap is reached only when the two point in exactly the same direction.

Now the second picture. You have 40 metres of fencing and want to enclose the biggest rectangular paddock you can. A long thin strip, 19 m by 1 m, encloses 19 m². A square, 10 m by 10 m, encloses 100 m². Same fence, five times the land. That is AM-GM: for a fixed sum, the product is largest when the pieces are all equal, and lopsidedness always costs you.

Hold both pictures. Every formula below is one of them written down.

Cauchy-Schwarz, written out

Take two lists of numbers of the same length. Call them a1,a2,,ana_1, a_2, \dots, a_n and b1,b2,,bnb_1, b_2, \dots, b_n — think of them as two vectors, or two columns in a spreadsheet. Then

(i=1naibi) ⁣2    (i=1nai2)(i=1nbi2).\left( \sum_{i=1}^{n} a_i b_i \right)^{\!2} \;\le\; \left( \sum_{i=1}^{n} a_i^2 \right) \left( \sum_{i=1}^{n} b_i^2 \right).

Read out loud: the square of "multiply the lists together term by term and add" is never bigger than "the sum of squares of the first list" times "the sum of squares of the second list". The symbol i=1n\sum_{i=1}^n just means "add up over every position ii from 1 to nn". Equality happens in exactly one case: when one list is a constant multiple of the other, bi=λaib_i = \lambda a_i for every ii — the pencil lying flat.

Worked example 1: the two lists, by hand

Let a=(3,4)a = (3, 4) and b=(1,2)b = (1, 2).

  • Left side. Term by term: 3×1=33 \times 1 = 3 and 4×2=84 \times 2 = 8. Sum: 3+8=113 + 8 = 11. Square it: 112=12111^2 = 121.
  • Right side. Sum of squares of aa: 9+16=259 + 16 = 25. Sum of squares of bb: 1+4=51 + 4 = 5. Product: 25×5=12525 \times 5 = 125.
  • Check: 121125121 \le 125. True, with a small gap of 4.

Now make the lists proportional. Keep a=(3,4)a = (3,4) and set b=(6,8)b = (6, 8), which is exactly 2a2a.

  • Left side: 3×6=183 \times 6 = 18, 4×8=324 \times 8 = 32, sum =50= 50, squared =2500= 2500.
  • Right side: 25×(36+64)=25×100=250025 \times (36 + 64) = 25 \times 100 = 2500.
  • Check: 250025002500 \le 2500. Equality, because the lists point the same way.

The gap in the first case measures how much the two lists disagree in direction. That is not an analogy — it is the definition of correlation, which is the next section.

tilted: strict inequality aligned: equality a b shadow a b shadow = all of b
Cauchy-Schwarz in one picture. The sum of products a·b is the length of b's shadow on a, scaled by the length of a. Tilt b and the shadow shrinks; only when b points exactly along a does the shadow use all of b, and the inequality becomes an equality.

The same inequality in probability language

Swap "add over positions" for "average over outcomes" and nothing else changes. For two random quantities XX and YY,

(E[XY])2    E[X2]E[Y2],\big( E[XY] \big)^2 \;\le\; E[X^2]\, E[Y^2],

where E[]E[\cdot] is the expected value, the probability-weighted average. In words: the average of the product is capped by the sizes (in a root-mean-square sense) of the two things being multiplied. Apply this to deviations from the mean and the left side becomes the covariance while the right becomes the product of the two variances:

Cov(X,Y)2    Var(X)Var(Y).\operatorname{Cov}(X,Y)^2 \;\le\; \operatorname{Var}(X)\, \operatorname{Var}(Y).

Divide both sides by the right-hand side and take a square root, and you get ρ1|\rho| \le 1: the correlation coefficient can never leave the range 1-1 to +1+1. That famous fact is not a separate rule. It is Cauchy-Schwarz.

Drag the correlation slider below. The scatter never becomes a perfect line until ρ\rho reaches exactly ±1\pm 1 — the equality case, where one variable is a fixed multiple of the other.

Correlation explorer
X →Y ↑
ρ = 0.60r² = 0.36relationship: moderate positive

Worked example 2: is this covariance matrix even possible?

A risk system reports, for two strategies: daily volatility σA=6%\sigma_A = 6\% and σB=5%\sigma_B = 5\%, with covariance Cov(A,B)=0.0040\operatorname{Cov}(A,B) = 0.0040.

  • Convert the volatilities to variances: Var(A)=0.062=0.0036\operatorname{Var}(A) = 0.06^2 = 0.0036 and Var(B)=0.052=0.0025\operatorname{Var}(B) = 0.05^2 = 0.0025.
  • Cauchy-Schwarz ceiling on the covariance: 0.0036×0.0025=0.000009=0.0030\sqrt{0.0036 \times 0.0025} = \sqrt{0.000009} = 0.0030.
  • Reported covariance is 0.00400.0040, which exceeds 0.00300.0030.

So the numbers are impossible — they imply ρ=0.0040/0.0030=1.33\rho = 0.0040 / 0.0030 = 1.33. Something in the pipeline is broken: different sample windows, a stale volatility estimate, or a hand-edited cell. This check takes ten seconds and catches real bugs; it is why nearest-correlation-matrix repair exists and why positive semidefinite is the condition a covariance matrix must satisfy.

AM-GM, written out

For any non-negative numbers x1,x2,,xnx_1, x_2, \dots, x_n, the arithmetic mean (add them up, divide by how many) is never below the geometric mean (multiply them together, take the nn-th root):

x1+x2++xnn    x1x2xnn.\frac{x_1 + x_2 + \cdots + x_n}{n} \;\ge\; \sqrt[n]{x_1 x_2 \cdots x_n}.

In words: averaging by adding always gives you at least as much as averaging by multiplying, and the two are equal only when all the numbers are identical. The more spread out the numbers, the wider the gap. Here is the classic picture, a semicircle: the radius is the arithmetic mean of aa and bb, the vertical bar is their geometric mean, and a bar inside a circle simply cannot be taller than the radius.

a chord can never beat the radius a b √(ab) (a+b)/2 split the diameter into a and b
Split a diameter of length a + b at the point where the two pieces are a and b. The half-chord standing at that split has height exactly √(ab), the geometric mean; the radius is (a+b)/2, the arithmetic mean. The chord equals the radius only when the split is dead centre, that is when a = b.

Worked example 3: why +50% then -50% loses money

A fund gains 50% one year and loses 50% the next. The two growth factors are 1.51.5 and 0.50.5.

  • Arithmetic mean of the factors: (1.5+0.5)/2=1.00(1.5 + 0.5)/2 = 1.00, which looks like "flat".
  • Geometric mean: 1.5×0.5=0.75=0.8660\sqrt{1.5 \times 0.5} = \sqrt{0.75} = 0.8660.
  • AM-GM check: 1.000.86601.00 \ge 0.8660. The gap is 0.1340.134, and that gap is your loss.

Follow the actual money. Start with $100. After year one: 100×1.5=150100 \times 1.5 = 150. After year two: 150×0.5=75150 \times 0.5 = 75. You are down 25%. Cross-check with the geometric mean: 100×0.86602=100×0.75=75100 \times 0.8660^2 = 100 \times 0.75 = 75. It matches, because the geometric mean is by construction the constant rate that reproduces the final wealth.

This is volatility drag, and AM-GM says it is unavoidable: the compounded return is always at or below the average return, and the shortfall grows with dispersion. It is why Kelly sizing exists, and it is the same curvature effect as Jensen's inequality.

Worked example 4: optimisation with no derivatives

Minimise f(x)=x+4xf(x) = x + \dfrac{4}{x} for x>0x > 0. Apply AM-GM to the two terms xx and 4/x4/x:

x+4/x2    x4x=4=2.\frac{x + 4/x}{2} \;\ge\; \sqrt{x \cdot \frac{4}{x}} = \sqrt{4} = 2 .

The product inside the root is 44 whatever xx is — the xx cancels — so the right-hand side is a fixed number. Multiply through by 2: x+4/x4x + 4/x \ge 4. Equality needs the two terms equal: x=4/xx = 4/x, so x2=4x^2 = 4, so x=2x = 2.

Sanity-check by hand: x=1x = 1 gives 1+4=51 + 4 = 5; x=2x = 2 gives 2+2=42 + 2 = 4; x=4x = 4 gives 4+1=54 + 1 = 5. The minimum is 4 at x=2x = 2, found without differentiating anything.

Cauchy-Schwarz caps a product-sum; AM-GM caps a product given a sum. Both are equalities only when everything is proportional (Cauchy-Schwarz) or equal (AM-GM). Nine times out of ten, spotting which one applies is the whole solution.

What this means in practice

  • Data validation. Any reported covariance above σAσB\sigma_A \sigma_B is a bug, not a signal. Same for a correlation outside [1,1][-1, 1] or a risk contribution larger than total risk.
  • Compounding. Report geometric returns, not arithmetic ones, when describing what an investor actually earned. The gap between the two measures how bumpy the ride was.
  • Sizing and diversification. AM-GM is the formal reason equal-ish weights across similar assets beat concentrated ones for a fixed risk budget; Cauchy-Schwarz bounds how much diversification a correlated basket can give you.
  • Interviews. "Maximise xyxy subject to x+y=10x + y = 10" and "how large can aibi\sum a_i b_i be?" are these two in costume. Answer in one line, then state the equality case — that is what the interviewer is listening for.

An inequality gives you a bound, not automatically a minimum. AM-GM proves x+4/x4x + 4/x \ge 4, but that is only the true minimum because x=2x = 2 is actually reachable and makes both sides equal. If the equality case violates your constraints, the bound is still true and still useless. Always finish by checking that the equality point is attainable. And AM-GM requires every number to be non-negative — apply it to a list containing a negative return and you will "prove" nonsense.

To spot AM-GM: look for a sum whose terms multiply to something with the variable cancelled out. To spot Cauchy-Schwarz: look for a sum of products you want to bound by two sums of squares. Then immediately write down the equality condition — proportional lists, or all terms equal.

Related concepts

Practice in interviews

Further reading

  • Steele, The Cauchy-Schwarz Master Class (ch. 1-2)
  • Blitzstein & Hwang, Introduction to Probability, ch. 10
ShareTwitterLinkedIn