TExcelTAD
Home › Calculus in Depth › Sequences

Sequences

A sequence is an infinite list a1,a2,a3,…a_1, a_2, a_3, \ldots and the central question is whether it settles down to a limit. This lesson gives the precise ε\varepsilon–NN definition, the rules that let you compute limits without it, and the Monotone Convergence Theorem with its proof, which is the tool for sequences defined by a recursion, the way most algorithms produce them.

The survey lesson Sequences covers notation and first examples; here we go into the proofs.

The precise definition

Formally, a sequence is a function a:N→Ra: \mathbb{N} \to \mathbb{R}, written {an}\{a_n\}. We say ana_n converges to LL, lim⁡n→∞an=L\lim_{n \to \infty} a_n = L, if

for every ε>0 there is an N such that n>N  ⇒  ∣an−L∣<ε\text{for every } \varepsilon > 0 \text{ there is an } N \text{ such that } \quad n > N \;\Rightarrow\; \lvert a_n - L \rvert < \varepsilon

Read it as a game: you name a tolerance ε\varepsilon, I must produce a point NN after which every term stays within ε\varepsilon of LL. If no such LL exists the sequence diverges; lim⁡an=∞\lim a_n = \infty means for every MM there is an NN with an>Ma_n > M for n>Nn > N.

Example. Prove an=3n+1n+2→3a_n = \frac{3n + 1}{n + 2} \to 3. We need ∣an−3∣=∣3n+1−3n−6n+2∣=5n+2<ε\lvert a_n - 3 \rvert = \left\lvert \frac{3n + 1 - 3n - 6}{n + 2} \right\rvert = \frac{5}{n + 2} < \varepsilon, which holds whenever n>5/ε−2n > 5/\varepsilon - 2. So N=5/εN = 5/\varepsilon works. The proof is literally an algorithm that turns ε\varepsilon into NN:

python · try it yourself
from fractions import Fraction
import math

def a(n):
    return Fraction(3*n + 1, n + 2)

for eps in [Fraction(1, 10), Fraction(1, 1000), Fraction(1, 10**6)]:
    N = math.ceil(5 / eps - 2)
    worst = max(abs(a(n) - 3) for n in range(N + 1, N + 200))
    print(f"ε = {str(eps):9s} N = {N:8d}   max |aₙ − 3| after N: {float(worst):.3e} < ε: {worst < eps}")
ε = 1/10      N =       48   max |aₙ − 3| after N: 9.804e-02 < ε: True
ε = 1/1000    N =     4998   max |aₙ − 3| after N: 9.998e-04 < ε: True
ε = 1/1000000 N =  4999998   max |aₙ − 3| after N: 1.000e-06 < ε: True

Checking 200 terms is not a proof, of course; the inequality 5n+2<ε\frac{5}{n + 2} < \varepsilon for all n>Nn > N is. Since 5n+2\frac{5}{n + 2} is decreasing, the first term after NN is the worst one, which is why the maximum sits just under ε\varepsilon.

Rules that save you the ε\varepsilon work

Result Statement
Functions If lim⁡x→∞f(x)=L\lim_{x \to \infty} f(x) = L and an=f(n)a_n = f(n), then an→La_n \to L (so l'Hospital's rule applies to ff)
Limit laws sums, products, constant multiples and quotients (non-zero limit) of convergent sequences converge to the obvious limit
Squeeze an≤bn≤cna_n \le b_n \le c_n for n≥n0n \ge n_0 and an,cn→L⇒bn→La_n, c_n \to L \Rightarrow b_n \to L
Absolute value ∣an∣→0⇒an→0\lvert a_n \rvert \to 0 \Rightarrow a_n \to 0
Continuity an→La_n \to L and ff continuous at LL ⇒f(an)→f(L)\Rightarrow f(a_n) \to f(L)
Geometric rn→0r^n \to 0 if ∣r∣<1\lvert r \rvert < 1, rn→1r^n \to 1 if r=1r = 1; diverges otherwise

The converse of the first row fails: sin⁡(πn)=0\sin(\pi n) = 0 for every integer nn, so the sequence converges, but sin⁡(πx)\sin(\pi x) has no limit.

Proof that convergent sequences are bounded. Take ε=1\varepsilon = 1: for n>Nn > N, ∣an∣<∣L∣+1\lvert a_n \rvert < \lvert L \rvert + 1. The finitely many terms a1…aNa_1 \ldots a_N have a maximum absolute value, so ∣an∣≤max⁡(∣a1∣,…,∣aN∣,∣L∣+1)\lvert a_n \rvert \le \max(\lvert a_1 \rvert, \ldots, \lvert a_N \rvert, \lvert L \rvert + 1) for all nn. ∎ Boundedness is necessary but not sufficient: (−1)n(-1)^n is bounded and diverges.

Example with the squeeze theorem. For an=n!/nna_n = n!/n^n write

0<n!nn=1n⋅2n⋅3n⋯nn≤1n0 < \frac{n!}{n^n} = \frac{1}{n} \cdot \frac{2}{n} \cdot \frac{3}{n} \cdots \frac{n}{n} \le \frac{1}{n}

because every factor after the first is at most 1. Since 1/n→01/n \to 0, n!/nn→0n!/n^n \to 0.

Monotone sequences

A sequence is increasing if an<an+1a_n < a_{n+1} for all nn (non-decreasing with ≤\le), decreasing similarly, and monotonic if it is one of these. It is bounded above if an≤Ma_n \le M for all nn.

Monotone Convergence Theorem. Every bounded, monotonic sequence converges.

Proof (increasing case). The set {an}\{a_n\} is non-empty and bounded above, so by the completeness axiom of R\mathbb{R} it has a least upper bound LL. Given ε>0\varepsilon > 0, L−εL - \varepsilon is not an upper bound, so aN>L−εa_N > L - \varepsilon for some NN. For n>Nn > N, monotonicity gives aN≤an≤La_N \le a_n \le L, hence L−ε<an≤LL - \varepsilon < a_n \le L and ∣an−L∣<ε\lvert a_n - L \rvert < \varepsilon. ∎

Completeness is essential: in the rationals, the increasing bounded sequence 1,1.4,1.41,1.414,…1, 1.4, 1.41, 1.414, \ldots has no limit, because 2\sqrt{2} is missing.

Recursive sequences

Take a1=1a_1 = 1, an+1=2+ana_{n+1} = \sqrt{2 + a_n}. To use the theorem, prove two things by induction:

Bounded:a1=1<2, and if an<2 then an+1=2+an<4=2Increasing:a2=3>a1, and if an+1>an then an+2=2+an+1>2+an=an+1\begin{aligned} &\text{Bounded:} && a_1 = 1 < 2, \text{ and if } a_n < 2 \text{ then } a_{n+1} = \sqrt{2 + a_n} < \sqrt{4} = 2 \\ &\text{Increasing:} && a_2 = \sqrt{3} > a_1, \text{ and if } a_{n+1} > a_n \text{ then } a_{n+2} = \sqrt{2 + a_{n+1}} > \sqrt{2 + a_n} = a_{n+1} \end{aligned}

So L=lim⁡anL = \lim a_n exists. Pass to the limit in the recursion (⋅\sqrt{\cdot} is continuous): L=2+LL = \sqrt{2 + L}, L2−L−2=0L^2 - L - 2 = 0, L=2L = 2 (the root −1-1 is ruled out because an>0a_n > 0). Notice the order: you may only solve L=2+LL = \sqrt{2 + L} after knowing that the limit exists. The recursion an+1=2ana_{n+1} = 2a_n has "fixed point" L=0L = 0 but diverges from a1=1a_1 = 1.

python · try it yourself
import math

a = 1.0
for n in range(1, 13):
    if n in (1, 2, 3, 4, 6, 8, 12):
        print(f"a_{n:<2d} = {a:.12f}   error {2 - a:.2e}")
    a = math.sqrt(2 + a)

# Newton's iteration for √2 converges much faster (quadratically)
x = 1.0
for k in range(1, 6):
    x = (x + 2 / x) / 2
    print(f"Newton step {k}: {x:.15f}  error {abs(x - math.sqrt(2)):.1e}")
a_1  = 1.000000000000   error 1.00e+00
a_2  = 1.732050807569   error 2.68e-01
a_3  = 1.931851652578   error 6.81e-02
a_4  = 1.982889722748   error 1.71e-02
a_6  = 1.998929174953   error 1.07e-03
a_8  = 1.999933067835   error 6.69e-05
a_12 = 1.999999738545   error 2.61e-07
Newton step 1: 1.500000000000000  error 8.6e-02
Newton step 2: 1.416666666666667  error 2.5e-03
Newton step 3: 1.414215686274510  error 2.1e-06
Newton step 4: 1.414213562374690  error 1.6e-12
Newton step 5: 1.414213562373095  error 2.2e-16

The first error shrinks by a factor of about 4 per step (linear convergence: f(x)=2+xf(x) = \sqrt{2 + x} has f′(2)=1/4f'(2) = 1/4, and errors scale by ∣f′(L)∣\lvert f'(L) \rvert). Newton's error roughly squares at each step (quadratic convergence) until it hits the floating-point floor of about 2.2×10−162.2 \times 10^{-16}.

In software

  • Iterative algorithms are sequences: Newton's method, gradient descent, PageRank's power iteration and value iteration in reinforcement learning all produce xn+1=F(xn)x_{n+1} = F(x_n). Proving that loop terminates is proving the sequence converges, often with a monotone-and-bounded or a contraction argument.
  • Stopping criteria like abs(x_new - x) < tol are a practical stand-in for the ε\varepsilon–NN definition, and the convergence rate (linear vs quadratic) tells you how many iterations a tolerance costs.
  • Training curves: a loss that decreases and is bounded below by 0 must converge (Monotone Convergence Theorem), but possibly to a value that is not the minimum; see gradient descent.

Exercises

Exercise 1: Compute limits

Find the limits: a) 2n2−n5n2+3\frac{2n^2 - n}{5n^2 + 3}, b) n1/nn^{1/n}, c) cos⁡(n)n\frac{\cos(n)}{n}.

Answer

a) 2/52/5, b) 1, c) 0.

Solution
a) divide by n2:2−1/n5+3/n2→25b) ln⁡(n1/n)=ln⁡nn→0 (l’Hospital on ln⁡x/x), so n1/n→e0=1 by continuity of exp⁡c) −1n≤cos⁡(n)n≤1n and both bounds→0 (squeeze)\begin{aligned} &\text{a) divide by } n^2{:} \quad \frac{2 - 1/n}{5 + 3/n^2} \to \frac{2}{5} \\ &\text{b) } \ln(n^{1/n}) = \frac{\ln n}{n} \to 0 \text{ (l'Hospital on } \ln x / x\text{), so } n^{1/n} \to e^0 = 1 \text{ by continuity of } \exp \\ &\text{c) } -\frac{1}{n} \le \frac{\cos(n)}{n} \le \frac{1}{n} \text{ and both bounds} \to 0 \text{ (squeeze)} \end{aligned}

Exercise 2: Find N

For an=1n2+1a_n = \frac{1}{n^2 + 1}, find an NN that works for ε=0.0001\varepsilon = 0.0001 in the definition of an→0a_n \to 0.

Answer

N=100N = 100 (any n>100n > 100 gives an<0.0001a_n < 0.0001).

Solution
1n2+1<10−4  ⟺  n2+1>104  ⟺  n2>9999  ⇐  n>100\frac{1}{n^2 + 1} < 10^{-4} \iff n^2 + 1 > 10^4 \iff n^2 > 9999 \;\Leftarrow\; n > 100

N=99N = 99 also works (n≥100n \ge 100 gives n2+1=10001>104n^2 + 1 = 10001 > 10^4); any valid NN is fine.

Exercise 3: A recursive limit

Let a1=2a_1 = 2 and an+1=an+62a_{n+1} = \frac{a_n + 6}{2}. Prove the sequence converges and find its limit.

Answer

It increases, is bounded above by 6, and converges to 6.

Solution
Bounded:a1=2<6, and an<6⇒an+1<6+62=6Increasing:an+1−an=6−an2>0 because an<6Limit:L=L+62⇒L=6\begin{aligned} &\text{Bounded:} && a_1 = 2 < 6, \text{ and } a_n < 6 \Rightarrow a_{n+1} < \frac{6 + 6}{2} = 6 \\ &\text{Increasing:} && a_{n+1} - a_n = \frac{6 - a_n}{2} > 0 \text{ because } a_n < 6 \\ &\text{Limit:} && L = \frac{L + 6}{2} \Rightarrow L = 6 \end{aligned}
python · try it yourself
a = 2.0
for n in range(30):
    a = (a + 6) / 2
print(a)
5.99999999627471

The error halves each step: after 30 steps it is 4/230≈3.7×10−94/2^{30} \approx 3.7 \times 10^{-9}.

Exercise 4: Is it monotone?

Show that an=n/2na_n = n/2^n is decreasing for n≥1n \ge 1 and find its limit. Then write a loop that finds the first nn with an<10−6a_n < 10^{-6}.

Answer

Decreasing, limit 0; the first nn with n/2n<10−6n/2^n < 10^{-6} is n=25n = 25.

Solution
an+1an=n+12n≤1 for n≥1 (equality only at n=1: a1=a2=12), so it is non-increasingand strictly decreasing from n=2; bounded below by 0⇒converges; ratio→12 forces the limit 0\begin{aligned} &\frac{a_{n+1}}{a_n} = \frac{n + 1}{2n} \le 1 \text{ for } n \ge 1 \text{ (equality only at } n = 1{:}\ a_1 = a_2 = \tfrac{1}{2}\text{), so it is non-increasing} \\ &\text{and strictly decreasing from } n = 2\text{; bounded below by 0} \Rightarrow \text{converges; ratio} \to \tfrac{1}{2} \text{ forces the limit 0} \end{aligned}
python · try it yourself
n = 1
while n / 2**n >= 1e-6:
    n += 1
print(n, n / 2**n)
25 7.450580596923828e-07

Test yourself

Which sequence is bounded but divergent?

  1. 1/n1/n
  2. (−1)n(-1)^n
  3. nn
  4. (1+1/n)n(1 + 1/n)^n

The Monotone Convergence Theorem relies on which property of R\mathbb{R}?

  1. Every number has a decimal expansion
  2. R\mathbb{R} is countable
  3. Every non-empty set bounded above has a least upper bound
  4. Every polynomial has a root

For an+1=2+ana_{n+1} = \sqrt{2 + a_n}, why must you prove convergence before solving L=2+LL = \sqrt{2 + L}?

  1. Because a divergent recursion can still have a fixed point
  2. Because ⋅\sqrt{\cdot} is not continuous
  3. Because LL must be an integer
  4. You don't need to