Lehmer Mean Calculator
Means
- The Lehmer mean with power p is L_p(a, b) = (a^p + b^p) / (a^(p - 1) + b^(p - 1)) - a one-parameter family that slides between the classical means.
- With a = 4, b = 9 and p = 2, the numerator and denominator give L = 7.4615.
- The named stops on the dial are p = 0 (harmonic), p = 0.5 (geometric), p = 1 (arithmetic) and p = 2 (contraharmonic); the mean increases steadily as p grows.
- Lehmer introduced the family in 1971; unlike the power means it weights each value by a power of itself, which is why it hugs the larger input harder as p rises.
Most means are single points: the harmonic mean is one number, the geometric another. The Lehmer mean is a dial. Turn the power p and the mean slides smoothly through the classical family: at p = 0 it is the harmonic mean, at p = 0.5 the geometric, at p = 1 the arithmetic, and at p = 2 the contraharmonic - increasing steadily all the way.
The formula is L_p(a, b) = (a^p + b^p) / (a^(p - 1) + b^(p - 1)): a weighted average in which each number is weighted by a power of itself. That self-weighting is the family's signature - larger inputs pull harder as p rises, which is why the dial leans toward the bigger number at the top end.
This Lehmer mean calculator takes any real p and shows the four named stops alongside your value. For 4 and 9 the ladder reads: harmonic 5.5385, geometric 6.0000, arithmetic 6.5000, contraharmonic 7.4615. D. H. Lehmer introduced the family in 1971.
Worked examples
Contraharmonic end: 4 and 9 at p = 2
(4 · 9 · 2)
| Lehmer mean L2 of 4 and 9 | 7.4615 |
| harmonic mean (p = 0) | 5.5385 |
| geometric mean (p = 0.5) | 6.0000 |
| arithmetic mean (p = 1) | 6.5000 |
Harmonic end: 4 and 9 at p = 0
(4 · 9 · 0)
| Lehmer mean L0 of 4 and 9 | 5.5385 |
| harmonic mean (p = 0) | 5.5385 |
| geometric mean (p = 0.5) | 6.0000 |
| arithmetic mean (p = 1) | 6.5000 |
Arithmetic midpoint: 6 and 12 at p = 1
(6 · 12 · 1)
| Lehmer mean L1 of 6 and 12 | 9.0000 |
| harmonic mean (p = 0) | 8.0000 |
| geometric mean (p = 0.5) | 8.4853 |
| contraharmonic mean (p = 2) | 10.0000 |
The formula: a self-weighted average
Rewrite the definition as a weighted mean: L_p(a, b) = (a x a^(p - 1) + b x b^(p - 1)) / (a^(p - 1) + b^(p - 1)). Each value is weighted by itself raised to p - 1. At p = 1 the weights are both 1 and the mean is the plain average. At p = 2 the weights are the values themselves - the bigger number counts proportionally more, producing the contraharmonic mean. At p = 0 the weights are the reciprocals, which inverts the emphasis and produces the harmonic mean.
For 4 and 9 at p = 2: numerator 16 + 81 = 97, denominator 4 + 9 = 13, and 97 / 13 = 7.4615. At p = 0: numerator 1 + 1 = 2, denominator 1/4 + 1/9 = 13/36, giving 72 / 13 = 5.5385. The same skeleton, two turns of the dial, two classical means.
- Weighted mean with weights a^(p - 1) and b^(p - 1)
- p = 2 on 4 and 9: 97 / 13 = 7.4615
- p = 0 on 4 and 9: 72 / 13 = 5.5385
The four named stops
Four values of p recover the textbook means. p = 0: harmonic, the right average for rates. p = 0.5: geometric, the right average for growth factors - and note it emerges from a formula with no square roots in sight, since a^0.5 in numerator and a^-0.5 in denominator conspire to give sqrt(a b). p = 1: arithmetic. p = 2: contraharmonic, the size-biased mean used in statistics and signal processing.
The calculator prints all four stops (skipping the one that coincides with your chosen p) so any Lehmer value can be located on the ladder at a glance. For 6 and 12 at p = 1 the stops read harmonic 8.0000, geometric 8.4853, contraharmonic 10.0000 around the arithmetic answer 9.0000.
- p = 0 harmonic; p = 0.5 geometric
- p = 1 arithmetic; p = 2 contraharmonic
- 6 and 12 ladder: 8.0000 / 8.4853 / 9.0000 / 10.0000
Monotonic in p
The Lehmer mean increases steadily with p - a theorem, not a trend. As p rises, weight shifts continuously from the smaller input to the larger, and the mean follows. In the limit as p tends to minus infinity the mean approaches the smaller input; as p tends to plus infinity it approaches the larger. The classical means are four frames of one continuous film.
This monotonicity makes the Lehmer mean a diagnostic: if a purported Lehmer value for p between 0.5 and 1 falls outside the geometric-arithmetic interval for the same inputs, it is wrong. The displayed stops enforce the check automatically - your value must sit in the ladder in the right order.
- L_p is increasing in p
- Limits: min(a, b) and max(a, b) at the extremes
- Stops bracket every intermediate value
Lehmer means versus power means
The power (Holder) means are the other famous one-parameter family, and the two are easily confused: both pass through harmonic, geometric and arithmetic at matching parameter values. They differ in construction - power means raise the values to a power, average, then take the root; Lehmer means weight each value by a power of itself. The families agree at the named stops but differ between them, and they part company at the top: the Lehmer mean at p = 2 is the contraharmonic mean, while the power mean at exponent 2 is the quadratic (root-mean-square) mean.
Lehmer's 1971 paper introduced his family partly for its cleaner behaviour in averaging ratios and rates. If your problem involves self-weighting - bigger observations genuinely counting more - the Lehmer dial is the honest tool.
- Power means: power, average, root
- Lehmer means: self-weighted average
- Agree at H, G, A; differ at p = 2 (contraharmonic vs quadratic)
Worked values
Three reference computations anchor the page. (4, 9, p = 2) = 7.4615, the contraharmonic end. (4, 9, p = 0) = 5.5385, the harmonic end - exactly 72 / 13. (6, 12, p = 1) = 9.0000, the arithmetic midpoint, exactly the average of 6 and 12. Between the anchors, the dial moves smoothly: at p = 0.5 the 4-and-9 pair gives exactly 6.0000, the geometric mean sqrt(36).
Notice how many of these are exact: 72 / 13, 97 / 13, 9, 6. The Lehmer family at rational p on integer inputs often collapses to tidy rationals or roots, which makes it a pleasure to verify by hand - pick any stop and check the calculator against the fraction.
- (4, 9, 2) = 7.4615; (4, 9, 0) = 5.5385
- (4, 9, 0.5) = 6.0000 exactly
- (6, 12, 1) = 9.0000 exactly
Where Lehmer means are used
The family's natural habitat is the averaging of quantities whose importance scales with their size: rates weighted by exposure, ratios weighted by base, and signal samples where large excursions dominate perception. The contraharmonic endpoint is a standard noise-reduction filter in image processing, where its size-bias suppresses dark ('pepper') noise preferentially; the harmonic endpoint is the classic average-speed mean.
In pure mathematics the Lehmer means serve as a test family for mean inequalities - any proposed general inequality about means must survive contact with the whole dial, not just its named stops.
- Exposure-weighted rates and ratios
- Contraharmonic filtering in image processing
- A test family for mean inequalities
Fractional and negative powers
Nothing in the formula requires p to be one of the four named stops, or even positive. At p = 0.5 the 4-and-9 pair gives exactly 6.0000; between the stops the dial takes every intermediate value - at p = 0.25 the mean lies between the harmonic 5.5385 and the geometric 6.0000, and at p = 1.5 between the arithmetic 6.5000 and the contraharmonic 7.4615. The calculator's displayed stops turn this into a verifiable claim: any value it returns for an intermediate p must fall inside the bracket the stops define, in the right order.
Negative p slides below the harmonic mean toward the smaller input: the weights a^(p - 1) then favour the small value overwhelmingly, and in the limit the mean becomes the minimum. This end of the dial is the mirror of the contraharmonic end - one family, two biases, and a continuous path between 'the small value decides' and 'the large value decides', passing through every classical compromise on the way.
- Intermediate p: bracketed by the named stops
- Negative p: below harmonic, toward the minimum
- One dial, both biases
Using the calculator
Enter two positive numbers and any real power p. The field labels name the stops (0 = harmonic, 0.5 = geometric, 1 = arithmetic, 2 = contraharmonic) so the dial is self-documenting. The result comes with the neighbouring named stops for orientation. Negative p is allowed and slides below the harmonic mean toward the smaller input.
Start with 4 and 9 and sweep p from 0 to 2: 5.5385, 6.0000, 6.5000, 7.4615 - the whole classical ladder from one formula.
- Any real p, including negative
- Named stops shown for orientation
- Canonical sweep: 4 and 9, p from 0 to 2
FAQs
What is the Lehmer mean formula?
L_p(a, b) = (a^p + b^p) / (a^(p - 1) + b^(p - 1)) - a weighted average where each number is weighted by a power of itself.
Which p gives the geometric mean?
p = 0.5. For 4 and 9 the Lehmer mean is then exactly 6.0000, the geometric mean sqrt(36).
Which p gives the contraharmonic mean?
p = 2. For 4 and 9 that is 97 / 13 = 7.4615.
What is the Lehmer mean of 4 and 9 at p = 0?
5.5385 - the harmonic mean, exactly 72 / 13.
Does the Lehmer mean always lie between the two numbers?
Yes, and it increases steadily with p, from the smaller input (as p tends to minus infinity) to the larger (as p tends to plus infinity), passing harmonic, geometric, arithmetic and contraharmonic on the way.
Who introduced the Lehmer mean?
D. H. Lehmer, in 1971. The family is distinct from the power (Holder) means, though both pass through the harmonic, geometric and arithmetic means.