Day 20 — Exponential growth & decay
Day 20 — Exponential growth & decay
Stage II · concept day
Goal: Model \(a\cdot r^{t}\) growth/decay; compute doubling time and half-life; compare linear vs exponential tables; use compound interest; treat logs as inverses of exponentials to solve for time.
Why this matters
Moore’s-law style growth, epidemic toy models, cache miss penalties that multiply, and compound interest are exponential. Algorithms that are \(2^n\) become infeasible quickly—the table comparison makes this visceral. Logs convert multiply-growth into additive time equations.
Theory
Exponential functions
For base \(b>0\), \(b\neq 1\): \[f(x)=b^{x}.\]
- Domain \(\mathbb{R}\) (for real teaching; constructive details aside).
- Range \((0,\infty)\).
- If \(b>1\): increasing (growth). If \(0<b<1\): decreasing (decay).
- \(b^{0}=1\); \(b^{1}=b\); \(b^{-x}=1/b^{x}\).
General model: \[A(t)=A_0\, r^{t}\] or \(A(t)=A_0 e^{kt}\) with \(k=\ln r\) when using continuous base \(e\).
Often \(r=1+i\) for growth rate \(i\), or \(r=1-\delta\) for decay.
Doubling time
If \(A(t)=A_0\cdot 2^{t/T_d}\), then \(T_d\) is the doubling period.
If \(A(t)=A_0 b^{t}\) with \(b>1\), solve \(b^{T}=2\): \(T=\log_b 2=\dfrac{\ln 2}{\ln b}\).
Half-life
If \(A(t)=A_0\cdot (1/2)^{t/T_h}\), then \(T_h\) is half-life.
For \(A(t)=A_0 e^{-kt}\) (\(k>0\)), \(T_h=\dfrac{\ln 2}{k}\).
Linear vs exponential tables
| \(t\) | Linear \(2t+1\) | Exp \(2^{t}\) |
|---|---|---|
| 0 | 1 | 1 |
| 1 | 3 | 2 |
| 2 | 5 | 4 |
| 3 | 7 | 8 |
| 4 | 9 | 16 |
| 5 | 11 | 32 |
Linear: constant additive change. Exponential: constant multiplicative factor.
Rule of thumb: any exponential with base \(>1\) eventually dominates any polynomial (Stage VIII makes precise).
Compound interest
Principal \(P\), annual rate \(r\) (decimal), compounded \(n\) times per year for \(t\) years: \[A=P\biggl(1+\frac{r}{n}\biggr)^{nt}.\]
Continuous compounding: \(A=Pe^{rt}\).
Effective annual rate: \(\bigl(1+\frac{r}{n}\bigr)^{n}-1\).
Logs invert exponentials
\[y=b^{x}\quad\Leftrightarrow\quad x=\log_b y.\]
Solve \(A_0 r^{t}=A\) by \(t=\log_r(A/A_0)=\dfrac{\ln(A/A_0)}{\ln r}\).
Exponential equations (review+)
Same base: \(b^{f(x)}=b^{g(x)}\Rightarrow f(x)=g(x)\).
Different bases: take log, or rewrite with prime bases.
Exponent laws (active recall)
For \(b>0\), \(b\neq 1\) and real exponents as taught: \[ b^{x+y}=b^x b^y,\quad b^{xy}=(b^x)^y,\quad (ab)^x=a^x b^x,\quad b^{-x}=\frac{1}{b^x}. \] Logs invert: \(\log_b(xy)=\log_b x+\log_b y\), \(\log_b(x^r)=r\log_b x\), change of base \(\log_b x=\frac{\ln x}{\ln b}\).
Why exponential beats polynomial (sketch)
Fix \(r>1\) and degree \(d\). Ratios \(\frac{r^{n+1}/(n+1)^d}{r^n/n^d}=r\bigl(\frac{n}{n+1}\bigr)^d\to r>1\), so eventually the sequence \(r^n/n^d\) increases and \(\to\infty\). Thus \(r^n\) grows faster than \(n^d\). (Stage VIII: Big-O formalizes this.)
Compound frequency comparison
For fixed \(P,r,t>0\), the function \(n\mapsto P\bigl(1+\frac{r}{n}\bigr)^{nt}\) increases with \(n\) toward \(Pe^{rt}\). More frequent compounding → slightly more money, with continuous as the upper envelope.
Worked examples
Example 1 — Evaluate
\(3^{4}=81\), \(2^{-3}=\frac{1}{8}\), \((\frac{1}{2})^{3}=\frac{1}{8}\).
Example 2 — Growth model
Bacteria \(A_0=500\), double every \(3\) hours: \(A(t)=500\cdot 2^{t/3}\). At \(t=9\): \(500\cdot 2^{3}=4000\).
Example 3 — Doubling time
\(A=100\cdot (1.05)^{t}\). Doubling: \(1.05^{T}=2\), \(T=\frac{\ln 2}{\ln 1.05}\approx\frac{0.693}{0.0488}\approx 14.2\) years.
Example 4 — Half-life
Isotope half-life \(8\) days, \(A_0=40\) g: \(A(t)=40\cdot(\frac{1}{2})^{t/8}\). After \(24\) days: \(40\cdot\frac{1}{8}=5\) g.
Example 5 — Compound interest
\(P=1000\), \(r=0.06\), \(n=12\), \(t=2\): \(A=1000(1.005)^{24}\approx 1127.49\).
Example 6 — Continuous
\(1000 e^{0.06\cdot 2}=1000 e^{0.12}\approx 1127.5\) (similar).
Example 7 — Solve for time
\(500\cdot 1.03^{t}=800\). \(1.03^{t}=1.6\). \(t=\frac{\ln 1.6}{\ln 1.03}\approx 15.9\).
Example 8 — Linear vs exp
After \(10\) steps: linear \(2\cdot 10+1=21\) vs \(2^{10}=1024\).
Example 9 — Decay factor
Lose \(20\%\) per year: multiply by \(0.8\) each year. After \(5\) years: \(A_0(0.8)^{5}\).
Example 10 — Log inverse
\(f(x)=2^{x}\), \(f^{-1}(x)=\log_2 x\). Compose: \(2^{\log_2 9}=9\).
Example 11 — Effective rate
\(r=12\%\) compounded monthly: \((1.01)^{12}-1\approx 0.1268=12.68\%\) effective.
Example 12 — Equation
\(4^{x}=8^{x-1}\Rightarrow (2^2)^{x}=(2^3)^{x-1}\Rightarrow 2x=3x-3\Rightarrow x=3\).
Example 13 — Table second look
Exponential \(3^{t}\): ratios \(\frac{A(t+1)}{A(t)}=3\) constant.
Example 14 — Bits growth
Address space \(2^{n}\) grows by factor \(2\) when \(n\) increases by \(1\)—exponential in bit width.
Example 15 — Substitution exponential equation
\(2^{2x}-2^{x}-6=0\). Set \(u=2^{x}>0\): \(u^2-u-6=0\), \((u-3)(u+2)=0\), \(u=3\) (reject \(-2\)). \(2^{x}=3\), \(x=\log_2 3\).
Example 16 — Rule of 72
At \(r=0.06\), rule of 72 gives \(72/6=12\) years; exact \(T=\ln 2/\ln 1.06\approx 11.9\). Good approximation.
Example 17 — Half-life to continuous \(k\)
\(T_h=8\) days: \(e^{-k\cdot 8}=\frac12\), \(k=\frac{\ln 2}{8}\). Then \(A(t)=A_0 e^{-(\ln 2)t/8}\).
Example 18 — Comparing early table values
\(100n\) vs \(2^n\): at \(n=1..9\), linear can win; at \(n=10\), \(1000\) vs \(1024\)—already close; \(n=20\): \(2000\) vs \(>10^6\). Never trust small-\(n\) tables alone for asymptotics.
Example 19 — Password entropy
Charset size \(62\), length \(8\): \(62^8\) possibilities; bits \(\log_2(62^8)=8\log_2 62\approx 8\cdot 5.95=47.6\) bits. Each extra character adds \(\log_2 62\) bits.
Example 20 — Same growth two writings
\(A=100\cdot 4^{t}=100\cdot (2^2)^{t}=100\cdot 2^{2t}=100\cdot e^{t\ln 4}\). Discrete base \(4\) per unit time equals continuous \(k=\ln 4\).
Exercises
Easy
- Evaluate \(5^{3}\), \(10^{-2}\), \((\frac{2}{3})^{2}\).
- \(A(t)=20\cdot 2^{t}\): find \(A(0)\), \(A(3)\).
- Write a model: starts at \(100\), triples every period \(t\) in periods.
- Half-life \(10\) h, start \(80\) mg: amount after \(30\) h.
- Solve \(2^{x}=32\).
Medium
- Doubling time for \(6\%\) annual growth (annual compound once): \(1.06^{T}=2\).
- \(P=2000\), \(r=4\%\), compounded quarterly, \(t=5\) years: write expression for \(A\) (compute if desired).
- Compare after \(t=8\): \(10+3t\) vs \(10\cdot (1.2)^{t}\) qualitatively which larger.
- Solve \(300 e^{0.02 t}=900\) for \(t\).
- If half-life is \(T_h\), show \(A(2T_h)=A_0/4\).
- Effective annual rate for \(r=0.05\) compounded monthly.
- Rewrite \(A=50\cdot 4^{t}\) as \(A=50\cdot 2^{?}\).
- Decay \(15\%\) per step for \(6\) steps: overall factor.
Hard
- Prove that \(f(x)=b^{x}\) for \(b>1\) is injective; conclude logs well-defined.
- Derive doubling time formula \(T=\ln 2/\ln b\) for \(A_0 b^{t}\).
- Show continuous model \(Pe^{rt}\) is limit idea of \((1+\frac{r}{n})^{n}\to e^{r}\) (state without full limit proof).
- Solve \(2^{2x}-2^{x}-6=0\) with \(u=2^{x}\).
- Compare polynomial \(n^{5}\) and exponential \(1.1^{n}\) for \(n=10,50,100\) with a calculator after estimating by hand which wins eventually.
- If \(A(t)=A_0 e^{kt}\) and \(A(3)=2A_0\), find \(k\) and half-life/doubling.
- Prove \((b^{x})(b^{y})=b^{x+y}\) using exponent laws (Day 8 link).
Challenge / CS-flavored
- Password entropy: space size \(N\), “bits” \(\log_2 N\). If \(N\) multiplies by \(64\), bits increase by \(?\)
- Algorithm A: \(1000n\) ops; B: \(2^{n}\). For which \(n\) is B already larger? (try small \(n\) table)
- Cache: miss penalty multiplies latency by \(100\) each level of memory—exponential cost stack idea.
- Version growth: semantic version major bumps as rare exponential compatibility breaks—metaphor only.
- Solve for bits \(n\) in \(2^{n}\ge 10^{12}\).
Continuous growth rate
If \(A=A_0 e^{kt}\), the instantaneous relative growth rate is \(k\) (calculus interpretation later).
For discrete \(A_{n+1}=(1+i)A_n\), relative growth per step is \(i\).
Log scales
Plotting \(y\) on a log scale linearizes pure exponential data: \(\log A(t)=\log A_0 + t\log r\). Slope estimates \(\log r\).
Comparing models
Given data table, look at first differences (linear?) vs ratios \(A_{t+1}/A_t\) (exponential?). Mixed models exist (affine \(A+b\) then exp)—out of scope.
Rule of \(72\) (finance heuristic)
Doubling time years \(\approx 72/(\text{percent rate})\) for modest rates—approximation to \(\ln 2/\ln(1+r)\approx 0.69/r\).
Extra exercises
- Derive \(T_{1/2}=\ln 2/k\) from \(A_0 e^{-kt}\).
- \(P=5000\) at \(3\%\) continuous for \(10\) years: write \(A\).
- Solve \(4\cdot 3^{x}=36\).
- If compute capacity doubles every \(18\) months, factor over \(6\) years.
- Show \(b^{x}=e^{x\ln b}\) for \(b>0\) (definition bridge).
CS connection
Exponential time algorithms, cryptographic key space \(2^{n}\), compound metrics, and exponential backoff (\(2^{k}\) wait) are daily CS. Logs turn growth into linear equations for “how long until.” Always distinguish \(2^{n}\) from \(n^{2}\).
Common pitfalls
| Pitfall | What to do instead |
|---|---|
| \((1+r)^{t}\) vs \(1+rt\) | Compound vs simple interest |
| Half-life as subtract half once | Multiplicative \((\frac12)^{t/T}\) each period |
| Logs of growth without dividing by \(A_0\) | \(t=\log(A/A_0)/\log r\) |
| Base \(b=1\) as exponential interest | Degenerate constant |
| Confusing percent and growth factor | \(+5\%\) means \(\times 1.05\) |
| Claiming linear eventually beats exp | Opposite for base \(>1\) |
Fully worked extra examples
E15 — Same-base rewrite.
\((\frac{1}{8})^{x}=2^{x+3}\). Left \((2^{-3})^{x}=2^{-3x}\). So \(-3x=x+3\), \(-4x=3\), \(x=-\frac34\).
E16 — Continuous vs annual.
\(P=1000\), \(r=0.05\), \(t=10\): annual \(1000(1.05)^{10}\); continuous \(1000 e^{0.5}\). Continuous is slightly larger—limit of compounding frequency.
E17 — Half-life chain.
From \(A=A_0(\frac12)^{t/T}\), take log: \(\ln(A/A_0)=-\frac{t}{T}\ln 2\), so \(t=T\frac{\ln(A_0/A)}{\ln 2}\).
E18 — Linear never catches pure exp eventually.
\(1000n\) vs \(2^{n}\): at \(n=20\), \(20000\) vs about \(1\) million. At \(n=10\), \(10000\) vs \(1024\)—linear still larger; crossover later. Always check large \(n\) for exp base \(>1\).
E19 — Compound factor table.
\((1.01)^{12}\approx 1.1268\) (monthly \(12\%\) APR). \((1.12)^{1}=1.12\) simple annual. Difference is compound effect within the year.
End-of-day synthesis problems
S1. Model: start \(200\), grow \(8\%\) per period. Write \(A(t)\); find \(t\) with \(A(t)=500\) in log form.
S2. Half-life \(6\) h, \(A_0=64\): amount at \(t=0,6,12,18,24\).
S3. Compound: \(P=1500\), \(r=0.05\), \(n=4\), \(t=3\) — expression for \(A\).
S4. Table compare \(5+2t\) vs \(5\cdot 2^{t}\) for \(t=0..6\); when does exp overtake?
S5. Solve \(9^{x}=27^{x/2+1}\).
S6. Doubling time for continuous rate \(k=0.07\): \(T=\ln 2/k\).
S7. Effective annual rate for \(12\%\) compounded monthly.
S8. Bits: if key space multiplies by \(2^{10}\), how many bits of security added?
Deep dive — Discrete vs continuous growth
| Discrete | Continuous |
|---|---|
| \(A_{t+1}=r A_t\) | \(A'(t)=k A(t)\) (calculus) |
| \(A(t)=A_0 r^{t}\) | \(A(t)=A_0 e^{kt}\) |
| \(r=e^{k}\) bridge | \(k=\ln r\) |
| Compound \(n\) times/year | \(n\to\infty\) limit \(e^{rt}\) |
Solving for time always uses a log: the log is the inverse “how many multiplications.” In CS, exponential backoff, geometric sequences of array capacity (2^k growth), and \(O(2^n)\) algorithms are the same multiplicative structure.
Synthesis
Exponential models multiply by a constant each period. Doubling time and half-life are special level-crossing times solved with logs. Compound interest is discrete exponential; continuous compounding is the \(e^{rt}\) limit. Linear vs exponential tables teach humility about long horizons. Logs undo exponentials—always isolate the exponential first.
S9. Solve \(2^{2x}-5\cdot 2^{x}+4=0\) via \(u=2^{x}\).
S10. Population \(A_0=1000\) grows \(2\%\) per year: years until \(2500\) (log form + approximate).
S11. Show that if capacity doubles every \(18\) months, then in \(6\) years it multiplies by \(2^{4}=16\).
S12. Prove injectivity of \(b^{x}\) for \(b>1\) using: if \(b^{x}=b^{y}\) then \(b^{x-y}=1\) and \(x-y=0\).
Checkpoint
- Write \(A_0 r^{t}\) models for growth/decay
- Compute doubling time / half-life setups
- Contrast linear vs exponential tables
- Apply compound interest formula
- Solve for time using logarithms
- S1 and S4 qualitative mastery
Write two takeaways in your own words.
Quick reference card
| Model | Formula |
|---|---|
| Discrete growth | \(A_0 r^{t}\) |
| Doubling period | \(T=\log_r 2\) |
| Half-life model | \(A_0(1/2)^{t/T_h}\) |
| Compound interest | \(P(1+r/n)^{nt}\) |
| Continuous | \(Pe^{rt}\) |
| Solve for time | \(t=\log_r(A/A_0)\) |
| Log inverse | \(y=b^{x}\Leftrightarrow x=\log_b y\) |
Exp eventually beats linear when base \(>1\); tables can mislead early.
Tomorrow
Day 21 — Summation notation. \(\sum\) notation, index shifts, linearity, closed forms for \(\sum i\), \(\sum i^2\), geometric sums, telescoping, double sums, nested-loop connection.