---
title: Sequences and their limits
heading: "What \"gets closer and closer\" means, made exact"
eyebrow: A14 · Lesson 3 · Sequences and their limits
xp: 40
---

::: hook
An iterative solver produces a sequence of guesses, and you stop when "it has converged." Analysis makes that precise with a game. You name a tolerance ε, as small as you like; I must name a point N in the sequence after which every term stays within ε of the limit. If I can win for every ε, the sequence converges. This ε–N definition is how every convergence claim in numerical methods, signal processing and control is stated and proved, and finding N for a given ε is a concrete calculation, the same one that tells a solver how many iterations it needs.
:::

::: play
- The stems are $a_n = 1 + \frac{2(-1)^n}{n}$, which bounces from side to side of its limit, 1. The dashed lines are the band $1 \pm \varepsilon$.
- Shrink ε: the marked N moves right. Every term after it is inside the band, while some terms before it are outside.
- Here $\lvert a_n - 1\rvert = \frac2n$, so the terms are inside exactly when $n > \frac2\varepsilon$, and N = $\lfloor 2/\varepsilon\rfloor$ works for every ε. That's convergence.
:::
:::

```sim plot
view: graph
x: n = 1..40
y: a = -1.2..3.2
slider: e = 0.06..1.5 step 0.01 = 0.3
plot: 1 + 2*cos(pi*n)/n | stems | label: aₙ
plot: 1 + e + 0*n | dashed | label: 1 ± ε
plot: 1 - e + 0*n | dashed
marker: n = floor(2/e) + 0.5 | label: N
readout: N = floor(2/e)
```

::: predict
## For $a_n = \frac1n$ and ε = 0.003, what's the smallest N such that every term after the N-th is within ε of 0?

- [ ] 300
- [x] 333
- [ ] 334
- [ ] 3

::: reveal
333: $\frac1n < 0.003$ exactly when $n > 333.3$, so every n > 333 works and n = 333 itself doesn't. Finding N means solving the inequality $\lvert a_n - L\rvert < \varepsilon$ for n.
:::
:::

::: nameit
## The definition

A sequence $(a_n)$ **converges** to L, written $a_n \to L$, if

$$\text{for every } \varepsilon > 0 \text{ there is an } N \text{ such that } \lvert a_n - L\rvert < \varepsilon \text{ for all } n > N$$

N may depend on ε, and usually must grow as ε shrinks. A sequence that doesn't converge **diverges**.

## Finding N

Work backward from the inequality: bound $\lvert a_n - L\rvert$ by something simple in n, then solve for n. For $a_n = \frac{3n + 1}{n + 2}$: $\lvert a_n - 3\rvert = \frac{5}{n + 2} < \varepsilon$ when $n > \frac5\varepsilon - 2$.

## Facts that follow

- A limit is unique.
- A convergent sequence is bounded.
- **Limit laws:** if $a_n \to a$ and $b_n \to b$, then $a_n + b_n \to a + b$, $a_nb_n \to ab$, and $a_n/b_n \to a/b$ if $b \ne 0$.
- **Squeeze:** if $b_n \le a_n \le c_n$ and $b_n, c_n \to L$, then $a_n \to L$.
- Useful limits: $\frac{1}{n^p} \to 0$ for p > 0; $r^n \to 0$ for $\lvert r\rvert < 1$; $n^{1/n} \to 1$; $\frac{n^k}{r^n} \to 0$ for r > 1.

## Showing divergence

Negate the definition: some ε has the property that for every N, a later term is at least ε away. For $(-1)^n$, ε = 1 works for every proposed L, since consecutive terms are 2 apart.
:::

::: example
## Prove $\frac{2n + 3}{n + 1} \to 2$ and find N for ε = 0.01.

::: solution
1. **Simplify the distance to 2.**
   $$\left\lvert\frac{2n + 3}{n + 1} - 2\right\rvert = \frac{1}{n + 1}$$
2. **Solve for n.** This is less than ε when
   $$n > \frac1\varepsilon - 1$$
3. **Choose N.** Given ε, take $N = \lfloor 1/\varepsilon\rfloor$ (or any larger number).
4. **Put in ε = 0.01.** Every n > 99 works:
   $$N = 99$$

**Answer:** the sequence converges to 2, and for ε = 0.01, N = 99.
:::
:::

::: example
## Prove $\frac{\sin n}{n} \to 0$.

::: solution
1. **Bound the terms.**
   $$-\frac1n \le \frac{\sin n}{n} \le \frac1n$$
2. **Squeeze.** Both bounds tend to 0, so by the squeeze theorem the sequence does too.
3. **Explicitly.** For $n > \frac1\varepsilon$,
   $$\left\lvert\frac{\sin n}{n}\right\rvert \le \frac1n < \varepsilon$$

**Answer:** $\frac{\sin n}{n} \to 0$, squeezed between $-\frac1n$ and $\frac1n$.
:::
:::

::: example
## Prove $\frac{n}{2^n} \to 0$ and find N for ε = 0.001.

::: solution
1. **Ratio of successive terms.** For n ≥ 2 it is
   $$\frac{n + 1}{2n} \le \frac34$$
2. **Geometric bound.** So the terms decrease from n = 2 on, at least geometrically:
   $$\frac{n}{2^n} \le \frac12\left(\frac34\right)^{n-2}$$
   which goes to 0.
3. **Try n = 13 for ε = 0.001.** This is too big:
   $$\frac{13}{8192} = 0.00159$$
4. **Try n = 14.** This is small enough:
   $$\frac{14}{16\,384} = 0.00085$$
   Since the terms decrease, every n ≥ 14 works, so N = 14.
5. **The general pattern.** In the same way $n^k/2^n \to 0$ for every fixed k: the exponential eventually outgrows any power.

**Answer:** $\frac{n}{2^n} \to 0$, and for ε = 0.001, N = 14.
:::
:::

::: check
given: c = 2 | 5 | 7; e = 0.03 | 0.0013
answer: floor(c/e)
tolerance: 0

## For $a_n = \frac{\given{c}}{n}$ and ε = {e}, what's the smallest N such that $\lvert a_n\rvert < \varepsilon$ for every n > N?

::: right
Right. $\frac cn < \varepsilon$ when $n > c/\varepsilon$, so N = {answer}.
:::

::: misses
- [floor(c/e) + 1] That n works too, but so does every n after {answer}: N is the last index that might fail.
- [any] Not yet. Solve $\frac cn < \varepsilon$.
:::
:::

::: check
given: e = 0.03 | 0.007 | 0.0011
answer: floor(5/e - 2)
tolerance: 0

## For $a_n = \frac{3n + 1}{n + 2} \to 3$ and ε = {e}, what's the smallest N such that every term after the N-th is within ε of 3?

::: right
Right. $\frac{5}{n + 2} < \varepsilon$ when $n > \frac5\varepsilon - 2$: N = {answer}.
:::

::: misses
- [floor(5/e)] The distance is $\frac{5}{n + 2}$, not $\frac5n$.
- [any] Not yet. $\lvert a_n - 3\rvert = \frac{5}{n + 2}$.
:::
:::

::: check
given: r = 0.5 | 0.9 | 0.99; e = 0.001 | 0.0000013
answer: floor(ln(e)/ln(r))
tolerance: 0

## For $a_n = (\given{r})^n$ and ε = {e}, what's the smallest N such that $a_n < \varepsilon$ for every n > N?

::: right
Right. $r^n < \varepsilon$ when $n > \frac{\ln\varepsilon}{\ln r}$: N = {answer}.
:::

::: misses
- [floor(ln(e)/ln(r)) + 1] That's the first n that works; N is the one before.
- [any] Not yet. Take logs, and remember $\ln r < 0$ flips the inequality.
:::
:::

::: check
given: a = 2 | 5; b = 3 | 7; c = 4 | 1; d = 9 | 2
answer: a/c
tolerance: 0.01%

## What's $\lim_{n\to\infty}\frac{\given{a}n^2 + \given{b}}{\given{c}n^2 + \given{d}n}$?

::: right
Right. Divide top and bottom by $n^2$: {answer}.
:::

::: misses
- [b/d] Those terms vanish relative to the $n^2$ terms.
- [any] Not yet. The leading terms decide.
:::
:::

::: check
kind: choice

## Which sequence converges?

- [ ] $(-1)^n$
- [ ] $n\sin\frac{\pi n}{2}$
- [x] $\frac{(-1)^n}{\sqrt n}$
- [ ] $\ln n$

::: misses
- [1] It alternates between −1 and 1 forever.
- [2] It isn't even bounded.
- [4] It grows without bound, slowly.
:::
:::

::: check
kind: order

## Put the steps of the proof that $a_n + b_n \to a + b$ in order.

1. Let ε > 0.
2. Since $a_n \to a$, choose $N_1$ with $\lvert a_n - a\rvert < \varepsilon/2$ for $n > N_1$.
3. Since $b_n \to b$, choose $N_2$ with $\lvert b_n - b\rvert < \varepsilon/2$ for $n > N_2$.
4. Let $N = \max(N_1, N_2)$.
5. For n > N, $\lvert(a_n + b_n) - (a + b)\rvert \le \lvert a_n - a\rvert + \lvert b_n - b\rvert < \varepsilon$.

::: right
Right. Split ε between the two pieces, wait until both are small, then add with the triangle inequality: the pattern of most limit proofs.
:::
:::

::: check
kind: parts
given: c = 2 | 5; e = 0.01 | 0.001

## $a_n = \frac{n + \given{c}}{2n + 1} \to \frac12$.

::: part
answer: (2*c - 1)/(2*21)
tolerance: 0.5%

### How far is $a_{10}$ from ½?

::: misses
- [any] $a_n - \frac12 = \frac{2c - 1}{2(2n + 1)}$.
:::
:::

::: part
answer: floor(((2*c - 1)/(2*e) - 1)/2) + 1
tolerance: 0

### What is the smallest N with $\lvert a_n - \frac12\rvert < \given{e}$ for all n ≥ N?

::: misses
- [any] Solve $\frac{2c - 1}{2(2n + 1)} < \varepsilon$ for n.
:::
:::
:::

::: check
kind: derivation
vars: a = 1..5, b = -3..3, c = 1..5, d = 0.5..3, n = 1..50

## $a_n = \frac{an + b}{cn + d}$.

::: step
answer: a/c

### What is its limit?
:::

::: step
answer: (b*c - a*d)/(c*(c*n + d))

### What is $a_n - \frac ac$?
:::

::: right
Right. The difference falls as $\frac1n$, so N grows like $\frac1\varepsilon$.
:::
:::

::: explain
## Why does the definition of a limit say "for every ε there is an N" rather than "the terms get closer and closer to L"?

::: model
"Closer and closer" isn't precise enough: the sequence $1 + \frac1n$ gets closer and closer to 0 at every step, yet its limit is 1, and a sequence can approach its limit without improving at every step, like one that bounces from side to side. The ε–N definition fixes this by making a promise testable: whatever tolerance you name, from some point on every term is within it. Ordering it as "for every ε, there is an N" lets N depend on how strict ε is, which is exactly how convergence behaves. The definition also gives a calculation, finding N for a given ε, which is the same thing as counting iterations to reach a tolerance.
:::
:::

::: practice

::: check
given: c = 3 | 11; e = 0.07 | 0.0009
answer: floor(c/e)
tolerance: 0

## N for $\given{c}/n$ with ε = {e}?

::: misses
- [any] $\lfloor c/\varepsilon\rfloor$.
:::
:::

::: check
given: r = 0.7 | 0.95; e = 0.01 | 0.000013
answer: floor(ln(e)/ln(r))
tolerance: 0

## N for $(\given{r})^n < \given{e}$?

::: misses
- [any] $\lfloor\ln\varepsilon/\ln r\rfloor$.
:::
:::

::: check
given: e = 0.06 | 0.035 | 0.013 | 0.007 | 0.0023 | 0.00041
answer: floor(5/e - 2)
tolerance: 0

## N for $\frac{3n + 1}{n + 2} \to 3$, ε = {e}?

::: misses
- [any] $\lfloor 5/\varepsilon - 2\rfloor$.
:::
:::
:::
