Foundations to Frontier
Tests
A. Mathematical Foundations › A3 Calculus and Analysis › Single-variable calculus

Sequences and Series, Convergence Tests

Adding infinitely many numbers can give a finite answer, or not. Convergence tests decide which. Series give the value of a discounted reward, the inverse of a matrix, the step-size rules that make stochastic gradient descent converge, and even π.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Adding forever

Add 12+14+18+⋯\tfrac12 + \tfrac14 + \tfrac18 + \cdots and the total creeps up to 1 but never passes it. That endless sum is a series, and its value is 1.

Now try 1+12+13+14+⋯1 + \tfrac12 + \tfrac13 + \tfrac14 + \cdots. The pieces also shrink, yet this total grows forever, just very slowly: you need over 10⁴³ terms to pass 100. Shrinking pieces aren’t enough. They must shrink fast enough.

A fun fact: if you stack identical books so each sticks out beyond the one below by 12,14,16,…\tfrac12, \tfrac14, \tfrac16, \ldots of a book length, the top book can overhang the table by as much as you like. That’s the harmonic series at work.

Partial sums: does the running total settle?
S_20 = 1.999998 · limit 2.000000, gap 1.91e-6 · ratio |a₍N₊₁₎/a_N| = 0.5000
Bars = running totals S₁ … S_N; dashed green = the sum, if it exists. Converges to 1/(1 − r) exactly when |r| < 1.
Why engineers care

A robot that collects a reward every second, with each future reward counted a little less (say 99%), has a total value given by a geometric series. A spacecraft’s trajectory computer approximates sin, cos and exp with series too. Knowing when a series settles, and how fast, is basic engineering.

📝 Quick check (Level 0)
0/3 answered
  1. 1. ½ + ¼ + ⅛ + ¹⁄₁₆ (just four terms) = ?
  2. 2. Does 1 + ½ + ⅓ + ¼ + … stay below 100 forever?
  3. 3. 0.999… (repeating forever) equals…

Level 1: Beginner

★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.

Sequences and series

A sequence a1,a2,…a_1, a_2, \ldots converges to LL if its terms get arbitrarily close to LL (A3.1-1). A series ∑an\sum a_n is the sequence of partial sums SN=a1+⋯+aNS_N = a_1 + \cdots + a_N. It converges if SNS_N does.

The geometric series

∑n=0∞rn=11−r(∣r∣<1)\sum_{n=0}^\infty r^n = \frac1{1-r} \quad (\lvert r\rvert<1)

Why: SN−rSN=1−rN+1S_N - rS_N = 1 - r^{N+1}, so SN=1−rN+11−r→11−rS_N = \frac{1-r^{N+1}}{1-r}\to\frac1{1-r}. For ∣r∣≥1\lvert r\rvert\ge1, it diverges.

So ∑n≥0(1/3)n=1.5\sum_{n\ge0}(1/3)^n = 1.5 and 0.999…=0.91−0.1=10.999\ldots = \frac{0.9}{1-0.1} = 1.

The harmonic series and p-series

∑1n\sum\frac1n diverges, but ∑1np\sum\frac1{n^p} converges for every p>1p>1. This matches the integral p-test (A3.1-8).

📝 Quick check (Level 1)
0/3 answered
  1. 1. Σ_{n≥0} (1/3)ⁿ = ?
  2. 2. Does Σ 1/n converge?
  3. 3. The sequence (n + 1)/n converges to…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.

The toolbox of tests

Test Statement Example
divergence (n-th term) an↛0⇒a_n\not\to0\Rightarrow diverges Grandi’s series 1−1+1−⋯1 - 1 + 1 - \cdots
comparison 0≤an≤bn0\le a_n\le b_n, ∑bn<∞⇒∑an<∞\sum b_n<\infty\Rightarrow\sum a_n<\infty ∑1n2+n\sum\frac1{n^2+n}
integral ∑f(n)\sum f(n) and ∫∞f\int^\infty f converge together (ff decreasing) p-series
ratio L=lim⁡∣an+1/an∣L = \lim\lvert a_{n+1}/a_n\rvert: L<1L<1 converges, L>1L>1 diverges ∑3nn!\sum\frac{3^n}{n!} (L=0L = 0)
root L=lim⁡∣an∣1/nL = \lim\lvert a_n\rvert^{1/n}, same verdicts ∑(n2n+1)n\sum\big(\frac n{2n+1}\big)^n
alternating (Leibniz) bn↓0⇒∑(−1)nbnb_n\downarrow0\Rightarrow\sum(-1)^nb_n converges, with error ≤bN+1\le b_{N+1} 1−12+13−⋯=ln⁡21 - \frac12 + \frac13 - \cdots = \ln2

For ∑1/n2\sum1/n^2, the ratio test gives L=1L = 1, so it is undecided. The integral test settles it.

Famous sums

Series Sum
∑n≥11n2\sum_{n\ge1}\frac1{n^2} π26\frac{\pi^2}6 (Basel problem; Euler, 1734)
∑n≥1(−1)n+1n\sum_{n\ge1}\frac{(-1)^{n+1}}n ln⁡2\ln2
∑n≥0(−1)n2n+1\sum_{n\ge0}\frac{(-1)^n}{2n+1} π4\frac\pi4 (Madhava–Leibniz)
∑n≥01n!\sum_{n\ge0}\frac1{n!} ee
∑n≥1n2n\sum_{n\ge1}\frac n{2^n} 2
∑n≥11n(n+1)\sum_{n\ge1}\frac1{n(n+1)} 1 (telescoping)
🐍 Exercise 1: partial sums and the ratio test
Compute partial sums. Watch the Basel sum's gap shrink like 1/N, the harmonic sum track ln N + γ, and the alternating sum respect its error bound. Compute the ratio-test limit too.
📝 Quick check (Level 2)
0/3 answered
  1. 1. Σ 1/n² = ?
  2. 2. The ratio test on Σ 1/n² gives…
  3. 3. After 9 terms of 1 − ½ + ⅓ − …, the error is at most…

Level 3: Advanced

★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.

Key proofs

Harmonic divergence (Oresme, c. 1350). Group the terms: 1+12+(13+14)+(15+⋯+18)+⋯≥1+12+12+12+⋯1 + \tfrac12 + (\tfrac13 + \tfrac14) + (\tfrac15 + \cdots + \tfrac18) + \cdots\ge1 + \tfrac12 + \tfrac12 + \tfrac12 + \cdots. ∎

Integral test. For decreasing f≥0f\ge0, ∫1N+1f≤∑n=1Nf(n)≤f(1)+∫1Nf\int_1^{N+1}f\le\sum_{n=1}^Nf(n)\le f(1) + \int_1^Nf. Compare the rectangles with the area under the curve. So both converge or both diverge, and the gap estimates the tail (Practice Code 2).

Ratio test. If ∣an+1/an∣≤q<1\lvert a_{n+1}/a_n\rvert\le q<1 for n≥Nn\ge N, then ∣an∣≤∣aN∣qn−N\lvert a_n\rvert\le\lvert a_N\rvert q^{n-N}, which is dominated by a geometric series. ∎

Alternating series. The even partial sums increase, the odd ones decrease, and they squeeze together because bn→0b_n\to0. The limit always lies between consecutive partial sums, so the error is ≤bN+1\le b_{N+1}. ∎

Absolute vs conditional convergence, and Riemann’s rearrangement theorem

If ∑∣an∣\sum\lvert a_n\rvert converges, every rearrangement has the same sum. But a conditionally convergent series can be rearranged to converge to any real number, or to diverge (Riemann, 1854). Taking 2 positive terms of 1−12+13−⋯1 - \tfrac12 + \tfrac13 - \cdots for each negative one gives 32ln⁡2\tfrac32\ln2 instead of ln⁡2\ln2 (Practice Code 4). With infinite sums, order can matter.

Exercise 3.1: Show Σ 1/(n(n+1)) = 1

1n(n+1)=1n−1n+1\frac1{n(n+1)} = \frac1n - \frac1{n+1}, so SN=1−1N+1→1S_N = 1 - \frac1{N+1}\to1. The middle terms cancel (“telescoping”).

📝 Quick check (Level 3)
0/3 answered
  1. 1. Does Σ 1/(n ln n) (n ≥ 2) converge?
  2. 2. Rearranging an absolutely convergent series…
  3. 3. Σ 1/n^p converges exactly when…

Level 4: Expert

★★★★★ Expert⏱ 40 minResearchers: original papers and open problems.

The matrix geometric series

For a matrix with spectral radius ρ(A)<1\rho(A)<1:

(I−A)−1=I+A+A2+⋯(I - A)^{-1} = I + A + A^2 + \cdots

This is the Neumann series. It explains why Jacobi and Gauss–Seidel iterations converge (at rate ρ\rho). It also gives PageRank, (1−d)∑dkPk(1-d)\sum d^kP^k, and the Leontief model in economics. In reinforcement learning, the policy-evaluation equation V=R+γPVV = R + \gamma PV solves to V=∑kγkPkRV = \sum_k\gamma^kP^kR.

🐍 Exercise 2 (research): the Neumann series as a linear solver
Solve (I − A)x = b by summing Aᵏb. Measure the convergence rate (it should equal ρ(A) = 0.6), and watch it blow up when ρ(A) = 1.2.

Series that decide whether learning works

  • Discounted returns. G=∑tγtrt≤rmax⁡1−γG = \sum_t\gamma^tr_t\le\frac{r_{\max}}{1-\gamma}. For γ=0.99\gamma = 0.99, the effective horizon is about 100 steps. This bound is behind every convergence proof for value iteration (Bellman, 1957; Sutton and Barto, 2018).
  • Robbins–Monro step sizes. Stochastic approximation converges if ∑ηt=∞\sum\eta_t = \infty (you can travel any distance) and ∑ηt2<∞\sum\eta_t^2<\infty (the noise eventually averages out) (Robbins and Monro, 1951). So ηt=1/t\eta_t = 1/t works, a constant η\eta keeps jittering, and 1/t21/t^2 stops too early (Practice Code 5). These conditions underlie SGD theory and Q-learning convergence (Watkins and Dayan, 1992).
  • Convergence acceleration. Richardson extrapolation, Aitken’s Δ2\Delta^2 and Euler–Maclaurin tail estimates (Practice Code 2) speed up slow series. The same ideas appear in Nesterov momentum and Anderson acceleration for fixed-point solvers.

References

  1. N. Oresme (c. 1350). Quaestiones super geometriam Euclidis. (Divergence of the harmonic series.)
  2. L. Euler (1734/35). “De summis serierum reciprocarum.” (The Basel problem.)
  3. A.-L. Cauchy (1821). Cours d’analyse. (Convergence tests.)
  4. B. Riemann (1854/1868). “Über die Darstellbarkeit einer Function durch eine trigonometrische Reihe.” (The rearrangement theorem.)
  5. H. Robbins, S. Monro (1951). “A stochastic approximation method.” Annals of Mathematical Statistics, 22(3).
  6. C. Watkins, P. Dayan (1992). “Q-learning.” Machine Learning, 8.
  7. R. Sutton, A. Barto (2018). Reinforcement Learning: An Introduction, 2nd ed. MIT Press.
  8. K. Knopp (1990). Theory and Application of Infinite Series. Dover.