Calculate Harmonic Mean

Online calculator to compute the harmonic mean of a data series

Harmonic Mean Calculator

The Harmonic Mean

The harmonic mean is the mean of reciprocals of n positive numbers. It is particularly suitable for velocities and rates.

Enter Data
Positive data values (separated by space or semicolon)
Result
Harmonic Mean:
Properties of the Harmonic Mean

Important: x̄harm ≤ x̄geom ≤ x̄arith (smallest of three means). Defined only for positive numbers.

Reciprocal-based For Velocities Positive Values Only

Harmonic Mean Concept

The harmonic mean is n divided by the sum of reciprocals.
Ideal for average velocities and rates.

Reciprocals → Sum → Division 2 3 4 5 6 1/x 1/2 1/3 1/4 1/5 1/6 + + + + Sum 1.45 n/Σ 3.45

Input Values Reciprocals Harmonic Mean


What is the Harmonic Mean?

The harmonic mean is a special measure of location with important applications:

  • Definition: n divided by the sum of reciprocals
  • Calculation: H = n / (1/x₁ + 1/x₂ + ... + 1/xₙ)
  • Requirement: All values must be positive (> 0)
  • Property: Smallest of three means (≤ geometric ≤ arithmetic)
  • Application: Ideal for average velocities and rates
  • Advantage: Correct for constant numerator (e.g., same distance)

Calculating the Harmonic Mean

The calculation follows four steps:

1. Reciprocals

Create reciprocals:
1/x₁, 1/x₂, ..., 1/xₙ

2. Sum

Add reciprocals:
S = Σ(1/xᵢ)

3. Count

Determine count:
n = Number of Values

4. Divide

Divide n by S:
H = n / S

Applications of the Harmonic Mean

The harmonic mean is particularly important for:

Transport and Velocity
  • Average velocity with constant distance
  • Fuel consumption (liters per km)
  • Travel time calculations
  • Traffic flow analysis
Economics and Finance
  • Price-to-Earnings Ratio (P/E Ratio)
  • Average cost per unit
  • Price indices with quantity weighting
  • Productivity metrics

Formulas for the Harmonic Mean

Harmonic Mean
\[H = \frac{n}{\sum_{i=1}^{n} \frac{1}{x_i}}\]

n divided by the sum of reciprocals

Extended Form
\[H = \frac{n}{\frac{1}{x_1} + \frac{1}{x_2} + ... + \frac{1}{x_n}}\]

Explicit representation with fractions

Alternative Form
\[H = \frac{1}{\frac{1}{n}\sum_{i=1}^{n}\frac{1}{x_i}}\]

Reciprocal of the arithmetic mean of reciprocals

For Two Values
\[H = \frac{2}{\frac{1}{x_1} + \frac{1}{x_2}} = \frac{2x_1x_2}{x_1+x_2}\]

Simplified form for two values

Symbol Explanations
\(H\) Harmonic Mean
\(x_i\) Individual Data Value
\(n\) Number of Values
\(\sum\) Summation Symbol
\(\frac{1}{x_i}\) Reciprocal of xᵢ
\(\overline{x}\) Arithmetic Mean

Example Calculations for the Harmonic Mean

Example 1: Basic Calculation
Data: 2, 3, 4, 5, 6

Calculate: Harmonic mean of 5 values

1. Create Reciprocals
\[\frac{1}{2}, \frac{1}{3}, \frac{1}{4}, \frac{1}{5}, \frac{1}{6}\]

Reciprocals of all values

2. Sum Reciprocals
\[S = \frac{1}{2}+\frac{1}{3}+\frac{1}{4}+\frac{1}{5}+\frac{1}{6}\] \[\approx \color{blue}{1.45}\]

Sum of reciprocals

3. Harmonic Mean
\[H = \frac{5}{1.45}\] \[\approx \color{blue}{3.45}\]

n divided by sum

Example 2: Average Velocity
Forward: 60 km/h, Return: 40 km/h (same distance)

Calculate: Average velocity for round trip

Correct Method (Harmonic)
\[H = \frac{2}{\frac{1}{60} + \frac{1}{40}}\] \[= \frac{2 \cdot 60 \cdot 40}{60+40} = \frac{4800}{100}\] \[= \color{blue}{48 \text{ km/h}}\]

Correct for same distance

Incorrect Method (Arithmetic)
\[\overline{x} = \frac{60 + 40}{2}\] \[= \color{red}{50 \text{ km/h}}\]

Wrong! With same distance, more time is spent at 40 km/h.

Explanation

Example with 120 km per leg:
Forward: 120 km / 60 km/h = 2 hours
Return: 120 km / 40 km/h = 3 hours
Total: 240 km in 5 hours = 48 km/h ✓
The harmonic mean is correct here, not the arithmetic mean!

Example 3: Comparison of Three Means
Data: 1, 2, 4
Harmonic Mean
\[H = \frac{3}{\frac{1}{1}+\frac{1}{2}+\frac{1}{4}}\] \[= \frac{3}{1.75} \approx \color{blue}{1.71}\]

Smallest Mean

Geometric Mean
\[\overline{x}_{geom} = \sqrt[3]{1 \cdot 2 \cdot 4}\] \[= \sqrt[3]{8} = \color{blue}{2.0}\]

Middle Mean

Arithmetic Mean
\[\overline{x} = \frac{1+2+4}{3}\] \[= \frac{7}{3} \approx \color{blue}{2.33}\]

Largest Mean

Important Inequality

H ≤ G ≤ A: The harmonic mean (1.71) is always smallest, followed by the geometric (2.0), and the arithmetic (2.33) is largest.
Equality holds only when all values are identical.
Difference increases with greater spread of values.

Mathematical Foundations of the Harmonic Mean

The harmonic mean is an important measure of location with special properties that is especially used for ratio numbers and rates.

Properties of the Harmonic Mean

The harmonic mean has characteristic mathematical properties:

  • Inequality: H ≤ G ≤ A (harmonic ≤ geometric ≤ arithmetic)
  • Positive values only: Defined only for xᵢ > 0
  • Reciprocal-based: H = 1 / (arithmetic mean of reciprocals)
  • Weighting: Smaller values receive more weight than larger ones
  • Extreme sensitivity: Very sensitive to small values

When to Use the Harmonic Mean?

Harmonic Mean is Correct
  • Velocities: With same distance
  • Rates: Unit/time with equal units
  • Ratio numbers: E.g., cost per unit
  • Reciprocals: When reciprocals should be added
  • Resistance calculation: Parallel circuits
Use Other Means
  • Arithmetic: With same time (instead of distance)
  • Geometric: For growth rates and multiplicative processes
  • Median: For skewed distributions with outliers
  • Weighted means: With different importance levels

Practical Example: Average Velocity

Scenario:

A car travels 100 km at 50 km/h, then 100 km at 100 km/h.
Question: What is the average velocity?

Common Mistake (Arithmetic):

(50 + 100) / 2 = 75 km/h
Wrong! The time is not equally distributed.

Correct Solution (Harmonic):

H = 2 / (1/50 + 1/100) = 2 / 0.03 = 66.67 km/h
Verification:
Time 1: 100 km / 50 km/h = 2 h
Time 2: 100 km / 100 km/h = 1 h
Total: 200 km / 3 h = 66.67 km/h ✓

Special Applications

Physics and Engineering
  • Parallel circuits: Total resistance R = n/(1/R₁ + ... + 1/Rₙ)
  • Lenses: Focal length with combined lenses
  • Capacitances: Series connection of capacitors
  • Flows: Flow rates
Economics
  • F-Score: Harmonic mean of precision and recall
  • Price indices: With quantity weighting
  • Average costs: Cost per unit
  • Productivity: Output rates

Relationship to Other Means

Harmonic Mean

H = n / Σ(1/xᵢ)
Smallest Mean
For Rates

Geometric Mean

G = ⁿ√(Πxᵢ)
Middle Mean
For Growth

Arithmetic Mean

A = Σxᵢ / n
Largest Mean
For Sums

Summary

The harmonic mean is the correct measure of location for averages of rates and ratios, especially for velocities with constant distance. It is the smallest of the three classical means (H ≤ G ≤ A) and gives more weight to smaller values. The most common error is using the arithmetic mean for velocities – this leads to incorrect results when times are different. The harmonic mean also has important applications in physics (parallel circuits) and machine learning (F-score).

Ist diese Seite hilfreich?            
Vielen Dank für Ihr Feedback!

Das tut uns leid

Wie können wir die Seite verbessern?