AM-GM as a Puzzle Tool
The arithmetic mean of a set of positive numbers is always at least their geometric mean, with equality exactly when the numbers are all equal — a one-line inequality that solves a surprising fraction of interview optimization puzzles.
Minimize for . Calculus solves this immediately with a derivative, but many interviewers ask it precisely to see if you know a faster route — one that also generalizes to problems calculus handles clumsily, like "minimize given ." The fast route is a single inequality: the arithmetic mean of positive numbers is never smaller than their geometric mean.
The inequality, one symbol at a time
For any two positive numbers :
with equality exactly when . In plain English: the average of two positive numbers is always at least as large as their geometric mean (the square root of their product), and the only time they're exactly equal is when the two numbers are equal to each other. This extends to positive numbers : their arithmetic mean is at least their geometric mean, , again with equality only when all numbers are equal. The proof for two numbers is one line: expands to , since a square can never be negative.
Worked example 1: minimizing x + 1/x
Apply AM-GM to and (both positive since ): , so . Equality holds exactly when , i.e. , giving . The minimum value is , achieved at — read off directly from the inequality, no derivative required, and the equality condition tells you exactly where the minimum sits without checking a second-derivative sign.
Worked example 2: maximizing a product under a fixed sum
Given with , find the maximum possible value of . AM-GM gives , i.e. , so . Equality requires , and since they sum to that forces , which indeed gives . This is the general pattern behind "split a fixed budget evenly to maximize a product" — a fence-building or resource-allocation puzzle in disguise, solved without calculus by recognizing the sum is fixed and the target is a product.
For positive numbers, arithmetic mean geometric mean, with equality exactly when all the numbers are equal. Use it to bound a sum from below when a product is fixed, or bound a product from above when a sum is fixed — the equality condition tells you exactly where the extremum occurs.
AM-GM only applies to positive numbers, and it only directly gives you the extremum when the equality condition (, or all terms equal) is actually achievable given the problem's other constraints — check that before trusting the bound is tight.
Related concepts
Practice in interviews
Further reading
- Engel, Problem-Solving Strategies, ch. 6