Objective
Learning objectives
- Explain why growth rate matters more than starting size over a long enough time horizon
- Recognize exponential decay as the same form as exponential growth, with a rate between 0 and 1
- Read the general exponential form and identify what the starting value, rate, and time each control
- Model and plot a decay scenario, then predict a future value from it
Hook
Post A has 1,000 views and is growing 10% per hour. Post B has 10,000 views — a 10x head start — but is only growing 3% per hour. Which one has more views a week from now? Size feels like the thing that matters, since 10,000 is a lot bigger than 1,000. But size is a snapshot; rate is a trend, and trends compound.
See it
def views(start, rate, hours):
return start * (1 + rate) ** hours
for h in [0, 12, 24, 35, 36]:
a = views(1000, 0.10, h)
b = views(10000, 0.03, h)
print(h, round(a), round(b), a > b)
0 1000 10000 False
12 3138 14258 False
24 9850 20328 False
35 28102 28139 False
36 30913 28983 True
Post A spends its first day and a half looking hopelessly behind — at hour 24 it's not even half of Post B's total. Then, between hour 35 and hour 36, it overtakes and never looks back. The 10x head start didn't disappear; it was simply never strong enough to survive a sustained rate difference once compounding had enough time to work. This is the entire reason "what's the growth rate?" is usually a more urgent question than "what's the current number?"
This is also true in reverse — for decay
The same logic runs backward: a small decay-rate difference compounds too. A battery, a signal, a model's confidence in old context — anything shrinking by a fixed percentage per step follows this exact pattern, just with a rate below 1 instead of above it. It's not a different kind of math; it's the same exponential form, decaying instead of climbing.
Name it
The general exponential form is value(t) = a × (1 + r)^t, where a is the starting value (at t = 0), r is the rate of change per time step, and t is the number of steps elapsed. When r > 0, this is growth — Post A used a = 1000, r = 0.10. When -1 < r < 0 (a negative rate, like losing 4% per step), the exact same formula produces decay — nothing about the structure changes, only the sign and size of r.
Code it
A model's confidence in a piece of context plausibly fades the further back that context is — not because of a measured constant this lesson claims to know precisely, but as a simplified illustration of the same decay pattern:
def confidence(distance, rate=0.995):
return 100 * (rate ** distance)
for d in [0, 50, 100, 200, 500, 1000]:
print(d, round(confidence(d), 2))
0 100.0
50 77.83
100 60.58
200 36.7
500 8.16
1000 0.67
rate=0.995 means "keep 99.5% of confidence per token of distance" — a tiny per-step decay that still compounds down to under 1% by 1,000 tokens away. This is a × (1 + r)^t again, just written with r = -0.005 folded directly into rate = 0.995. Same shape as Post A and B's growth, same underlying mathematics, opposite direction.
import matplotlib.pyplot as plt
distances = list(range(0, 1001, 10))
values = [confidence(d) for d in distances]
plt.plot(distances, values)
plt.xlabel("distance (tokens)")
plt.ylabel("confidence (%)")
plt.savefig("confidence_decay.png", dpi=150, bbox_inches="tight")
def charge(hours, rate=0.04, start=100):
return start * (1 - rate) ** hours
print(round(charge(5), 2))
print(round(charge(10), 2))
1 - rate = 0.96 — each hour keeps 96% of the previous hour's charge. After 5 hours: 100 * 0.96^5 ≈ 81.54. After 10 hours: 100 * 0.96^10 ≈ 66.48. Same a × (1 + r)^t form as everything else in this lesson, with r = -0.04 written as (1 - 0.04).