# Harmonic mean

The harmonic mean is one of the three Pythagorean means; the other two are arithmetic mean and geometric mean. It is a type of average which is calculated by dividing the number of values by the sum of reciprocals of each value.

## Definition

Definition: The harmonic mean of numeric variable given on finite population with $N$ elements and distribution $\{(x_{1}, f_{1}), \cdots, (x_{k}, f_{k})\}$ and which has only positive values, is number

$$H = \frac{N}{\frac{f_{1}}{x_{1}} + \cdots + \frac{f_{k}}{x_{k}}}.$$

Notice that

$$H = \frac{1}{\frac{\frac{f_{1}}{x_{1}}}{N} + \cdots + \frac{\frac{f_{k}}{x_{k}}}{N}}\frac{1}{\frac{\frac{f_{1}}{N}}{x_{1}} + \cdots + \frac{\frac{f_{k}}{N}}{x_{k}}}= \frac{1}{\frac{p_{1}}{x_{1}}+ \cdots + \frac{p_{k}}{x_{k}}},$$

where $p_{1}, \cdots, p_{k}$ are relative frequencies of properties $x_{1}, \cdots, x_{k}$, respectively.

Similarly, if a variable is given with statistical sequence $y_{1}, \cdots, y_{N}$ (with positive values), then its harmonic mean is obviously

$$H(y_{1}, \cdots, y_{N}) = \frac{N}{\frac{1}{y_{1}} + \cdots + \frac{1}{y_{N}}}.$$

Therefore, the harmonic mean is calculated by dividing the number of observations by the sum of reciprocals of each given number. Furthermore, we can notice that the harmonic mean is the reciprocal of the arithmetic mean of the reciprocals.

## Examples

The harmonic mean is often used in calculating the average of the ratios.

Example 1: Find the harmonic mean of the numbers $2, 5$ and $6$.

Solution:

$$H = \frac{3}{\frac{1}{2}+\frac{1}{5}+\frac{1}{6}} = \frac{3}{\frac{15 + 6 + 5}{30}} = \frac{3}{\frac{26}{30}} = \frac{3}{\frac{13}{15}}= \frac{45}{13} \approx 3.462$$

Application of harmonic speed is in most cases in the problems of average speed.

Example 2: If we are driving with an average speed $100$ km/h in one direction and $50$ km/h in other, what is the average speed?

Solution:

The average speed is $H = \frac{2}{\frac{1}{100} + \frac{1}{50}} = 66.7$ km/h.

Fractions $\frac{1}{100}$ and $\frac{1}{50}$ can be interpreted as the time needed to cross the unit segment of path, i.e. $1$ km, at speed $100$ km/h, respectively $50$ km/h.

Example 3: If the average duration of $1$ L of milk for household $A$ is $5$ days, for household $B$ $10$ days and for household $C$ $15$ days, what is the average duration of $1$ L of milk in those three households?

Solution:

The average duration of $1$ L of milk in the households $A, B$ and $C$ is $H = \frac{3}{\frac{1}{5}+ \frac{1}{10} + \frac{1}{15}} = 8.2$.

Fractions $\frac{1}{5}, \frac{1}{10}$ and $\frac{1}{15}$ can be interpreted as part of the $1$ L of milk which is spent for $1$ day in the households $A, B$ and $C$, respectively.

## Geometric interpretation of the harmonic mean

If we want to draw the harmonic mean of $x$ and $y$, the first step is to draw a semicircle with diameter $x + y$.

Next, we will draw the geometric mean $\sqrt {xy}$ of number $x$ and $y$. It is the length of a line segment $CE$.

Furthermore, we will find the midpoint $O$ of line segment $AB$.

Let $F$ be the intersection point of perpendicular from point $C$ to line segment $OE$.

Finally, the harmonic mean of $x$ and $y$ is the length of the line segment $EF$.

Intuitively, looking at the picture above, we can anticipate that the arithmetic mean is greater than or equal to geometric mean, which is greater than or equal to harmonic mean.

## Arithmetic mean – Geometric mean – Harmonic mean Inequality (AM – GM – HM)

The AM – GM – HM inequality is an inequality of the arithmetic mean, geometric mean and the harmonic mean of a set of positive real numbers $x_{1}, \cdots, x_{n}$ that says:

$$AM \geq GM \geq HM,$$

i.e.

$$\frac{x_{1}+\cdots+x_{n}}{n}\geq \sqrt[n]{x_{1}x_{2}\cdots x_{n}}\geq \frac{n}{\frac{1}{x_{1}}+\cdots\frac{1}{x_{n}}},$$

with equality if and only if $x_{1}=\cdots =x_{n}.$

## Difference between the harmonic and arithmetic mean

First, let’s see an example with arithmetic mean:

Example 4: Mark drives a vehicle at $25$ mph for the first hour and $35$ mph for the second. Calculate Mark’s average speed.

Solution:

Mark’s average speed is $\frac{25 + 35}{2} = 30$ mph.

Now we’ll see an example with harmonic mean:

Example 5: Mark drives a vehicle at $25$ mph for the half of the journey and $35$ mph for the second half. Calculate Mark’s average speed.

Solution:

Mark’s average speed is $\frac{2}{\frac{1}{25} + \frac{1}{35}} = 29.2$ mph.

The first example is calculating an average speed based on time, while the second example is based on distance. We can notice that the harmonic mean is less than arithmetic mean, which is always the case.