brand banner

Updated

Harmonic Mean

Equal-distance average speed, F1-score, parallel resistance, and HM ≤ GM ≤ AM.

To see the pattern behind the harmonic mean, write two positive numbers as

𝑎=𝑐𝑥,𝑏=𝑐𝑦,𝑐,𝑥,𝑦>0.

Same numerator, different denominators: both fractions have 𝑐 on top, while 𝑥 and 𝑦 are the denominators. Any positive 𝑎,𝑏 can be written this way: choose 𝑐>0, then set 𝑥=𝑐𝑎 and 𝑦=𝑐𝑏.

Keep the shared numerator and average the denominators:

𝐻=𝑐𝑥+𝑦2=2𝑐𝑥+𝑦.

Since 1𝑎=𝑥𝑐 and 1𝑏=𝑦𝑐, this is exactly the reciprocal of the arithmetic mean of the reciprocals:

𝐻=11𝑎+1𝑏2=2𝑎𝑏𝑎+𝑏.

Driving there and back

Drive a distance 𝑑 at speed 𝑎, then return the same distance at speed 𝑏. Same numerator, different denominators: the two speeds are 𝑑𝑡1 and 𝑑𝑡2. Both legs cover the same distance 𝑑, but take different times. Average speed is total distance divided by total time:

𝑣avg=2𝑑𝑑𝑎+𝑑𝑏=2𝑎𝑏𝑎+𝑏=𝐻.

For example, drive 60 km out at 30 km/h and 60 km back at 60 km/h. The legs take 2 hours and 1 hour, so the average speed is 1203=40 km/h, not 30+602=45 km/h. You spend more time at the slower speed. The arithmetic mean would apply to equal times, not equal distances.

The upside-down trick. Arithmetic averaging works when the rates refer to equal amounts of their denominator: km/h for equal times. Here the equal quantity is distance, so flip the rates to h/km (time per distance), average arithmetically, then flip back. At 30 and 60 km/h, each kilometre takes 2 and 1 minutes respectively. Their arithmetic mean is 1.5 min/km; turning that upside down gives 601.5=40 km/h. The harmonic mean is just an arithmetic mean upside down: reciprocate, average, reciprocate.

F1-score

Precision and recall measure a classifier’s positive predictions:

𝑃=TPTP+FP,𝑅=TPTP+FN,

where TP, FP, and FN count true positives, false positives, and false negatives. Same numerator, different denominators: both ratios count the same true positives. Precision divides by all predicted positives; recall divides by all actual positives.

Their harmonic mean is the F1-score:

𝐹1=21𝑃+1𝑅=2𝑃𝑅𝑃+𝑅=2TP2TP+FP+FN.

For example, with 30 true positives, 10 false positives, and 30 false negatives, 𝑃=3040=0.75 and 𝑅=3060=0.5. Thus 𝐹1=60100=0.6, below the arithmetic mean 0.625: a high precision cannot fully make up for a low recall, or vice versa.

The shared numerator makes the upside-down trick explicit: average 1𝑃+1𝑅2=(TP+FP)+(TP+FN)2TP, then reciprocate. F1 gives precision and recall equal weight. This is a choice of metric, not a rule that every pair of ratios with a shared numerator must be averaged harmonically.

The reciprocal derivation assumes 𝑃,𝑅>0. If either is zero, F1 is zero whenever 2TP+FP+FN>0; if all three counts are zero, the score is undefined unless a convention is specified.

Parallel resistance

Two positive resistances 𝑅1 and 𝑅2 connected in parallel have the same voltage 𝑉>0 across them. By Ohm’s law,

𝑅1=𝑉𝐼1,𝑅2=𝑉𝐼2.

Same numerator, different denominators: both ratios have the same voltage 𝑉 on top, but the branch currents 𝐼1 and 𝐼2 differ.

The currents add, so the equivalent resistance is

𝑅eq=𝑉𝐼1+𝐼2=11𝑅1+1𝑅2=𝑅1𝑅2𝑅1+𝑅2.

The equivalent resistance is half the harmonic mean, not the harmonic mean itself:

𝐻=𝑉𝐼1+𝐼22=2𝑅eq.

Dividing the shared voltage by the average branch current gives 𝐻; dividing it by the total current gives 𝑅eq.

For example, put 6 Ω and 3 Ω resistors in parallel across 12 V. The branch currents are 2 A and 4 A, so 𝑅eq=126=2 Ω, while their harmonic mean is 123=4 Ω.

Harmonic, geometric, and arithmetic means

For 𝑎,𝑏>0, let 𝐺=𝑎𝑏 and 𝐴=𝑎+𝑏2. Then

𝐻≤𝐺≤𝐴.

Short proof of AM–GM. Since a square is nonnegative,

(𝑎−𝑏)2≥0⇒𝑎+𝑏≥2𝑎𝑏⇒𝐴≥𝐺.

Also, 𝐻=𝐺2𝐴≤𝐺, giving the full chain. Equality in either inequality holds exactly when 𝑎=𝑏.

Geometric proof (Thales and similar triangles). Draw a semicircle with diameter 𝑃𝑄=𝑎+𝑏. Choose 𝐷 on the diameter with 𝑃𝐷=𝑎 and 𝐷𝑄=𝑏, and let the perpendicular through 𝐷 meet the semicircle at 𝑇.

Let 𝑂 be the centre. By Thales’ theorem, ∠𝑃𝑇𝑄=90°. The right triangles 𝑃𝐷𝑇 and 𝑇𝐷𝑄 are similar, so

𝑃𝐷𝐷𝑇=𝐷𝑇𝐷𝑄⇒𝐷𝑇=𝑎𝑏.

This height cannot exceed the semicircle’s radius 𝑂𝑇=𝑎+𝑏2, hence 𝑎𝑏≤𝑎+𝑏2. Equality holds exactly when 𝐷 is the centre, that is, 𝑎=𝑏.

Similar


© 2026 James Yap

Personal Website and Knowledge Base