Lesson 2 of 15
Epsilon-N Definition of Limits
The Epsilon-N Definition of Limits
The formal definition of a sequence limit is the cornerstone of real analysis.
Definition
We say (\lim_{n \to \infty} a_n = L) if for every (\varepsilon > 0), there exists a natural number (N) such that for all (n > N):
Intuition
No matter how small a tolerance (\varepsilon) you choose, eventually the sequence gets and stays within that tolerance of (L).
Finding N for a Given Epsilon
For (a_n = 1/n) with limit (L = 0):
- We need (|1/n - 0| < \varepsilon)
- This means (1/n < \varepsilon), so (n > 1/\varepsilon)
- Therefore (N = \lceil 1/\varepsilon \rceil)
import math
def find_N(epsilon):
return math.ceil(1 / epsilon)
Verifying Convergence Numerically
We can check that all terms beyond (N) stay within (\varepsilon) of (L):
def verify_limit(f, L, epsilon, N, check_terms=100):
return all(abs(f(n) - L) < epsilon for n in range(N + 1, N + 1 + check_terms))
Your Task
Implement find_N(f, L, epsilon) that finds the smallest (N) such that (|f(n) - L| < \varepsilon) for all (n > N) (check up to (N + 200) to be confident).
Also implement verify_limit(f, L, epsilon, N) that returns True if (|f(n) - L| < \varepsilon) for all (n) from (N+1) to (N+200).
Pyodide loading...
Loading...
Click "Run" to execute your code.