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 and — think of them as two vectors, or two columns in a spreadsheet. Then
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 just means "add up over every position from 1 to ". Equality happens in exactly one case: when one list is a constant multiple of the other, for every — the pencil lying flat.
Worked example 1: the two lists, by hand
Let and .
- Left side. Term by term: and . Sum: . Square it: .
- Right side. Sum of squares of : . Sum of squares of : . Product: .
- Check: . True, with a small gap of 4.
Now make the lists proportional. Keep and set , which is exactly .
- Left side: , , sum , squared .
- Right side: .
- Check: . 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.
The same inequality in probability language
Swap "add over positions" for "average over outcomes" and nothing else changes. For two random quantities and ,
where 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:
Divide both sides by the right-hand side and take a square root, and you get : the correlation coefficient can never leave the range to . 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 reaches exactly — the equality case, where one variable is a fixed multiple of the other.
Worked example 2: is this covariance matrix even possible?
A risk system reports, for two strategies: daily volatility and , with covariance .
- Convert the volatilities to variances: and .
- Cauchy-Schwarz ceiling on the covariance: .
- Reported covariance is , which exceeds .
So the numbers are impossible — they imply . 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 , the arithmetic mean (add them up, divide by how many) is never below the geometric mean (multiply them together, take the -th root):
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 and , the vertical bar is their geometric mean, and a bar inside a circle simply cannot be taller than the radius.
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 and .
- Arithmetic mean of the factors: , which looks like "flat".
- Geometric mean: .
- AM-GM check: . The gap is , and that gap is your loss.
Follow the actual money. Start with $100. After year one: . After year two: . You are down 25%. Cross-check with the geometric mean: . 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 for . Apply AM-GM to the two terms and :
The product inside the root is whatever is — the cancels — so the right-hand side is a fixed number. Multiply through by 2: . Equality needs the two terms equal: , so , so .
Sanity-check by hand: gives ; gives ; gives . The minimum is 4 at , 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 is a bug, not a signal. Same for a correlation outside 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 subject to " and "how large can 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 , but that is only the true minimum because 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