Harmonic mean


In mathematics, the harmonic mean is a kind of average, one of the Pythagorean means.
It is the most appropriate average for ratios and rates such as speeds, and is normally only used for positive arguments.
The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals of the numbers, that is, the generalized f-mean with. For example, the harmonic mean of 1, 4, and 4 is

Definition

The harmonic mean H of the positive real numbers is
It is the reciprocal of the arithmetic mean of the reciprocals, and vice versa:
where the arithmetic mean is
The harmonic mean is a Schur-concave function, and is greater than or equal to the minimum of its arguments: for positive arguments,. Thus, the harmonic mean cannot be made arbitrarily large by changing some values to bigger ones.
The harmonic mean is also concave for positive arguments, an even stronger property than Schur-concavity.

Relationship with other means

For all positive data sets containing at least one pair of nonequal values, the harmonic mean is always the least of the three Pythagorean means, while the arithmetic mean is always the greatest of the three and the geometric mean is always in between.
It is the special case M−1 of the power mean:
Since the harmonic mean of a list of numbers tends strongly toward the least elements of the list, it tends to mitigate the impact of large outliers and aggravate the impact of small ones.
The arithmetic mean is often mistakenly used in places calling for the harmonic mean. In the speed example [|below] for instance, the arithmetic mean of 40 is incorrect, and too big.
The harmonic mean is related to the other Pythagorean means, as seen in the equation below. This can be seen by interpreting the denominator to be the arithmetic mean of the product of numbers n times but each time omitting the j-th term. That is, for the first term, we multiply all n numbers except the first; for the second, we multiply all n numbers except the second; and so on. The numerator, excluding the n, which goes with the arithmetic mean, is the geometric mean to the power n. Thus the n-th harmonic mean is related to the n-th geometric and arithmetic means. The general formula is
If a set of non-identical numbers is subjected to a mean-preserving spread — that is, two or more elements of the set are "spread apart" from each other while leaving the arithmetic mean unchanged — then the harmonic mean always decreases.

Harmonic mean of two or three numbers

Two numbers

For the special case of just two numbers, and, the harmonic mean can be written as:
In this special case, the harmonic mean is related to the arithmetic mean and the geometric mean by
Since by the inequality of arithmetic and geometric means, this shows for the n = 2 case that HG. It also follows that, meaning the two numbers' geometric mean equals the geometric mean of their arithmetic and harmonic means.

Three numbers

For the special case of three numbers,, and, the harmonic mean can be written as:
Three positive numbers H, G, and A are respectively the harmonic, geometric, and arithmetic means of three positive numbers if and only if the following inequality holds

Weighted harmonic mean

If a set of weights,..., is associated to the data set,...,, the weighted harmonic mean is defined by
The unweighted harmonic mean can be regarded as the special case where all of the weights are equal.

Examples

In analytic number theory

Prime number theory

The prime number theorem states that the number of primes less than or equal to is asymptotically equal to the harmonic mean of the first natural numbers.

In physics

Average speed

In many situations involving rates and ratios, the harmonic mean provides the correct average. For instance, if a vehicle travels a certain distance s outbound at a speed v1 and returns the same distance at a speed v2, then its average speed is the harmonic mean of v1 and v2, not the arithmetic mean. The total travel time is the same as if it had traveled the whole distance at that average speed. This can be proven as follows:
Average speed for the entire journey

= =
However, if the vehicle travels for a certain amount of time at a speed v1 and then the same amount of time at a speed v2, then its average speed is the arithmetic mean of v1 and v2, which in the above example is 40 km/h.
Average speed for the entire journey

=
The same principle applies to more than two segments: given a series of sub-trips at different speeds, if each sub-trip covers the same distance, then the average speed is the harmonic mean of all the sub-trip speeds; and if each sub-trip takes the same amount of time, then the average speed is the arithmetic mean of all the sub-trip speeds.
However, one may avoid the use of the harmonic mean for the case of "weighting by distance". Pose the problem as finding the pace of the trip where pace is the inverse of speed. When trip pace is found, invert it so as to find the "true" average trip speed. For each trip segment i, the pace pi = 1/speedi. Then take the weighted arithmetic mean of the pi's weighted by their respective distances. This gives the true average pace. It turns out that this procedure, which can be done with no knowledge of the harmonic mean, amounts to the same mathematical operations as one would use in solving this problem by using the harmonic mean. Thus it illustrates why the harmonic mean works in this case.

Density

Similarly, if one wishes to estimate the density of an alloy given the densities of its constituent elements and their mass fractions, then the predicted density of the alloy is the weighted harmonic mean of the individual densities, weighted by mass, rather than the weighted arithmetic mean as one might at first expect. To use the weighted arithmetic mean, the densities would have to be weighted by volume. Applying dimensional analysis to the problem while labeling the mass units by element and making sure that only like element-masses cancel makes this clear.

Electricity

If one connects two electrical resistors in parallel, one having resistance R1 and one having resistance R2, then the effect is the same as if one had used two resistors with the same resistance, both equal to the harmonic mean of R1 and R2 ; the equivalent resistance, in either case, is 24 Ω. This same principle applies to capacitors in series or to inductors in parallel.
Average resistance for both resistors in parallel

= =
However, if one connects the resistors in series, then the average resistance is the arithmetic mean of R1 and R2, with total resistance equal to twice this, the sum of R1 and R2. This principle applies to capacitors in parallel or to inductors in series.
Average resistance for both resistors in series

=
As with the previous example, the same principle applies when more than two resistors, capacitors or inductors are connected, provided that all are in parallel or all are in series.
The "conductivity effective mass" of a semiconductor is also defined as the harmonic mean of the effective masses along the three crystallographic directions.

Optics

As for other optic equations, the thin lens equation = + can be rewritten such that the focal length f is one-half of the harmonic mean of the distances of the subject u and object v from the lens.
Two thin lenses of focal length f1 and f2 in series is equivalent to two thin lenses of focal length fhm, their harmonic mean, in series. Expressed as optical power, two thin lenses of optical powers P1 and P2 in series is equivalent to two thin lenses of optical power Pam, their arithmetic mean, in series.

In finance

The weighted harmonic mean is the preferable method for averaging multiples, such as the price–earnings ratio. If these ratios are averaged using a weighted arithmetic mean, high data points are given greater weights than low data points. The weighted harmonic mean, on the other hand, correctly weights each data point. The simple weighted arithmetic mean when applied to non-price normalized ratios such as the P/E is biased upwards and cannot be numerically justified, since it is based on equalized earnings; just as vehicles speeds cannot be averaged for a roundtrip journey.

In geometry

In any triangle, the radius of the incircle is one-third of the harmonic mean of the altitudes.
For any point P on the minor arc BC of the circumcircle of an equilateral triangle ABC, with distances q and t from B and C respectively, and with the intersection of PA and BC being at a distance y from point P, we have that y is half the harmonic mean of q and t.
In a right triangle with legs a and b and altitude h from the hypotenuse to the right angle, is half the harmonic mean of and.
Let t and s be the sides of the two inscribed squares in a right triangle with hypotenuse c. Then equals half the harmonic mean of and.
Let a trapezoid have vertices A, B, C, and D in sequence and have parallel sides AB and CD. Let E be the intersection of the diagonals, and let F be on side DA and G be on side BC such that FEG is parallel to AB and CD. Then FG is the harmonic mean of AB and DC.
One application of this trapezoid result is in the crossed ladders problem, where two ladders lie oppositely across an alley, each with feet at the base of one sidewall, with one leaning against a wall at height A and the other leaning against the opposite wall at height B, as shown. The ladders cross at a height of h above the alley floor. Then h is half the harmonic mean of A and B. This result still holds if the walls are slanted but still parallel and the "heights" A, B, and h are measured as distances from the floor along lines parallel to the walls. This can be proved easily using the area formula of a trapezoid and area addition formula.
In an ellipse, the semi-latus rectum is the harmonic mean of the maximum and minimum distances of the ellipse from a focus.