Search

Search papers and lessons

Geometric Mean

Level 2 · 9 min read

The geometric mean of n positive numbers is the nth root of their product, the right average for quantities that multiply, such as growth factors and ratios.

On this page

  • Colour = topic mix
  • Discrete math
  • Probability
  • Calculus
  • Sign in to see your progress

TL;DR

The geometric mean of nn positive numbers is the nnth root of their product. It answers the question "what single number, used in place of each value, gives the same total product?" It is the right average for quantities that multiply, such as yearly growth factors, ratios and speedups, where the ordinary arithmetic mean gives misleading answers.

Where you'll see it: in the average yearly return of an investment that rose and fell, in summary scores for benchmark suites that compare the speed of computer systems, and in the centre of skewed data whose logarithms are roughly symmetric (log-normal data).

Intuition

A question about products

Suppose an investment gains 100 percent one year and then loses 50 percent the next. Its value over those two years is multiplied by 2×0.5=12 \times 0.5 = 1, so it ends where it started. The arithmetic average of the two changes is (+100−50)/2=+25(+100 - 50)/2 = +25 percent a year, which would say the investment grew. It did not.

The problem is that the changes multiply, but the arithmetic mean adds. We want a single yearly factor gg such that g×g=2×0.5=1g \times g = 2 \times 0.5 = 1. That factor is g=1g = 1, and it is the geometric mean of the two factors. In general, if a list of positive numbers multiplies to a total, the geometric mean is the number that, multiplied by itself nn times, gives the same total.

Why the arithmetic mean is the wrong tool

An arithmetic mean answers "what number, added nn times, gives the same sum?" That is the right question for quantities that add: total distance, total cost, total votes. For quantities that multiply, the arithmetic mean overstates the typical value, because a large value pulls it up more than a small value pulls it down. The geometric mean is always at most the arithmetic mean, and the two are equal only when every number is the same.

A picture helps. Draw a rectangle with sides aa and bb. Its area is abab. A square with the same area has side ab\sqrt{ab}, the geometric mean of aa and bb. The arithmetic mean (a+b)/2(a + b)/2 is the side of a square with the same perimeter. Area is the quantity that multiplies, so ab\sqrt{ab} is the one that matches it.

flowchart LR
  A[List of positive numbers] --> P[Multiply them together]
  P --> R[Take the nth root]
  R --> G[Geometric mean]

The math

Let x1,x2,…,xnx_1, x_2, \ldots, x_n be positive real numbers. Their geometric mean is

G=(x1x2⋯xn)1/n=(∏i=1nxi)1/n.G = \left(x_1 x_2 \cdots x_n\right)^{1/n} = \left(\prod_{i=1}^{n} x_i\right)^{1/n}.

Here ∏\prod is the product symbol, the multiplicative version of ∑\sum, and x1/nx^{1/n} means the nnth root of xx. Positivity is needed so that the root is defined and so that taking logarithms is allowed.

The logarithm form

Taking logarithms turns the product into a sum, which is how the geometric mean is usually computed in practice:

ln⁡G=1n∑i=1nln⁡xi.\ln G = \frac{1}{n}\sum_{i=1}^{n} \ln x_i.

So the geometric mean is the exponential of the arithmetic mean of the logarithms: G=exp⁡ ⁣(1n∑iln⁡xi)G = \exp\!\left(\frac{1}{n}\sum_i \ln x_i\right). This is why the geometric mean behaves well with growth and ratios. Their logarithms add, and an arithmetic average of the logarithms is meaningful.

Relation to the arithmetic mean

For positive numbers the geometric mean never exceeds the arithmetic mean A=1n∑ixiA = \frac{1}{n}\sum_i x_i:

G≤A,G \le A,

with equality only when all the xix_i are equal. This is the AM-GM inequality. The gap between the two grows with the spread of the numbers. For data with the same arithmetic mean, a wider spread means a smaller geometric mean.

Growth factors

If a quantity changes by factors r1,…,rnr_1, \ldots, r_n over nn periods, its final value is Vn=V0 r1r2⋯rnV_n = V_0\, r_1 r_2 \cdots r_n. The constant per-period factor that gives the same final value is the geometric mean of the rir_i, so

Vn=V0 Gn.V_n = V_0\, G^n.

The average per-period growth rate is then G−1G - 1. A factor of 1.10 means 10 percent growth, and a factor of 0.80 means a 20 percent fall.

Worked examples

Example
Two numbers

Take x1=2x_1 = 2 and x2=8x_2 = 8.

  1. The product is 2×8=162 \times 8 = 16.
  2. The geometric mean is the square root of the product: G=16=4G = \sqrt{16} = 4.
  3. The arithmetic mean is (2+8)/2=5(2 + 8)/2 = 5.
  4. Check the inequality: 4≤54 \le 5.

Interpretation: 4 is the common factor that, applied twice, gives the same product as 2 and 8. The arithmetic mean 5 is larger because the 8 pulls it up more than the 2 pulls it down.

Example
Yearly returns of an investment

An investment changes by +10+10 percent, −20-20 percent and +30+30 percent in three successive years. The growth factors are 1.101.10, 0.800.80 and 1.301.30.

  1. The product of the factors is 1.10×0.80×1.30=1.1441.10 \times 0.80 \times 1.30 = 1.144. So 10001000 invested at the start is worth 11441144 at the end.
  2. The geometric mean is the cube root: G=1.1441/3G = 1.144^{1/3}.
  3. Using logarithms: ln⁡1.144≈0.13453\ln 1.144 \approx 0.13453, and dividing by 3 gives 0.044840.04484.
  4. Exponentiate: G=e0.04484≈1.0459G = e^{0.04484} \approx 1.0459.
  5. Check: 1.04593≈1.1441.0459^3 \approx 1.144, the product from step 1.
  6. The average yearly growth rate is about 4.6 percent.

The arithmetic average of the three changes is (10−20+30)/3≈6.7(10 - 20 + 30)/3 \approx 6.7 percent, which overstates the growth. Compounding the 6.7 percent over three years would give 1.0673≈1.2151.067^3 \approx 1.215, not the actual 1.1441.144. The geometric mean is the rate that reproduces the real outcome.

Example
Summarising speedups across a benchmark suite

A new compiler is measured on four programs. Its speedups over the old compiler are 2.02.0, 0.50.5, 4.04.0 and 1.51.5, where a value above 1 means faster and a value below 1 means slower.

  1. The arithmetic mean is (2.0+0.5+4.0+1.5)/4=8.0/4=2.0(2.0 + 0.5 + 4.0 + 1.5)/4 = 8.0/4 = 2.0.
  2. The product of the speedups is 2.0×0.5×4.0×1.5=6.02.0 \times 0.5 \times 4.0 \times 1.5 = 6.0.
  3. The geometric mean is the fourth root: G=61/4G = 6^{1/4}. Since 6≈2.449\sqrt{6} \approx 2.449 and 2.449≈1.565\sqrt{2.449} \approx 1.565, we get G≈1.57G \approx 1.57.
  4. Check the inequality: 1.57≤2.01.57 \le 2.0.

Interpretation: the arithmetic mean says the typical program got twice as fast, which overstates the gain. The geometric mean says the typical program got about 57 percent faster. The geometric mean also has a property the arithmetic mean lacks. If the old and new compilers were swapped, every speedup would invert to its reciprocal, and the geometric mean would invert to its reciprocal as well. The summary would then report a consistent result in both directions, which is why benchmark summaries use geometric means of ratios.

Tradeoffs and failure modes

The geometric mean is the right summary only under particular conditions. Use it when the quantities multiply and are positive. Avoid it when the numbers add, when they can be zero, or when they have mixed signs.

SituationWhat goes wrongBetter choice
Values add, such as costs or totalsThe geometric mean understates the total per unitUse the arithmetic mean
A value is zeroThe product is zero, so the geometric mean is zero whatever the other valuesRemove the zero, or use an arithmetic mean on a different scale
Negative values appear in the dataThe root of a negative product may not existConvert to positive ratios, such as growth factors 1+r1 + r, before averaging
Ratios of very different magnitudesBoth means are sensitive to outliers, but in different waysReport the spread alongside the summary
Averaging rates over time with unequal periodsThe simple geometric mean ignores period lengthWeight by time, or compute the compound annual rate directly

History

The ancient Greeks, Pythagoreans among them, studied three means, the arithmetic, the geometric and the harmonic (the reciprocal of the average of reciprocals), and the relationships among them. The geometric mean long belonged to geometry and the theory of musical ratios, and the arithmetic mean was far more common in data work. It came into statistics as a summary of quantities that multiply, such as growth factors and population ratios. In the 1980s it became standard in computer performance measurement, where summaries of speedups across benchmark suites were shown to be more consistent when computed as geometric means of ratios. The idea is now routine in finance, in economics and in data analysis of skewed, log-normally distributed quantities.

Recap

The geometric mean is the nnth root of a product of positive numbers, and equivalently the exponential of the average logarithm. It is the right average for quantities that multiply, such as growth factors and ratios, and it is never larger than the arithmetic mean. Its failure modes are zeros, negative values and additive quantities. It also matches the centre of data whose logarithms are roughly symmetric, the case where averaging on the log scale is natural.

Check yourself

QuestionRecall: what is the geometric mean of nn positive numbers, and what is its logarithm form?Show answer

The geometric mean is the nnth root of their product, (∏ixi)1/n\left(\prod_i x_i\right)^{1/n}. Its logarithm is the arithmetic mean of the logarithms, 1n∑iln⁡xi\frac{1}{n}\sum_i \ln x_i. Computing the average logarithm and exponentiating is the stable way to calculate it for many numbers.

QuestionComputation: find the geometric mean of 3, 12 and 4.Show answer

The product is 3×12×4=1443 \times 12 \times 4 = 144. The cube root of 144 is about 5.24, since 5.243≈143.95.24^3 \approx 143.9. Check the inequality: the arithmetic mean is (3+12+4)/3=6.33(3 + 12 + 4)/3 = 6.33, and 5.24≤6.335.24 \le 6.33.

QuestionWhy: why does an investment with returns of +50+50 percent and −50-50 percent in consecutive years end lower than it started, even though the arithmetic average return is zero?Show answer

The changes multiply, not add. The growth factors are 1.51.5 and 0.50.5, and their product is 0.750.75, so the investment loses a quarter of its value. The geometric mean is 0.75≈0.866\sqrt{0.75} \approx 0.866, a yearly loss of about 13.4 percent. The arithmetic average of zero hides this because the arithmetic mean treats the gains and losses as if they were additive, which they are not.

QuestionApplied: a team reports that its build time fell by a factor of 2 on one project and rose by a factor of 2 on another. Which summary should it report, and why?Show answer

The factors are ratios that multiply, so the geometric mean is the right summary. The geometric mean of 2 and 0.5 is 1=1\sqrt{1} = 1, which says the typical build time did not change on average. The arithmetic mean of the two ratios is 1.251.25, which would wrongly suggest a slowdown on average. Reporting the geometric mean together with the individual ratios gives the honest picture.

Sources