Sub topic 9
Infinite GP: when the sum exists and what it equals
This chapter assumes you can find the nth term and the finite sum of a GP, work with exponents and fractions, and solve linear and simple quadratic equations. The goal is to know when an infinite sum exists, to compute it, and to avoid the traps CAT sets around it.
From finite sums to an infinite sum
A GP with first term a and common ratio r has the finite sum S_n = a(1 - r^n)/(1 - r) for r ≠ 1. An infinite GP asks what happens to S_n as n grows without limit. The only part of the formula that depends on n is r^n.
- If
|r| < 1, thenr^nshrinks toward 0 asngrows. The partial sums settle ata/(1 - r). - If
|r| ≥ 1, thenr^ndoes not shrink. The partial sums never settle.
When the partial sums settle on a number, we say the series converges to that number. The infinite sum is that limit:
S = a / (1 - r), valid only for |r| < 1
| Ratio | Behaviour of the partial sums | Infinite sum |
|---|---|---|
| `r = 1` | `a, 2a, 3a, ...` grow without bound | Does not exist |
| `r = -1` | `a, 0, a, 0, ...` oscillate | Does not exist |
| `r > 1` | Grow without bound | Does not exist |
| `r < -1` | Swing between ever larger positive and negative values | Does not exist |
| `-1 < r < 1` | Approach `a/(1 - r)` | Exists |
The case r = -1 is the one students forget. The terms alternate in sign and do not grow, but the sum still fails to exist.
Computing the sum in code
The function below refuses ratios outside the convergence range. It uses exact fractions, so results are not rounded.
from fractions import Fraction
def gp_infinite_sum(a, r):
r = Fraction(r)
if abs(r) >= 1:
raise ValueError("the infinite sum exists only when |r| < 1")
return Fraction(a) / (1 - r)
print(gp_infinite_sum(8, Fraction(1, 2))) # 16
print(gp_infinite_sum(12, Fraction(-1, 2))) # 8For 12 - 6 + 3 - ..., the ratio is -1/2, so the sum is 12 / (1 + 1/2) = 8. A negative ratio makes the sum smaller than the first term, because the terms alternate and partly cancel.
How fast the partial sums approach the limit
The gap between the infinite sum and the nth partial sum is S - S_n = a r^n / (1 - r). For 8 + 4 + 2 + 1 + ..., the gap after n terms is 16 / 2^n.
from fractions import Fraction
a, r = 8, Fraction(1, 2)
S = Fraction(a) / (1 - r)
for n in (1, 2, 5, 10):
s_n = Fraction(a) * (1 - r ** n) / (1 - r)
print(n, s_n, S - s_n)
# 1 8 8
# 2 12 4
# 5 31/2 1/2
# 10 16368/1023 ... (see note)Do not rely on the last printed line as written. The exact values for n = 10 are S_10 = 2046/128 = 15.984375 and a gap of 1/64. Fractions print in lowest terms, so run the code to see the exact output. The point is that the gap halves with every extra term.
Worked examples
Example 1: recurring decimals
A recurring decimal is an infinite GP. Take 0.363636.... It equals 0.36 + 0.0036 + 0.000036 + ..., so a = 0.36 and r = 0.01.
S = 0.36 / 0.99 = 36/99 = 4/11
When the repeating part does not start right after the decimal point, split off the non-repeating part. For 0.4777...:
0.4 + 0.07 / (1 - 0.1) = 4/10 + 7/90 = 36/90 + 7/90 = 43/90
from fractions import Fraction
print(Fraction(36, 99)) # 4/11
print(Fraction(4, 10) + Fraction(7, 100) / (1 - Fraction(1, 10))) # 43/90Example 2: finding the ratio from the sum
An infinite GP has first term 6 and sum 8. Then 6 / (1 - r) = 8, so 1 - r = 3/4 and r = 1/4. This satisfies |r| < 1, so the answer is valid.
In general, r = 1 - a/S. For a valid ratio, a/S must lie strictly between 0 and 2. Given a = 6 and S = 2, you would get r = -2. No such infinite GP exists.
Example 3: a bouncing ball
A ball is dropped from 10 m. After each bounce it rises to 3/5 of its previous height. Find the total distance travelled.
- The first fall is 10 m.
- The rebound heights are 6, 3.6, 2.16, ..., a GP with
a = 6andr = 3/5. Their sum is6 / (2/5) = 15. - Each rebound height is travelled twice, up and then down. That gives
2 × 15 = 30. - The total is
10 + 30 = 40m.
The first fall is not doubled. Mixing this up is the usual error in such problems.
Example 4: alternate terms
Suppose a GP converges with first term a and ratio r. Taking every second term gives a new GP with ratio r^2.
- Terms in odd positions (1st, 3rd, ...): sum is
a / (1 - r^2). - Terms in even positions (2nd, 4th, ...): sum is
ar / (1 - r^2).
Check with 1 + 1/2 + 1/4 + ..., which sums to 2. The odd-position terms give 1 / (1 - 1/4) = 4/3. The even-position terms give (1/2) / (3/4) = 2/3. Together, 4/3 + 2/3 = 2.
Example 5: an unknown inside the ratio
Find x if 1 + 2x + 4x² + 8x³ + ... = 5.
The ratio is 2x, so the sum is 1 / (1 - 2x). Setting this equal to 5 gives 1 - 2x = 1/5, so x = 2/5. Check: |2x| = 4/5 < 1, so the solution is valid.
Now change the right side to -1. Then 1 - 2x = -1, so x = 1. That makes r = 2, which fails |r| < 1. The equation has no valid solution, and CAT often plants exactly this trap.
Common errors
- Applying
a/(1 - r)when|r| ≥ 1. The formula still produces a number, but the sum does not exist. - Taking
afrom the wrong place. If the series isS = 1/3 + 1/9 + ..., the first term is1/3, not 1. - Dropping the sign of a negative ratio. For
r = -1/3, the denominator is1 + 1/3, not1 - 1/3. - Forgetting that the infinite sum includes the first term. A question may ask for the sum "after the first term". That is
S - a, which also equalsar / (1 - r). - Treating
r = -1as safe because the terms are bounded. It still fails.
Exercises
Exercise
Express 0.2515151... as a fraction in lowest terms.
Show answer
Split it as 0.2 + 0.05151... The repeating part is 0.051 + 0.00051 + ..., with a = 0.051 and r = 0.01, so its sum is 0.051/0.99 = 51/990 = 17/330. Add 0.2 = 66/330 to get 83/330.
Exercise
The sum of an infinite GP is 12 and its second term is 3. Find the possible values of the first term a and ratio r.
Show answer
The second term is ar = 3 and the sum is a/(1 - r) = 12, so a = 12(1 - r). Substituting gives 12r(1 - r) = 3, so 4r² - 4r + 1 = 0, which factorises as (2r - 1)² = 0. So r = 1/2 and a = 6. Both satisfy the conditions, and there is only one GP.
Exercise
For which values of x does the series 1 + (x - 2) + (x - 2)² + ... have a sum, and what is that sum when x = 2.5?
Show answer
The ratio is x - 2, so the sum exists when |x - 2| < 1, that is 1 < x < 3. At x = 2.5 the ratio is 0.5, so the sum is 1 / (1 - 0.5) = 2.