TExcelTAD
Home › Pre-Calculus, Geometry & Trigonometry › Geometric Progressions

Geometric Progressions

A geometric progression is a sequence where you multiply by the same number every step: 2, 6, 18, 54, … It models anything that grows or shrinks by a percentage: compound interest, populations, signal decay, and the clever way dynamic arrays grow. This lesson covers the nn-th term, the sum formula and those applications.

The common ratio

In a geometric progression (GP, geometric sequence) each term is the previous one times a fixed number rr, the common ratio:

a1, a1⋅r, a1⋅r2, a1⋅r3, …n-th term:an=a1⋅rn−1\begin{aligned} &a_1,\ a_1 \cdot r,\ a_1 \cdot r^2,\ a_1 \cdot r^3,\ \ldots \\ &n\text{-th term:}\quad a_n = a_1 \cdot r^{n-1} \end{aligned}
First terms a1a_1 rr Behaviour
3, 6, 12, 24, … 3 2 grows fast
80, 40, 20, 10, … 80 12\frac{1}{2} shrinks toward 0
5, −10, 20, −40, … 5 −2 sign flips, size grows
1, −0.3, 0.09, … 1 −0.3 sign flips, shrinks

To test a list, divide each term by the previous one: equal ratios mean a GP. If ∣r∣>1\lvert r \rvert > 1 the terms blow up, if ∣r∣<1\lvert r \rvert < 1 they shrink to 0, and a negative rr makes the signs alternate. On a graph a GP with positive terms is an exponential curve, and on a log scale it becomes a straight line (see Exponential and Logarithmic Functions).

Tip: To find how many steps a GP needs to reach a size, use logarithms: a1⋅rk≥Ta_1 \cdot r^k \ge T means k≥log⁡(T/a1)/log⁡(r)k \ge \log(T/a_1) / \log(r) (for r>1r > 1).

The sum of a GP

Let Sn=a1+a1r+⋯+a1rn−1S_n = a_1 + a_1 r + \cdots + a_1 r^{n-1}. Multiply by rr and subtract: almost every term cancels.

Sn=a1+a1r+a1r2+⋯+a1rn−1r⋅Sn=a1+a1r+a1r2+⋯+a1rn−1+a1rnSn−rSn=a1−a1rnSn=a1⋅(1−rn)1−r(r≠1)\begin{aligned} S_n &= a_1 + a_1 r + a_1 r^2 + \cdots + a_1 r^{n-1} \\ r \cdot S_n &= \phantom{a_1 + {}} a_1 r + a_1 r^2 + \cdots + a_1 r^{n-1} + a_1 r^n \\ S_n - r S_n &= a_1 - a_1 r^n \\[1ex] S_n &= \frac{a_1 \cdot (1 - r^n)}{1 - r} && (r \ne 1) \end{aligned}

If r=1r = 1 every term equals a1a_1 and Sn=n⋅a1S_n = n \cdot a_1. A handy special case is 1+2+4+⋯+2n−1=2n−11 + 2 + 4 + \cdots + 2^{n-1} = 2^n - 1: the sum of all the powers of two below 2n2^n is one less than 2n2^n. That is why an nn-bit unsigned integer holds at most 2n−12^n - 1.

python · try it yourself
from fractions import Fraction

def gp_sum(a1, r, n):
    return a1 * (1 - r**n) / (1 - r)

print("3 + 6 + ... (10 terms):", gp_sum(3, 2, 10), sum(3 * 2**k for k in range(10)))
print("1 + 2 + ... + 2^31    :", 2**32 - 1, sum(2**k for k in range(32)))

# exact with fractions: 1 + 1/3 + 1/9 + ... (8 terms)
print("1 + 1/3 + ... (8 terms):", gp_sum(Fraction(1), Fraction(1, 3), 8))
3 + 6 + ... (10 terms): 3069.0 3069
1 + 2 + ... + 2^31    : 4294967295 4294967295
1 + 1/3 + ... (8 terms): 3280/2187

Compound interest

A deposit PP at an annual rate ii, compounded once a year, is worth P⋅(1+i)nP \cdot (1 + i)^n after nn years: a GP with r=1+ir = 1 + i. Compounding mm times per year uses rate i/mi/m per period and m⋅nm \cdot n periods. Saving the same amount every year adds up a GP of balances.

python · try it yourself
P, i = 1000, 0.05
print("year  simple  compound")
for n in [0, 5, 10, 20, 30]:
    print(f"{n:>4}  {P * (1 + i * n):>6.0f}  {P * (1 + i)**n:>8.2f}")

# monthly compounding for 10 years
print("monthly, 10 years:", round(P * (1 + i / 12)**(12 * 10), 2))

# save 100 at the end of every year for 10 years at 5%
total = sum(100 * (1 + i)**k for k in range(10))
print("savings plan     :", round(total, 2), round(100 * ((1 + i)**10 - 1) / i, 2))
year  simple  compound
   0    1000   1000.00
   5    1250   1276.28
  10    1500   1628.89
  20    2000   2653.30
  30    2500   4321.94
monthly, 10 years: 1647.01
savings plan     : 1257.79 1257.79

Simple interest is an arithmetic progression and grows along a line; compound interest is geometric and pulls away. The savings plan is the GP sum with a1=100a_1 = 100 and r=1.05r = 1.05.

In software: dynamic array doubling

A Python list, a C++ std::vector or a Java ArrayList keeps spare room. When it is full it allocates a bigger block and copies everything over. If it doubles its capacity, the capacities are a GP (1, 2, 4, 8, …), and the total copying work to reach nn elements is 1+2+4+⋯+2k1 + 2 + 4 + \cdots + 2^k, where 2k2^k is the last capacity below nn. By the GP sum that is 2k+1−1<2n2^{k+1} - 1 < 2n. Spread over nn appends, that is fewer than two copies per append: amortised O(1)O(1). Growing by a fixed amount instead (an AP of capacities) costs O(n2)O(n^2) copies in total.

python · try it yourself
def copies(n, grow):
    cap, used, work = 1, 0, 0
    for _ in range(n):
        if used == cap:
            work += used          # copy every element to the new block
            cap = grow(cap)
        used += 1
    return work

for n in [1_000, 10_000, 100_000]:
    doubling = copies(n, lambda c: 2 * c)
    plus_100 = copies(n, lambda c: c + 100)
    print(f"n = {n:>7}: doubling copied {doubling:>7}, +100 copied {plus_100:>10}")
n =    1000: doubling copied    1023, +100 copied       4510
n =   10000: doubling copied   16383, +100 copied     495100
n =  100000: doubling copied  131071, +100 copied   49951000

Doubling's work grows like nn (each total is 2k−12^k - 1, a GP sum), while the fixed step grows like n2n^2. Real implementations often use factors like 1.5 to waste less memory; any factor above 1 keeps the amortised cost constant. Other places GPs show up: exponential backoff when retrying network requests (wait 1, 2, 4, 8 s), the halving in binary search, and the shrinking learning rate in ML training schedules.

Exercises

Exercise 1: The 8th term

Find a8a_8 of the GP 4, 12, 36, …

Answer

8748

Solution
a1=4, r=3a8=4⋅37=4⋅2187=8748\begin{aligned} &a_1 = 4,\ r = 3 \\ &a_8 = 4 \cdot 3^7 = 4 \cdot 2187 = 8748 \end{aligned}

Exercise 2: Sum of a shrinking GP

Find the exact sum 96+48+24+⋯+396 + 48 + 24 + \cdots + 3.

Answer

189

Solution
r=12,96⋅(1/2)k=3⇒(1/2)k=1/32⇒k=5, so n=6 termsS6=96⋅(1−(1/2)6)1−1/2=96⋅6364⋅2=189\begin{aligned} &r = \tfrac{1}{2},\quad 96 \cdot (1/2)^k = 3 \Rightarrow (1/2)^k = 1/32 \Rightarrow k = 5, \text{ so } n = 6 \text{ terms} \\ &S_6 = \frac{96 \cdot (1 - (1/2)^6)}{1 - 1/2} = 96 \cdot \frac{63}{64} \cdot 2 = 189 \end{aligned}

Exercise 3: Doubling time

At 7% a year compounded annually, after how many whole years does a deposit first at least double? Check with a loop.

Answer

11 years (the exact doubling time is about 10.24 years, so year 11 is the first full year past double).

Solution
1.07n≥2⇒n≥ln⁡2/ln⁡1.07≈10.24⇒n=111.07^n \ge 2 \quad\Rightarrow\quad n \ge \ln 2 / \ln 1.07 \approx 10.24 \quad\Rightarrow\quad n = 11
python · try it yourself
import math

print(round(math.log(2) / math.log(1.07), 2))
n, balance = 0, 1.0
while balance < 2:
    balance *= 1.07
    n += 1
print(n, round(balance, 4))
10.24 
11 2.1049

Exercise 4: Backoff budget

A client retries a failed request after waiting 0.5 s, then 1 s, 2 s, 4 s, … (doubling). How long has it waited in total after 8 retries?

Answer

127.5 seconds

Solution
a1=0.5, r=2, n=8:S8=0.5⋅(28−1)2−1=0.5⋅255=127.5a_1 = 0.5,\ r = 2,\ n = 8{:}\quad S_8 = \frac{0.5 \cdot (2^8 - 1)}{2 - 1} = 0.5 \cdot 255 = 127.5

Test yourself

What is the common ratio of 81, −27, 9, −3, …?

  1. −1/3-1/3
  2. 1/31/3
  3. −3-3
  4. 3

Why does doubling a dynamic array's capacity give amortised O(1)O(1) appends?

  1. Copying is free
  2. The total copy work is a GP sum below 2n2n, so under two copies per append on average
  3. The array never needs to be copied
  4. Because nn is small in practice

What is 1+2+4+⋯+291 + 2 + 4 + \cdots + 2^9?

  1. 512
  2. 1024
  3. 511
  4. 1023