math optimization algebra inequalities

The AM-GM Inequality: The Simplest Bound That Powers All of Optimization

Here's a trick question: you invest $100. Year one, it gains 50%. Year two, it loses 50%. What's your average annual return?

If you said 0% — the arithmetic average of +50 and -50 — you'd be wrong about your money. After year one you have $150. After year two you lose half of that, leaving you with $75. You're down 25%, not flat. The "average" lied to you, and it lied to you in a very specific, very mathematical way: it used the wrong kind of average. The right one — the geometric mean — would have told you the truth from the start. The gap between those two averages isn't a quirk of this example. It's a theorem, one of the oldest and most quietly powerful in all of mathematics: the AM-GM inequality.

The Concept

AM-GM stands for Arithmetic Mean – Geometric Mean, and the inequality says something deceptively simple: for any list of non-negative numbers, their arithmetic mean (the ordinary average you learned in grade school) is always greater than or equal to their geometric mean (the n-th root of their product). For two numbers a and b:

(a + b) / 2 ≥ √(ab)

Try it: for 4 and 9, the arithmetic mean is 6.5, and the geometric mean is √36 = 6. Sure enough, 6.5 ≥ 6. Try 4 and 4: arithmetic mean is 4, geometric mean is √16 = 4. They're equal. That equality case is the whole key to the inequality's power — the two means are equal if and only if all the numbers are the same. The moment any of the numbers differ from each other, the arithmetic mean strictly pulls ahead.

Why does this happen? One elegant way to see it, dating back to the geometry in Euclid's Elements, is to picture a semicircle with diameter a + b. Draw a perpendicular chord up from the point where segment a meets segment b, touching the circle's edge. The height of that chord turns out to be exactly √(ab), the geometric mean. The radius of the circle — the longest possible vertical distance you could draw from the diameter to the circle's edge — is (a + b)/2, the arithmetic mean. Since a chord inside a circle can never be longer than the radius drawn to its edge, √(ab) ≤ (a+b)/2 falls right out of the picture. No algebra required — just a circle.

For more than two numbers, the inequality generalizes cleanly:

(x₁ + x₂ + ... + xₙ) / n ≥ ⁿ√(x₁ · x₂ · ... · xₙ)

Same statement, same equality condition: the product of n fixed-sum numbers is maximized exactly when they're all equal.

Why It Matters

That one-line fact — "for a fixed sum, the product is largest when everything is equal" — turns out to be one of the most load-bearing ideas in applied mathematics, because an enormous number of real-world problems boil down to exactly that trade-off: you have a fixed resource (perimeter, surface area, budget, time) and you want to maximize something that multiplies.

The classic fence problem. Give a farmer a fixed length of fencing to enclose a rectangular pen. Intuition says there should be an optimal shape, and calculus can find it — but AM-GM finds it instantly. If the perimeter fixes x + y, then the area xy is maximized exactly when x = y. The optimal rectangle is a square. The same logic, extended to three dimensions, says that for a box with fixed total surface area, volume is maximized when the box is a cube. This is why water towers, shipping containers, and packaging design all gravitate toward "squarish" proportions when material cost is the constraint — not an aesthetic choice, a mathematical one.

The volatility drag in investing. The 50%-then-(-50)% example at the top isn't a trick of arithmetic — it's AM-GM in disguise. Your two-year returns correspond to growth factors of 1.5 and 0.5. The arithmetic mean of those factors is 1.0 (predicting no change), but the true compounded outcome depends on the geometric mean: √(1.5 × 0.5) = √0.75 ≈ 0.866, meaning you actually lose about 13.4% per year, compounding to the 25% total loss you really experienced. Because AM ≥ GM always, and strictly so whenever returns vary, volatility itself drags down compounded returns below what the simple average return suggests. This is a real, named phenomenon in quantitative finance — sometimes called "volatility drag" or "variance drain" — and it's precisely why a fund that returns "10% on average" with wild swings can underperform a steadier fund with the same average.

Bounding graphs and networks. In graph theory, AM-GM underwrites the proof that a graph split into two groups of a and b vertices (with a + b = n fixed) can have at most n²/4 edges between the groups, because the edge count ab is maximized when a = b = n/2. That bound — achieved exactly by splitting a network in half — is the engine behind Mantel's theorem, a foundational 1907 result about the maximum number of edges a triangle-free graph can have, which in turn kicked off the whole field of extremal graph theory.

The Details

What makes AM-GM more than a party trick is that it isn't an isolated fact — it's the simplest member of a whole family tree of inequalities relating different kinds of averages, often summarized as:

HM ≤ GM ≤ AM ≤ QM

That is, the harmonic mean is never bigger than the geometric mean, which is never bigger than the arithmetic mean, which is never bigger than the quadratic mean (root mean square). Each of these means shows up in its own corner of science — the harmonic mean for averaging rates (like fuel efficiency or resistors in parallel), the quadratic mean for averaging magnitudes of fluctuating quantities (like AC voltage or statistical spread) — and the whole chain of inequalities can be proven, piece by piece, from the same basic logic as AM-GM.

There's also a deeper reason AM-GM works at all, one that connects it to a much more general principle called Jensen's inequality. The natural logarithm is a concave function — its graph bows downward, like a dome rather than a bowl. Jensen's inequality says that for any concave function, the average of the function's outputs is less than or equal to the function applied to the average of the inputs. Apply that single fact to the logarithm, and the AM-GM inequality drops out as a special case, because log(geometric mean) is literally the average of the logs. In other words, AM-GM isn't really about arithmetic and geometric means specifically — it's a shadow cast by the shape of the logarithm curve.

Historically, the two-variable case was already implicit in Euclid's Elements (Book V, Proposition 25), more than two thousand years ago, stated in the geometric language of ratios and magnitudes rather than modern algebra. It took until 1821 for the general n-variable version to get a rigorous published proof, when Augustin-Louis Cauchy included it in his Cours d'analyse, a landmark textbook written for students at the École Polytechnique in Paris. Cauchy's method was a clever two-direction induction — now sometimes called "Cauchy induction" or "forward-backward induction" — where you first prove the result for every power of 2, then show that if it holds for n numbers it must also hold for n − 1. Decades later, the mathematician George Pólya found an entirely different route to the same destination, using properties of the exponential function — a reminder that in mathematics, the same true statement can often be reached by several independent, equally valid paths, each illuminating a different reason why it's true.

Takeaways

  • AM-GM says: for numbers with a fixed sum, their product is maximized exactly when they're all equal — and that single idea secretly drives an enormous range of optimization problems, from fence-and-farmland geometry to box design.
  • The gap between AM and GM has real financial teeth. Returns that swing up and down compound to less than their simple average suggests — "volatility drag" is AM-GM with dollar signs attached.
  • It's the simplest link in a longer chain — harmonic mean ≤ geometric mean ≤ arithmetic mean ≤ quadratic mean — each used where it fits: rates, growth, typical values, and fluctuation sizes, respectively.
  • It's a shadow of a bigger idea. AM-GM is just Jensen's inequality applied to the concave logarithm function, which is why so many seemingly unrelated inequalities in math turn out to be cousins of each other.
  • It's ancient and still working. First implicit in Euclid over two millennia ago, formally proven for any number of terms by Cauchy in 1821, and still the fastest tool reached for in olympiad problems, engineering design, and portfolio math today.

Resources: - AM–GM inequality — Wikipedia - AoPS Wiki: AM-GM Inequality