Arithmetic, geometric and harmonic means compared
There is more than one kind of average, and which one fits depends on the data. The arithmetic mean adds every value and divides by the count, which is the familiar one. The geometric mean multiplies the values and takes the nth root, so it suits anything that compounds, such as returns or growth rates. The harmonic mean averages the reciprocals and flips the answer back, which is the right choice for rates like speed or price per unit where the denominator changes.
When all values are positive the three always fall in the order AM ≥ GM ≥ HM, and they coincide only when every value is identical. That relationship doubles as a self-check, so the result reports whether the chain holds. The geometric mean is computed as the exponential of the mean logarithm rather than a raw product, because a long list would otherwise overflow before the root is taken.
Undefined inputs are called out rather than hidden. A zero breaks the reciprocal step of the harmonic mean and collapses the geometric mean to zero, and a negative value pushes the nth root of the product outside the real numbers. So if even one value is zero or negative, both means are reported as undefined with the reason stated, and only the arithmetic mean is calculated. Values may be separated by line breaks, commas or spaces, blanks are dropped and duplicate values are kept as entered.
Frequently Asked Questions
The arithmetic mean adds the values and divides by the count, the geometric mean multiplies them and takes the nth root, and the harmonic mean averages the reciprocals and inverts the result. Growth rates suit the geometric mean, while speeds and unit prices suit the harmonic mean.
The geometric mean takes an nth root of the product, which leaves the real numbers once a negative or zero is mixed in, and the harmonic mean divides by each value, which fails at zero. In those cases only the arithmetic mean is reported.
For positive values the arithmetic mean is always at least the geometric mean, which is always at least the harmonic mean. The three coincide only when every value is identical, which makes the chain a handy check on the result.