harmonic mean
In mathematics, the harmonic mean is a kind of average, one of the Pythagorean means. It is sometimes used for ratios and rates such as speeds, and is normally used for positive arguments only. The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals of the numbers, that is, the generalized f-mean with f(x) = \frac{1}{x} . For example, the harmonic mean of 1, 4, and 4 is : \left(\frac{1^{-1} + 4^{-1} + 4^{-1}}{3}\right)^{-1} = \frac{3}{\frac{1}{1} + \frac{1}{4} + \frac{1}{4}} = \frac{3}{1.5} = 2\,.
In mathematics, the harmonic mean is a kind of average, one of the Pythagorean means. It is sometimes used for ratios and rates such as speeds, and is normally used for positive arguments only. The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals of the numbers, that is, the generalized f-mean with f(x) = \frac{1}{x} . For example, the harmonic mean of 1, 4, and 4 is \left(\frac{1^{-1} + 4^{-1} + 4^{-1}}{3}\right)^{-1} = \frac{3}{\frac{1}{1} + \frac{1}{4} + \frac{1}{4}} = \frac{3}{1.5} = 2\,. ==Definition== The harmonic mean H of the positive real numbers x_1, x_2, \ldots, x_n is H(x_1, x_2, \ldots, x_n) = \frac{n}{\displaystyle \frac1{x_1} + \frac1{x_2} + \cdots + \frac1{x_n}} = \frac{n}{\displaystyle \sum_{i=1}^n \frac1{x_i}}. It is the reciprocal of the arithmetic mean of the reciprocals, and vice versa: \begin{align} H(x_1, x_2, \ldots, x_n) &= \frac{1}{\displaystyle A\left(\frac1{x_1}, \frac1{x_2}, \ldots \frac1{x_n}\right)}, \\ A(x_1, x_2, \ldots, x_n) &= \frac{1}{\displaystyle H\left(\frac1{x_1}, \frac1{x_2}, \ldots \frac1{x_n}\right)}, \end{align} where the arithmetic mean is A(x_1, x_2, \ldots, x_n) = \tfrac1n \sum_{i=1}^n x_i. The harmonic mean is a Schur-concave function. It is greater than or equal to the minimum of its arguments: for positive arguments, \min(x_1,\ldots,x_n) \le H(x_1,\ldots,x_n) \le n\min(x_1,\ldots,x_n) . Indeed, if m=\min(x_1,\ldots,x_n) , then \sum_{i=1}^n 1/x_i\leq n/m , while \sum_{i=1}^n 1/x_i\geq 1/m , which gives the two inequalities from the definition above. Thus, the harmonic mean cannot be made arbitrarily large by changing some values to bigger ones while having at least one value unchanged. 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. (If all values in a nonempty data set are equal, the three means are always equal.) It is the special case M −1 of the power mean: H\left(x_1, x_2, \ldots, x_n\right) = M_{-1}\left(x_1, x_2, \ldots, x_n\right) = \frac{n}{x_1^{-1} + x_2^{-1} + \cdots + x_n^{-1}} Since the harmonic mean of a list of numbers tends strongly toward the least elements of the list, it tends (compared to the arithmetic mean) 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, finding the average speed based on equal amounts of distance, the arithmetic mean of 40 is incorrect. Since the arithmetic mean is always greater than or equal to the harmonic mean, this necessarily means 40 is larger than the correct answer. 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 H\left(x_1, \ldots, x_n\right) = \frac{\left(G\left(x_1, \ldots, x_n\right)\right)^n} {A\left(x_2 x_3 \cdots x_n, x_1 x_3 \cdots x_n, \ldots, x_1 x_2 \cdots x_{n-1}\right)} = \frac{\left(G\left(x_1, \ldots, x_n\right)\right)^n} {A\left( \frac{1}{x_1} {\prod\limits_{i=1}^n x_i}, \frac{1}{x_2} {\prod\limits_{i=1}^n x_i}, \ldots, \frac{1}{x_n} {\prod\limits_{i=1}^n x_i} \right)}. 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=== of two numbers, a and b. The harmonic mean is denoted by H in purple, while the arithmetic mean is A in red and the geometric mean is G in blue. Q denotes a fourth mean, the quadratic mean. Since a hypotenuse is always longer than a leg of a right triangle, the diagram shows that H \le G \le A \le Q . to calculate it. The blue line shows that the harmonic mean of 6 and 2 is 3. The magenta line shows that the harmonic mean of 6 and −2 is −6. The red line shows that the harmonic mean of a number and its negative is undefined as the line does not intersect the z axis. For the special case of just two numbers, x_1 and x_2 , the harmonic mean can be written as: H = \frac{2x_1 x_2}{x_1 + x_2} \qquad or \qquad \frac{1}{H} = \frac{(1/x_1) + (1/x_2)}{2}. (Note that the harmonic mean is undefined if x_1 + x_2 = 0 , i.e. x_1 = -x_2 .) In this special case, the harmonic mean is related to the arithmetic mean A = \frac{x_1 + x_2}{2} and the geometric mean G = \sqrt{x_1 x_2}, by H = \frac{G^2}{A} = G\left(\frac{G}{A}\right). Since \tfrac{G}{A} \le 1 by the inequality of arithmetic and geometric means, this shows for the n = 2 case that H ≤ G (a property that in fact holds for all n). It also follows that G = \sqrt{AH} , 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, x_1 , x_2 and x_3 , the harmonic mean can be written as: H = \frac{3 x_1 x_2 x_3}{x_1 x_2 + x_1 x_3 + x_2 x_3}. 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 \frac{A^3}{G^3} + \frac{G^3}{H^3} + 1 \le \frac3{4} \left(1 + \frac{A}{H}\right)^2. ==Weighted harmonic mean== If a set of weights w_1 , ..., w_n is associated to the data set x_1 , ..., x_n , the weighted harmonic mean is defined by H = \frac{\sum\limits_{i=1}^n w_i}{\sum\limits_{i=1}^n \frac{w_i}{x_i}} = \left( \frac{\sum\limits_{i=1}^n w_i x_i^{-1}}{\sum\limits_{i=1}^n w_i} \right)^{-1}. 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 n is asymptotically equal to the harmonic mean of the first n 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 v_1 (e.g. 60 km/h) and returns the same distance at a speed v_2 (e.g. 20 km/h), then its average speed is the harmonic mean of v_1 and v_2 (30 km/h), not the arithmetic mean (40 km/h). 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: \text{Average speed for the entire journey} = \frac{\text{Total distance traveled}}{\text{Sum of time for each segment}} = \frac{2s}{t_1 + t_2} = \frac{2s}{\frac{s}{v_1}+\frac{s}{v_2}} = \frac{2v_1v_2}{v_1+v_2} = 30 However, if the vehicle travels for a certain amount of time at a speed v_1 and then the same amount of time at a speed v_2 , then its average speed is the arithmetic mean of v_1 and v_2 , which in the above example is 40 km/h. \text{Average speed for the entire journey} = \frac{\text{Total distance traveled}}{\text{Sum of time for each segment}} = \frac{s_1+s_2}{2t} = \frac{v_1 t + v_2 t}{2t} = \frac{v_1+v_2}{2} = 40 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. If neither is the case, then a weighted harmonic mean or weighted arithmetic mean is needed. For the arithmetic mean, the speed of each portion of the trip is weighted by the duration of that portion, while for the harmonic mean, the corresponding weight is the distance. In both cases, the resulting formula reduces to dividing the total distance by the total time. 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 (in hours per kilometer) 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 p_i = \frac{1}{speed_i} . Then take the weighted arithmetic mean of the p_i \text{s} weighted by their respective distances (optionally with the weights normalized so they sum to 1 by dividing them by trip length). This gives the true average pace (in time per kilometer). 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 (or, equivalently, percentages by mass), then the predicted density of the alloy (exclusive of typically minor volume changes due to atom packing effects) 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 R 1 (e.g., 60 Ω) and one having resistance R 2 (e.g., 40 Ω), then the effect is the same as if one had used two resistors with the same resistance, both equal to the harmonic mean of R 1 and R 2 (48 Ω); the equivalent resistance, in either case, is 24 Ω (one-half of the harmonic mean). This same principle applies to capacitors in series or to inductors in parallel. Average resistance for both resistors in parallel = = = 48 However, if one connects the resistors in series, then the average resistance is the arithmetic mean of R 1 and R 2 (50 Ω), with total resistance equal to twice this, the sum of R 1 and R 2 (100 Ω). This principle applies to capacitors in parallel or to inductors in series. Average resistance for both resistors in series ====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 f 1 and f 2 in series is equivalent to two thin lenses of focal length f hm , their harmonic mean, in series. Expressed as optical power, two thin lenses of optical powers P 1 and P 2 in series is equivalent to two thin lenses of optical power P am , their arithmetic mean, in series. ===In finance=== The weighted harmonic mean is the preferable method for averaging multiples, such as the price–earnings ratio (P/E). 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 (see above). ===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 (t > 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. (This is provable using similar triangles.) 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 (the distance from a focus to the ellipse along a line parallel to the minor axis) is the harmonic mean of the maximum and minimum distances of the ellipse from a focus. ==Beta distribution== The harmonic mean of a beta distribution with shape parameters α and β is: H = \frac{\alpha - 1}{\alpha + \beta - 1} \text{ conditional on } \alpha > 1 \, \, \& \, \, \beta > 0 The harmonic mean with α H = \frac{\alpha - 1}{2 \alpha - 1} showing that for α = β the harmonic mean ranges from 0 for α = β = 1, to 1/2 for α = β → ∞. The following are the limits with one parameter finite (non-zero) and the other parameter approaching these limits: \begin{align} \lim_{\alpha \to 0} H &= \text{ undefined } \\ \lim_{\alpha \to 1} H &= \lim_{\beta \to \infty} H = 0 \\ \lim_{\beta \to 0} H &= \lim_{\alpha \to \infty} H = 1 \end{align} With the geometric mean the harmonic mean may be useful in maximum likelihood estimation in the four parameter case. A second harmonic mean (H 1 − X ) also exists for this distribution H_{1-X} = \frac{\beta - 1}{\alpha + \beta - 1} \text{ conditional on } \beta > 1 \, \, \& \, \, \alpha > 0 This harmonic mean with β H_{1-X} = \frac{\beta - 1}{2 \beta - 1} showing that for α = β the harmonic mean ranges from 0, for α = β = 1, to 1/2, for α = β → ∞. The following are the limits with one parameter finite (non zero) and the other approaching these limits: \begin{align} \lim_{\beta \to 0} H_{1-X} &= \text{ undefined } \\ \lim_{\beta \to 1} H_{1-X} &= \lim_{\alpha \to \infty} H_{1-X} = 0 \\ \lim_{\alpha \to 0} H_{1-X} &= \lim_{\beta \to \infty} H_{1-X} = 1 \end{align} Although both harmonic means are asymmetric, when α = β the two means are equal. ==Lognormal distribution== The harmonic mean ( H ) of the lognormal distribution of a random variable X is H = \exp \left( \mu - \frac{1}{2} \sigma^2 \right), where μ and σ 2 are the parameters of the distribution, i.e. the mean and variance of the distribution of the natural logarithm of X. The harmonic and arithmetic means of the distribution are related by \frac{\mu^*}{H} = 1 + C_v^2 \, , where C v and μ * are the coefficient of variation and the mean of the distribution respectively.. The geometric (G), arithmetic and harmonic means of the distribution are related by H \mu^* = G^2. ==Pareto distribution== The harmonic mean of type 1 Pareto distribution is H = k \left( 1 + \frac{1}{\alpha} \right) where k is the scale parameter and α is the shape parameter. ==Statistics== For a random sample, the harmonic mean is calculated as above. Both the mean and the variance may be infinite (if it includes at least one term of the form 1/0). ===Sample distributions of mean and variance=== The mean of the sample m is asymptotically distributed normally with variance s 2 . s^2 = \frac{m \left[\operatorname{E}\left(\frac{1}{x} - 1\right)\right]}{m^2 n} The variance of the mean itself is \operatorname{Var}\left(\frac{1}{x}\right) = \frac{m \left[\operatorname{E}\left(\frac{1}{x} - 1\right)\right]}{n m^2} where m is the arithmetic mean of the reciprocals, x are the variates, n is the population size and E is the expectation operator. ===Delta method=== Assuming that the variance is not infinite and that the central limit theorem applies to the sample then using the delta method, the variance is \operatorname{Var}(H) = \frac{1}{n}\frac{s^2}{m^4} where H is the harmonic mean, m is the arithmetic mean of the reciprocals m = \frac{1}{n} \sum{ \frac{1}{x} }. s 2 is the variance of the reciprocals of the data s^2 = \operatorname{Var}\left( \frac{1}{x} \right) and n is the number of data points in the sample. ===Jackknife method=== A jackknife method of estimating the variance is possible if the mean is known. This method is the usual 'delete 1' rather than the 'delete m' version. This method first requires the computation of the mean of the sample (m) m = \frac{n}{ \sum{ \frac{1}{x} } } where x are the sample values. A series of value w i is then computed where w_i = \frac{n - 1}{ \sum_{j \neq i} \frac{1}{x} }. The mean (h) of the w i is then taken: h = \frac{1}{n} \sum{w_i} The variance of the mean is \frac{n - 1}{n} \sum{(m - w_i)}^2. Significance testing and confidence intervals for the mean can then be estimated with the t test. ===Size biased sampling=== Assume a random variate has a distribution f( x ). Assume also that the likelihood of a variate being chosen is proportional to its value. This is known as length based or size biased sampling. Let μ be the mean of the population. Then the probability density function f*( x ) of the size biased population is f^*(x) = \frac{x f(x)}{\mu} The expectation of this length biased distribution E * ( x ) is \operatorname{E}^*(x) = \mu \left[ 1 + \frac{\sigma^2}{\mu^2} \right] where σ 2 is the variance. The expectation of the harmonic mean is the same as the non-length biased version E( x ) E^*( x^{ -1 } ) = E( x )^{ -1 } The problem of length biased sampling arises in a number of areas including textile manufacture pedigree analysis and survival analysis Akman et al. have developed a test for the detection of length based bias in samples. ===Shifted variables=== If X is a positive random variable and q > 0 then for all ε > 0 \operatorname{Var} \left[\frac{1}{(X + \epsilon)^q}\right] ===Moments=== Assuming that X and E(X) are > 0 then \operatorname{E}\left[ \frac{1}{X} \right] \ge \frac{1}{ \operatorname{E}(X) } This follows from Jensen's inequality. Gurland has shown that for a distribution that takes only positive values, for any n > 0 \operatorname{E} \left(X^{-1}\right) \ge \frac{\operatorname{E} \left(X^{n-1}\right)}{\operatorname{E}\left(X^n\right)} . Under some conditions \operatorname{E}(a + X)^{-n} \sim \operatorname{E}\left(a + X^{-n}\right) where ~ means approximately equal to. ===Sampling properties=== Assuming that the variates (x) are drawn from a lognormal distribution there are several possible estimators for H: \begin{align} H_1 &= \frac{n}{ \sum\left(\frac{1}{x}\right) } \\ H_2 &= \frac{\left( \exp\left[ \frac{1}{n} \sum \log_e(x) \right] \right)^2}{ \frac{1}{n} \sum(x) } \\ H_3 &= \exp \left(m - \frac{1}{2} s^2 \right) \end{align} where m = \frac{1}{n} \sum \log_e (x) s^2 = \frac{1}{n} \sum \left(\log_e (x) - m\right)^2 Of these H 3 is probably the best estimator for samples of 25 or more. ===Bias and variance estimators=== A first order approximation to the bias and variance of H 1 are \begin{align} \operatorname{bias}\left[ H_1 \right] &= \frac{H C_v}{n} \\ \operatorname{Var}\left[ H_1 \right] &= \frac{H^2 C_v}{n} \end{align} where C v is the coefficient of variation. Similarly a first order approximation to the bias and variance of H 3 are \begin{align} \frac{H \log_e \left(1 + C_v\right)}{2n} \left[ 1 + \frac{1 + C_v^2}{2} \right] \\ \frac{H \log_e \left(1 + C_v\right)}{n} \left[ 1 + \frac{1 + C_v^2}{4} \right] \end{align} In numerical experiments H 3 is generally a superior estimator of the harmonic mean than H 1 . H 2 produces estimates that are largely similar to H 1 . ==Notes== The Environmental Protection Agency recommends the use of the harmonic mean in setting maximum toxin levels in water. In geophysical reservoir engineering studies, the harmonic mean is widely used. ==See also== Rate (mathematics) Contraharmonic mean Generalized mean Weighted mean Weighted geometric mean HM-GM-AM-QM inequalities Harmonic mean p-value Harmonic number Parallel (operator), whose result is half of the harmonic mean Mediant (mathematics), a fraction which lies between two fractions ==References== ==External links== Averages, Arithmetic and Harmonic Means at cut-the-knot
References
- harmonic mean. https://en.wikipedia.org/w/index.php?oldid=1376354915 · 1795438144.7002156
Cite this
"harmonic mean". 1790176414. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1376354915