The Harmonic Mean (HM) is a type of average, one of the three Pythagorean means, used for sets of positive real numbers. It is calculated as the number of values divided by the sum of the reciprocals of the values. The harmonic mean is most appropriate for situations when the average of rates is desired, such as average speed when traveling equal distances at different speeds.
It gives less weight to larger values and more weight to smaller values. Therefore, it is always the smallest of the Pythagorean means (Harmonic ≤ Geometric ≤ Arithmetic).
| Symbol | Description |
|---|---|
| HM | Harmonic Mean |
| n | The total number of values in the dataset. |
| xᵢ | An individual data value (must be positive). |
| wᵢ | The weight or frequency associated with each value xᵢ. |
| Σ | Summation symbol, indicating to add up a series of numbers. |
The Harmonic Mean does not have a standard geometric diagram like a shape. It is a statistical measure of central tendency. Conceptually, it can be visualized on a number line as the smallest of the three Pythagorean means for a given dataset, positioned closest to the minimum value in the set.
Means Inequality: For any set of positive numbers, the harmonic mean is always less than or equal to the geometric mean, which is less than or equal to the arithmetic mean.
Sensitivity to Small Values: The harmonic mean is heavily influenced by the smallest values in a dataset. A single small value can significantly lower the overall harmonic mean.
Reciprocal Relationship: The harmonic mean of a set of numbers is the reciprocal of the arithmetic mean of their reciprocals.
Let's prove why the average speed for a journey covering the same distance d twice, at two different speeds s₁ and s₂, is the harmonic mean of the speeds.
1. The formula for average speed is Total Distance / Total Time.
2. Calculate the time taken for each part of the journey using the formula time = distance / speed.
3. Now, substitute the total distance and total time into the average speed formula.
4. Factor out the distance d from the denominator and cancel it.
This final expression is the formula for the harmonic mean of two numbers, s₁ and s₂.
Transportation & Logistics: Used to calculate the true average speed of a vehicle over a journey with multiple segments of equal distance but different speeds.
Finance: Used in dollar-cost averaging to find the average cost of shares purchased over time. It is also used to average multiples like the Price-Earnings (P/E) ratio.
Physics & Engineering: Used to calculate the equivalent resistance of parallel resistors in an electrical circuit, and to find the average density of a composite material.
Computer Science: The F1-score in machine learning, a measure of a test's accuracy, is the harmonic mean of precision and recall.
Fuel Efficiency: When a car's fuel efficiency is measured in miles per gallon (or km per liter) over different terrains (city, highway), the harmonic mean provides a more accurate overall efficiency if the distance driven on each terrain is the same.
Data Transmission: In networking, if a file is downloaded in chunks over connections with different speeds, the harmonic mean can describe the average data transfer rate, as it properly accounts for the time spent at slower speeds.
Population Density: When averaging population densities across several regions of equal area, the harmonic mean gives a more representative figure for the overall density, weighting the more sparsely populated areas correctly.
| Type | Description | Use Case |
|---|---|---|
| Simple Harmonic Mean | All data points are given equal importance. It is the default calculation. | Averaging speeds over equal distances. |
| Weighted Harmonic Mean | Each data point is assigned a weight (wᵢ) corresponding to its importance or frequency. | Averaging speeds over different distances, where the distances are the weights. |
Using the Arithmetic Mean for Rates: The most common error is using the simple arithmetic average for rates like speed. For a round trip at 40 mph and 60 mph, the arithmetic mean is 50 mph, but the correct average speed (the harmonic mean) is 48 mph because more time is spent traveling at the slower speed.
Including Zero or Negative Values: The harmonic mean is undefined if any value in the dataset is zero (due to division by zero). It is also not typically used for negative numbers, as the concept is based on rates and quantities that are positive.
Ignoring Weights: When averaging rates over unequal intervals (e.g., different distances), the simple harmonic mean is incorrect. The weighted harmonic mean must be used, with the intervals (distances) as the weights.