48
50
2
0.96
0.041667
48
50
2
0.96
0.041667
The Harmonic Mean Calculator computes the harmonic mean of a set of positive numbers — the reciprocal of the arithmetic mean of reciprocals. The harmonic mean is the correct average when dealing with rates, speeds, ratios, and other quantities expressed as "something per unit." It is always the smallest of the three Pythagorean means (harmonic <= geometric <= arithmetic), making it naturally resistant to large outliers.
Common applications include: average speed for a round trip, parallel resistance in electrical circuits, price-earnings ratios in finance, and F1-score in machine learning (which is the harmonic mean of precision and recall). Whenever you are averaging rates or ratios where the denominator varies, the harmonic mean gives the correct result while the arithmetic mean would produce a biased overestimate.
For n positive values \(x_1, x_2, \ldots, x_n\), the harmonic mean is:
$$H = \frac{n}{\frac{1}{x_1} + \frac{1}{x_2} + \cdots + \frac{1}{x_n}} = \frac{n}{\sum_{i=1}^{n} \frac{1}{x_i}}$$
The harmonic mean gives greater weight to smaller values. A single very small value dramatically pulls the harmonic mean down, while large values have relatively little effect. This property is mathematically explained by the fact that taking reciprocals reverses the scale — large values become small reciprocals and vice versa.
The Pythagorean means inequality states that for any set of positive, non-identical values:
$$H \leq G \leq A$$
where \(H\) = harmonic mean, \(G\) = geometric mean, \(A\) = arithmetic mean. Equality holds only when all values are identical.
A harmonic mean of 48 for speeds 40 and 60 km/h means that a round trip at these speeds is equivalent to traveling the entire distance at a constant 48 km/h. Note that the arithmetic mean (50 km/h) would overestimate the average speed because more time is spent at the slower speed. The harmonic mean correctly accounts for the unequal time spent at each rate.
The larger the variation between values, the greater the difference between harmonic and arithmetic means, with the harmonic mean always being lower.
Inputs
Results
Driving 40 km/h one way and 60 km/h back. Harmonic mean = 2/(1/40 + 1/60) = 48 km/h. The arithmetic mean of 50 km/h overstates the average speed by 4%.
Inputs
Results
Precision = 0.85, Recall = 0.92. The F1-score (harmonic mean) = 2/(1/0.85 + 1/0.92) = 0.8836. This penalizes imbalance between precision and recall more than the arithmetic mean would.
Use harmonic mean when averaging rates, speeds, prices per unit, or any ratio where the denominator varies. The classic example is average speed: if you drive equal distances at different speeds, the harmonic mean gives the correct average speed.
Because taking reciprocals gives more weight to smaller values. The AM-HM inequality (A >= H) is a fundamental property of means, with equality only when all values are identical.
No. Since the formula involves 1/x, any zero value causes division by zero. The harmonic mean is defined only for strictly positive values.
The F1-score is the harmonic mean of precision and recall: F1 = 2 * (P*R)/(P+R). The harmonic mean penalizes extreme imbalance: if either precision or recall is very low, the F1-score drops significantly.
The weighted harmonic mean is H = (sum of weights) / (sum of weight/value). It is used when different values have different importance, such as averaging fuel efficiency across trips of different distances.
For resistors in parallel, the total resistance is related to the harmonic mean: R_total = (R1 * R2)/(R1 + R2) for two resistors, which equals H/n where H is the harmonic mean. This extends naturally to n parallel components.
Roboculator Team
The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.
How helpful was this calculator?
Be the first to rate!