HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
The AM-GM-HM Inequality and Power Means
  1. 1Arithmetic, geometric and harmonic means
  2. 2Weighted means, power means and Bernoulli
  3. 3Greatest and least values with the means
  1. Mathematics
  2. /The AM-GM-HM Inequality and Power Means
  3. /Arithmetic, geometric and harmonic means

Course 29.1·Lesson 1 of 3

Arithmetic, geometric and harmonic means

For positive numbers, the arithmetic mean is never less than the geometric mean, and the geometric mean is never less than the harmonic mean. Equality holds only when all the numbers are equal. For two numbers the proof is one square, (a−b)2≥0(\sqrt{a} - \sqrt{b})^2 \ge 0(a​−b​)2≥0

Lesson 1 of 3Show all lessonsHide
The AM-GM-HM Inequality and Power Means
  1. 1Arithmetic, geometric and harmonic means
  2. 2Weighted means, power means and Bernoulli
  3. 3Greatest and least values with the means

Try the code and the simulations beside the lesson.

What you will be able to do

  • find the arithmetic, geometric, harmonic and quadratic means of a list;
  • prove AM ≥\ge≥ GM ≥\ge≥ HM for two numbers and for nnn numbers;
  • say exactly when equality holds, and why the numbers must be positive.

A fence and a field

You have 202020 m of fence for a rectangular pen. A pen of 999 m by 111 m has an area of 9 m29\ \text{m}^29 m2. A pen of 666 m by 444 m has 24 m224\ \text{m}^224 m2. The square of 555 m by 555 m gives 25 m225\ \text{m}^225 m2, and nothing beats it. Why does the square win?

The two sides have a fixed sum, 101010 m. Their arithmetic mean is 555 m. The side of a square with the same area is the geometric mean lw\sqrt{lw}lw​. The area is largest when the geometric mean reaches the arithmetic mean, and that happens only for equal sides.

You met this for two numbers in the chapter on Sequences and Series. Here we prove it for any number of terms and use it as a tool.

The four means

Take positive numbers a1,a2,…,ana_1, a_2, \dots, a_na1​,a2​,…,an​.

  • Arithmetic mean: A=a1+a2+⋯+annA = \dfrac{a_1 + a_2 + \dots + a_n}{n}A=na1​+a2​+⋯+an​​.
  • Geometric mean: G=a1a2⋯annG = \sqrt[n]{a_1 a_2 \cdots a_n}G=na1​a2​⋯an​​.
  • Harmonic mean: H=n1a1+1a2+⋯+1anH = \dfrac{n}{\dfrac{1}{a_1} + \dfrac{1}{a_2} + \dots + \dfrac{1}{a_n}}H=a1​1​+a2​1​+⋯+an​1​n​.
  • Quadratic mean (also called the root mean square): Q=a12+a22+⋯+an2nQ = \sqrt{\dfrac{a_1^2 + a_2^2 + \dots + a_n^2}{n}}Q=na12​+a22​+⋯+an2​​​.

The harmonic mean is the reciprocal of the average of the reciprocals. It is the right average for rates. If you drive equal distances at two speeds, your average speed is their harmonic mean, not their arithmetic mean.

The chain of means

Q ≥ A ≥ G ≥ H,\displaystyle Q \ \ge\ A \ \ge\ G \ \ge\ H,Q ≥ A ≥ G ≥ H,

with equality in each place only when a1=a2=⋯=ana_1 = a_2 = \dots = a_na1​=a2​=⋯=an​. Olympiad books call the middle part the AM-GM inequality. Some textbooks write it in words: the arithmetic mean of positive numbers is not less than their geometric mean.

Two numbers first

For a,b>0a, b > 0a,b>0 a square cannot be negative:

(a−b)2≥0.\displaystyle (\sqrt{a} - \sqrt{b})^2 \ge 0.(a​−b​)2≥0.

Expand it: a−2ab+b≥0a - 2\sqrt{ab} + b \ge 0a−2ab​+b≥0, so a+b2≥ab\dfrac{a + b}{2} \ge \sqrt{ab}2a+b​≥ab​. Equality needs a=b\sqrt{a} = \sqrt{b}a​=b​, which means a=ba = ba=b.

For two numbers the harmonic mean is H=2aba+bH = \dfrac{2ab}{a + b}H=a+b2ab​. Multiply it by AAA: AH=a+b2⋅2aba+b=ab=G2AH = \dfrac{a + b}{2} \cdot \dfrac{2ab}{a + b} = ab = G^2AH=2a+b​⋅a+b2ab​=ab=G2. So GGG is the geometric mean of AAA and HHH. Since A≥GA \ge GA≥G, we get H=G2A≤GH = \dfrac{G^2}{A} \le GH=AG2​≤G.

The semicircle below shows all of this. Its diameter is a+ba + ba+b. The radius is AAA, and the half-chord standing at the split point is GGG. A half-chord can never be longer than a radius.

A semicircle on a horizontal diameter of length a + b, with a = 9 and b = 1. The diameter is split at a point P, 9 units from the left end and 1 unit from the right end. From the centre O a vertical blue radius of length 5 is labelled AM. From P a vertical red half-chord rises to the circle and is labelled GM, of length 3. A green segment from the top of the red half-chord drops onto the slanted radius from O, and the part of that radius near the circle, of length 1.8, is labelled HM. A note says AM is at least GM, and GM is at least HM.

Any number of terms: smoothing

Let the numbers have arithmetic mean AAA and suppose they are not all equal. Then one of them, say a1a_1a1​, is below AAA and another, say a2a_2a2​, is above AAA.

  1. Replace a1a_1a1​ by AAA and a2a_2a2​ by a1+a2−Aa_1 + a_2 - Aa1​+a2​−A. The sum does not change, so the mean is still AAA.
  2. Compare the products. The new pair gives A(a1+a2−A)A(a_1 + a_2 - A)A(a1​+a2​−A) and the old pair gave a1a2a_1 a_2a1​a2​. The difference is A(a1+a2−A)−a1a2=(A−a1)(a2−A)A(a_1 + a_2 - A) - a_1 a_2 = (A - a_1)(a_2 - A)A(a1​+a2​−A)−a1​a2​=(A−a1​)(a2​−A), which is positive.
  3. Repeat. Each step makes one more number equal to AAA and raises the product. After at most n−1n - 1n−1 steps every number is AAA, and the product is AnA^nAn.

So the original product is less than AnA^nAn, which means G<AG < AG<A. When all the numbers are equal, G=AG = AG=A. This proves AM-GM for nnn numbers.

For HM ≤\le≤ GM, apply AM-GM to the reciprocals 1a1,…,1an\dfrac{1}{a_1}, \dots, \dfrac{1}{a_n}a1​1​,…,an​1​: their average is at least 1G\dfrac{1}{G}G1​, which turns into H≤GH \le GH≤G. For QM ≥\ge≥ AM, use ∑(ai−A)2≥0\sum (a_i - A)^2 \ge 0∑(ai​−A)2≥0, which gives ∑ai2≥nA2\sum a_i^2 \ge nA^2∑ai2​≥nA2.

A worked example

The product of four positive numbers is 818181. What is the least value of their sum?

  1. Use AM-GM. a+b+c+d4≥abcd4=814=3\dfrac{a + b + c + d}{4} \ge \sqrt[4]{abcd} = \sqrt[4]{81} = 34a+b+c+d​≥4abcd​=481​=3.
  2. Multiply by 4. The sum is at least 121212.
  3. Check equality. a=b=c=d=3a = b = c = d = 3a=b=c=d=3 has product 818181 and sum 121212, so 121212 is reached.

The last step matters. A bound is the least value only when some allowed numbers reach it.

Practise with new numbers

Try it in Python

The program draws many random lists of positive numbers and checks the chain A≥G≥HA \ge G \ge HA≥G≥H on each one. It then tries a list of equal numbers.

Read it first. Then run it. Does any random list break the chain?

1. Change size = 5 to size = 2. Is the smallest gap between the arithmetic and geometric means smaller or larger?

2. Put a negative number into equal_list. What goes wrong with the geometric mean?

Common mistakes

  • Using AM-GM with negative numbers. For −4-4−4 and −1-1−1 the arithmetic mean is −2.5-2.5−2.5 and (−4)(−1)=2\sqrt{(-4)(-1)} = 2(−4)(−1)​=2. The inequality fails. Every number must be positive (or zero).
  • Forgetting the equality check. x+1x≥2x + \dfrac{1}{x} \ge 2x+x1​≥2 for x>0x > 0x>0, but for x≥3x \ge 3x≥3 the least value is 103\dfrac{10}{3}310​, because x=1x = 1x=1 is not allowed.
  • Averaging speeds the wrong way. Equal distances need the harmonic mean, and equal times need the arithmetic mean.
  • Mixing the order. It is H≤G≤A≤QH \le G \le A \le QH≤G≤A≤Q. The harmonic mean is the smallest.

Remember these

  • A≥G≥HA \ge G \ge HA≥G≥H for positive numbers, and Q≥AQ \ge AQ≥A.
  • Equality in any of them holds only when all the numbers are equal.
  • For two numbers, G2=AHG^2 = AHG2=AH.
  • A bound is a least or greatest value only if equality can happen.

Check yourself

Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.

  1. Find the arithmetic, geometric and harmonic means of 222 and 181818.
  1. A cyclist rides 121212 km uphill at 666 km/h and the same 121212 km back at 121212 km/h. What is her average speed?
  1. The product of three positive numbers is 646464. What is the least value of their sum?
  1. Why can we not use AM-GM on the numbers −2-2−2 and −8-8−8?
  1. In the smoothing proof, the numbers 111 and 777 have mean 444. The step replaces them with 444 and 444. By how much does their product grow?

References

  • Hardy, Littlewood and Pólya, Inequalities, Chapter 2, on the means of positive numbers.
  • NCERT, Mathematics Textbook for Class XI, Chapter 8 (Sequences and Series), the section on the relation between the arithmetic and geometric means.

Enroll free in The AM-GM-HM Inequality and Power Means

Every lesson is open to read. Enrolling also lets you:

  • Mark lessons done and carry on where you stopped.
  • Take the tests of this lesson and its course.
  • Count the course towards the certificate for its chapter.
No payment. You can leave at any time.

Problems (3)

Rohan claims that for all positive numbers a, b and c, (a + b)(b + c)(c + a) ≥ 8abc.…Hard · High School (11–12) · by StemPy Lab
A delivery rider travels from a depot to a market and back along the same road, a distance of 36 km…Hard · High School (11–12) · by StemPy Lab
Here is a statement that many olympiad solutions use…Advanced · High School (11–12) · by StemPy Lab
Next: lesson 2Weighted means, power means and Bernoulli
← The AM-GM-HM Inequality and Power Means
← PreviousWeighted means, power means and Bernoulli →

Discussion (0)

Log in to join the discussion.

Loading…

. For
nnn
numbers a smoothing argument works: make the numbers equal one at a time, and the product never falls.
about 30 min1 simulation1 practice question1 Python program5 questions to check yourself

This lesson is free to read. Enroll free to keep your place and take the tests.

Python Labs (1)

Three means and their orderPython Lab · by StemPy Lab