Sub topic 13
Harmonic progressions via reciprocals
This chapter assumes you can find the nth term and the sum of an AP, and that you can handle fractions and simple equations. A harmonic progression (HP) needs no new machinery. You turn it into an AP, solve the AP, and turn the answer back.
What an HP is
A sequence of non-zero numbers is a harmonic progression if the reciprocals of its terms form an arithmetic progression.
The sequence 1, 1/2, 1/3, 1/4, ... is an HP. Its reciprocals are 1, 2, 3, 4, ..., which is an AP with common difference 1. The sequence 12, 6, 4, 3 is also an HP. Its reciprocals are 1/12, 1/6, 1/4, 1/3, and each step adds 1/12.
An HP has no "common difference" of its own. The differences between its terms are not constant. The constant difference lives in the reciprocals.
The nth term of an HP whose reciprocal AP starts at a with difference d is:
1 / (a + (n − 1)d)
Here a is the reciprocal of the first term, and d is the common difference of the reciprocals.
Worked example: two known terms
Problem. In an HP the 2nd term is 12 and the 5th term is 6. Find the 8th term.
- Take reciprocals. The AP has 2nd term 1/12 and 5th term 1/6.
- Three steps separate the 2nd and 5th terms, so 3d = 1/6 − 1/12 = 1/12. Hence d = 1/36.
- The 8th AP term is 1/6 + 3d = 1/6 + 1/12 = 1/4.
- Take the reciprocal. The 8th HP term is 4.
You never need the first term. Count steps from a term you already have. The code below checks this and generalises it.
from fractions import Fraction
def hp_term(p, tp, q, tq, n):
"""HP has value tp at position p and tq at position q. Return term n."""
rp, rq = 1 / Fraction(tp), 1 / Fraction(tq)
d = (rq - rp) / (q - p)
first = rp - (p - 1) * d
return 1 / (first + (n - 1) * d)
print(hp_term(2, 12, 5, 6, 8)) # 4
print(hp_term(2, 12, 5, 6, 1)) # 18The full HP is 18, 12, 9, 36/5, 6, 36/7, 9/2, 4, ...
Harmonic means
If a, b, c are in HP, then b is the harmonic mean (HM) of a and c. Because 1/b is the middle term of an AP, it equals the average of its neighbours:
2/b = 1/a + 1/c, so b = 2ac / (a + c)
For two numbers x and y, HM = 2xy / (x + y).
For three terms a, b, c in HP there is also a ratio form:
a / c = (a − b) / (b − c)
Check it with the HP 2, 3, 6. Here a/c = 1/3, and (2 − 3)/(3 − 6) = (−1)/(−3) = 1/3. The ratio form saves time when the terms are given as numbers and you only need to confirm or find one of them.
Inserting several harmonic means
To insert k harmonic means between p and q, insert k arithmetic means between 1/p and 1/q, then flip each one.
Problem. Insert two harmonic means between 2 and 6.
- Reciprocals of the ends: 1/2 and 1/6. With two means inserted there are 3 steps.
- d = (1/6 − 1/2) / 3 = (−1/3) / 3 = −1/9.
- The AP is 1/2, 7/18, 5/18, 1/6.
- Flip each term: 2, 18/7, 18/5, 6.
from fractions import Fraction
def insert_harmonic_means(p, q, k):
rp, rq = 1 / Fraction(p), 1 / Fraction(q)
d = (rq - rp) / (k + 1)
return [1 / (rp + i * d) for i in range(k + 2)]
print(*insert_harmonic_means(2, 6, 2)) # 2 18/7 18/5 6How AM, GM and HM fit together
For two positive numbers x and y:
- AM = (x + y) / 2
- GM = √(xy)
- HM = 2xy / (x + y)
Multiplying AM by HM gives (x + y)/2 × 2xy/(x + y) = xy, which is GM². So GM is the geometric mean of AM and HM, and GM² = AM × HM. This holds for two numbers only.
For positive numbers that are not all equal, AM > GM > HM. They are all equal only when the numbers are equal. The relation gives a fast way to find a missing mean. For 4 and 9, AM = 13/2 and GM = 6, so HM = 36 / (13/2) = 72/13.
The comparison table below puts the three progressions side by side.
| Type | What is constant | nth term | Mean of two numbers x, y |
|---|---|---|---|
| AP | difference d | a + (n − 1)d | (x + y)/2 |
| GP | ratio r | a·r^(n−1) | √(xy) |
| HP | difference of reciprocals | 1 / (a + (n − 1)d) | 2xy/(x + y) |
Where HM appears in word problems
The harmonic mean is the correct average when the same quantity is covered at different rates. For example, equal distances at different speeds give average speed = total distance ÷ total time, and that reduces to the HM of the speeds.
Problem. A car travels from A to B at 60 km/h and returns at 40 km/h. What is the average speed?
Let the one-way distance be D. The time is D/60 + D/40 = D(2 + 3)/120 = D/24 for a trip of 2D. Average speed = 2D ÷ (D/24)... no, the time is 5D/120 = D/24, so 2D ÷ (D/24) = 48 km/h. The HM formula gives the same result directly: 2 × 60 × 40 / 100 = 48.
The plain average of 50 is the typical wrong answer. It is too high, as AM > HM predicts.
Common errors and edge cases
- There is no simple sum formula. The sum 1 + 1/2 + 1/3 + ... + 1/n has no closed form. Do not take the AP sum of the reciprocals and flip it. If a CAT question has an HP, it asks for a term, a mean or a relation, not a sum.
- Flipping the wrong thing. Reciprocals of the terms form an AP. The reciprocal of the AP sum is not the HP sum.
- Zero is not allowed. No term of an HP can be 0, because its reciprocal does not exist. The HP 2, 3, 6 has reciprocal AP 1/2, 1/3, 1/6, and the next AP term is 0. The fourth HP term is undefined, so the sequence cannot continue.
- Negative terms. If the reciprocal AP passes through zero, the HP terms change sign. After the undefined position, the HP continues as −6, −3, ... (reciprocals −1/6, −1/3 and so on). Check that a requested position is a valid term.
- Mixing up positions. When counting steps between terms, use the difference of positions. The 2nd and 5th terms are 3 steps apart, not 5.
- Ratio form with a + c = 0. The formula b = 2ac/(a + c) fails when a + c = 0, because the reciprocals then sum to a value that cannot give a finite middle term. Go back to the reciprocal AP in that case.
- AM ≥ GM ≥ HM needs positive numbers. With negative values the order can reverse or the means can be undefined.
Speed checks for CAT
- If three terms a, b, c are in HP, then 1/a, 1/b, 1/c are in AP, so a + c − 2b is not the test. The test is 2/b = 1/a + 1/c.
- If a, b, c are in AP, then 1/a, 1/b, 1/c are in HP only for special values. Do not assume the reverse direction.
- If x, y, z are in AP, then (y + z), (z + x), (x + y) being in AP means x, y, z are in AP. Dividing a common amount by each term, such as xyz/(y + z)... is a standard trick to produce an HP. If 1/(y + z), 1/(z + x), 1/(x + y) are in AP, then x, y, z... you can verify this on small numbers before trusting a general rule.
- In a multiple-choice question, test the options with a small AP such as 1, 2, 3 in the reciprocal slot. If the HP terms are 1, 1/2, 1/3, you can eliminate wrong options quickly.
Exercise
The 3rd term of an HP is 1/5 and its 6th term is 1/11. Find its 9th term, and state the first term.
Show answer
Reciprocals form an AP with 3rd term 5 and 6th term 11. So 3d = 6 and d = 2. The first AP term is 5 − 2d = 1, so the first HP term is 1. The 9th AP term is 5 + 6d = 17, so the 9th HP term is 1/17.
Exercise
Insert three harmonic means between 1/2 and 1/10, and then find the harmonic mean of 6 and 12.
Show answer
Reciprocals of the ends are 2 and 10. With three means inserted there are 4 steps, so d = (10 − 2)/4 = 2. The AP is 2, 4, 6, 8, 10, so the HP is 1/2, 1/4, 1/6, 1/8, 1/10 and the three means are 1/4, 1/6, 1/8. The harmonic mean of 6 and 12 is 2 × 6 × 12 / 18 = 8.
Exercise
A cyclist rides 30 km at 15 km/h and then another 30 km at 10 km/h. What is the average speed for the whole ride, and which mean gives it?
Show answer
The distances are equal, so the average speed is the harmonic mean of the speeds: 2 × 15 × 10 / 25 = 12 km/h. Check: total time = 2 + 3 = 5 hours for 60 km, and 60/5 = 12 km/h.