Generalized Mean (Power Mean) Calculator

Inputs

Generalized mean4.6667
Harmonic mean (p = -1)3.4286
Geometric mean (p = 0)4.0000
Arithmetic mean (p = 1)4.6667
Root mean square (p = 2)5.2915
How this was calculated
  1. Inputs: values 2.00, 4.00 and 8.00 with exponent p = 1.00.
  2. Power sum: (2.00^1.00 + 4.00^1.00 + 8.00^1.00) / 3 = 4.6667.
  3. Generalized mean: (4.6667)^(1/1.00) = 4.6667.
  4. Generalized mean result: 4.6667 - harmonic 3.4286, geometric 4.0000, arithmetic 4.6667.

Almost every average you have ever used is one function wearing different clothes. Raise each value to a power p, average the results, then take the p-th root, and by turning that single dial you pass through the whole classical family: at p = 1 the arithmetic mean, at p = 2 the root mean square, at p = -1 the harmonic mean, and in the limit as p approaches 0 the geometric mean. The generalised mean - also called the power mean - is the dial itself, and it turns a shelf of separate formulas into one idea with one parameter.

Enter three positive values and an exponent and this calculator returns the power mean at your p, with the harmonic, geometric, arithmetic and quadratic members of the family alongside for orientation. The worked examples visit the arithmetic case, the root-mean-square case, and the harmonic case on data chosen so the family's ordering is easy to see.

Worked examples

Arithmetic case, p = 1

(2 · 4 · 8 · 1)

Generalized mean4.6667
Harmonic mean (p = -1)3.4286
Geometric mean (p = 0)4.0000
Arithmetic mean (p = 1)4.6667
Root mean square (p = 2)5.2915

Root mean square case, p = 2

(5 · 10 · 20 · 2)

Generalized mean13.2288
Harmonic mean (p = -1)8.5714
Geometric mean (p = 0)10.0000
Arithmetic mean (p = 1)11.6667
Root mean square (p = 2)13.2288

Harmonic case, p = -1

(3 · 6 · 12 · -1)

Generalized mean5.1429
Harmonic mean (p = -1)5.1429
Geometric mean (p = 0)6.0000
Arithmetic mean (p = 1)7.0000
Root mean square (p = 2)7.9373

One family, every average

The definition is a three-step recipe: power, average, unpower. For values 2, 4 and 8 at p = 1 the powers change nothing, the average is 14 / 3, and the first root is the value itself - the arithmetic mean of 4.6667. At p = 2 the same data is squared first, so the large value shouts louder: the mean of the squares is 28, and its root is 5.2915, the root mean square. Same data, same recipe, different p, different answer - and the difference is entirely about how much weight the large values get.

The two ends of the classical family behave oppositely. The harmonic mean, p = -1, averages the reciprocals and so is dragged toward the smallest value: for 2, 4 and 8 it gives 3.4286, below even the geometric mean of 4.0000. The geometric mean itself is the p -> 0 limit, computed directly here as the cube root of the product - for 5, 10 and 20, the cube root of 1000, exactly 10.0000.

The exponent is a continuous dial, not a four-position switch. Nothing stops p at 0.5 or 3 except convention, and some fields live at unfashionable settings: acoustics and signal work sit near the quadratic end, growth rates near the geometric, and rates-per-unit near the harmonic. The calculator takes any p in a sane range so the family can be explored, not just its landmarks.

  • Power mean = ((x1^p + x2^p + x3^p) / 3)^(1/p), for positive values.
  • p = 1 arithmetic, p = 2 root mean square, p = -1 harmonic, p -> 0 geometric.
  • Larger p weights large values more; the mean never decreases as p grows.
  • Values must be positive - the geometric and harmonic members break on zeros and negatives.

The ordering: harmonic to root mean square

For any fixed set of positive values the family lines up in one immutable order: harmonic <= geometric <= arithmetic <= root mean square, with equality only when all the values are identical. The worked examples make the staircase visible. For 2, 4 and 8 it reads 3.4286, 4.0000, 4.6667, 5.2915. For 3, 6 and 12 - the harmonic example, where the requested p = -1 returns 5.1429 - the full staircase is 5.1429, 6.0000, 7.0000, 7.9373.

This ordering, the power-mean inequality, is one of the load-bearing results in the Hardy, Littlewood and Polya tradition, and it has a practical use beyond beauty: it is a checksum. Any computed average of a data set that falls outside the staircase for its claimed p is wrong, and any software returning a harmonic mean above its arithmetic mean has a bug, whatever its documentation says.

The gaps in the staircase measure dispersion. Identical values collapse it to a point; spread values open it up. The 5, 10, 20 example at p = 2 returns 13.2288, the root mean square, and its staircase runs from 8.5714 through 10.0000 and 11.6667 to that 13.2288 - a wide staircase for widely spread data, exactly as it should be.

Exponent pMeanFor 2, 4, 8Typical job
-1Harmonic3.4286Averaging rates and speeds over fixed distances
0 (limit)Geometric4.0000Growth factors, ratios, index numbers
1Arithmetic4.6667Ordinary averaging of quantities
2Root mean square5.2915Voltages, noise, errors and energies
For 3, 6 and 12 the staircase is 5.1429, 6.0000, 7.0000, 7.9373 - if any average you compute lands outside its staircase position, the arithmetic is wrong.

Worked examples

Example 1: First value 2; Second value 4; Third value 8; Exponent p 1. Generalized mean = 4.6667. Supporting values: Harmonic mean (p = -1) 3.4286; Geometric mean (p = 0) 4.0000; Arithmetic mean (p = 1) 4.6667; Root mean square (p = 2) 5.2915. Inputs: values 2.00, 4.00 and 8.00 with exponent p = 1.00. Power sum: (2.00^1.00 + 4.00^1.00 + 8.00^1.00) / 3 = 4.6667. Generalized mean: (4.6667)^(1/1.00) = 4.6667. Generalized mean result: 4.6667 - harmonic 3.4286, geometric 4.0000, arithmetic 4.6667.

Example 2: First value 5; Second value 10; Third value 20; Exponent p 2. Generalized mean = 13.2288. Supporting values: Harmonic mean (p = -1) 8.5714; Geometric mean (p = 0) 10.0000; Arithmetic mean (p = 1) 11.6667; Root mean square (p = 2) 13.2288. Inputs: values 5.00, 10.00 and 20.00 with exponent p = 2.00. Power sum: (5.00^2.00 + 10.00^2.00 + 20.00^2.00) / 3 = 175.0000. Generalized mean: (175.0000)^(1/2.00) = 13.2288. Generalized mean result: 13.2288 - harmonic 8.5714, geometric 10.0000, arithmetic 11.6667.

Example 3: First value 3; Second value 6; Third value 12; Exponent p -1. Generalized mean = 5.1429. Supporting values: Harmonic mean (p = -1) 5.1429; Geometric mean (p = 0) 6.0000; Arithmetic mean (p = 1) 7.0000; Root mean square (p = 2) 7.9373. Inputs: values 3.00, 6.00 and 12.00 with exponent p = -1.00. Power sum: (3.00^-1.00 + 6.00^-1.00 + 12.00^-1.00) / 3 = 0.1944. Generalized mean: (0.1944)^(1/-1.00) = 5.1429. Generalized mean result: 5.1429 - harmonic 5.1429, geometric 6.0000, arithmetic 7.0000.

Which p for which job

The choice of p is a modelling decision about what 'typical' should mean. Average a set of speeds over the same distance and the harmonic mean is the only honest answer, because time, not speed, is what accumulates. Average a set of growth factors and the geometric mean is forced, because growth multiplies. Average electrical noise or an alternating voltage and the root mean square is forced, because energy goes with the square. The arithmetic mean is the default only because addition is the most common way quantities combine.

When none of those structures applies, the dial still earns its keep as a sensitivity check. Report the quantity at two settings of p and the spread between the answers describes how much the conclusion depends on the weighting philosophy. A conclusion that survives from p = -1 to p = 2 is a property of the data; one that exists only at a single p is a property of the dial.

Limits of the family: zeros and negatives

The family's members disagree about edge cases, and the disagreements are instructive. A single zero in the data sends the geometric mean to zero and the harmonic mean with it, while the arithmetic mean merely dips. Negative values break the recipe outright for fractional p and poison the reciprocals at p = -1. The calculator therefore asks for positive values: the power mean is a tool for magnitudes, rates and positive quantities.

There is one more boundary worth knowing: as p grows without bound the mean approaches the maximum of the data, and as p falls it approaches the minimum. The classical four are simply the settings where the dial happens to have names. Seen that way, choosing p is choosing where between the smallest and largest observation your idea of 'typical' sits - which was always the real question.

Checking a claimed average

Because each member of the family has its own separate calculator on this site, the generalised mean doubles as their referee. Compute the family here at p = -1, 0, 1 and 2 and compare with the dedicated harmonic, geometric, arithmetic or root-mean-square page for the same three values: the figures must agree to the last digit, as the examples here agree with their own supporting values.

Disagreement between two routes to the same mean is never a matter of taste - one of the routes has an input error, most often a value transcribed with the wrong sign or a reciprocal taken at the wrong step. The staircase ordering gives the second check for free. Between them, a claimed average has very few places left to hide.

FAQs

What is the generalised mean of 2, 4 and 8 at p = 1?

4.6667 - the arithmetic mean, since at p = 1 the powers change nothing and the recipe is the ordinary average of 14 / 3. The same data give 3.4286 at p = -1 and 5.2915 at p = 2.

Why is the geometric mean described as a limit?

Because the recipe divides by p, which is zero at the geometric setting. As p approaches 0 the power mean approaches the cube root of the product - for 5, 10 and 20, exactly 10.0000. The calculator computes that limit directly rather than approximating it with a tiny p.

Which mean should I use for average speed?

The harmonic mean, p = -1, when the speeds cover the same distance: time is what accumulates, and the harmonic mean is the arithmetic mean of the reciprocals turned back over. For 3, 6 and 12 it gives 5.1429, correctly below the arithmetic 7.0000.

Can the power mean ever decrease as p increases?

No - that is the power-mean inequality. For fixed positive data the staircase harmonic <= geometric <= arithmetic <= root mean square always holds, as in the 5, 10, 20 staircase of 8.5714, 10.0000, 11.6667, 13.2288. A violation means a computing error.

What happens with a zero or negative value?

The family breaks. A zero forces the geometric and harmonic means to zero, and negatives make fractional powers and reciprocals meaningless for this purpose. The power mean is defined here for positive values - magnitudes, rates and quantities.

Is the root mean square just the p = 2 case?

Exactly. Squaring, averaging and rooting is the recipe at p = 2, which is why it weights large values hardest of the classical four - for 5, 10 and 20 it returns 13.2288, the top of that data set's staircase.

Sources

Related calculators

Lehmer Mean Calculator
Compute the Lehmer mean (a^p + b^p) / (a^(p-1) + b^(p-1)) for any power p - the family that slides from harmonic (p = 0) through geometric and arithmetic to contraharmonic (p = 2).
Harmonic Mean Calculator
The right average for rates and ratios — average speeds, price per unit, densities — with the geometric and arithmetic means shown so you can see why it differs.
Contraharmonic Mean Calculator
Compute the contraharmonic mean (a^2 + b^2) / (a + b) of two positive numbers - the size-biased mean that sits above the arithmetic mean.