Lesson 9 of 15

Epsilon-Delta Continuity

Epsilon-Delta Definition of Continuity

Continuity is the second fundamental concept in real analysis, defined similarly to limits.

Definition

A function (f) is continuous at (c) if for every (\varepsilon > 0), there exists (\delta > 0) such that:

xc<δ    f(x)f(c)<ε|x - c| < \delta \implies |f(x) - f(c)| < \varepsilon

Intuition

Small changes in the input produce small changes in the output. The function has no "jumps" at (c).

Finding Delta

For (f(x) = 2x) at (c = 3) with (\varepsilon = 0.1):

  • We need (|2x - 6| < 0.1), which means (2|x - 3| < 0.1)
  • So (|x - 3| < 0.05), meaning (\delta = 0.05 = \varepsilon / 2)

Numerical Verification

We can check continuity by sampling points in a (\delta)-neighborhood:

def check_continuity(f, c, epsilon, delta, samples=100):
    import random
    for _ in range(samples):
        x = c + (2 * random.random() - 1) * delta
        if abs(f(x) - f(c)) >= epsilon:
            return False
    return True

Your Task

Implement:

  1. check_continuity(f, c, epsilon, delta, num_points) -- checks if (|f(x) - f(c)| < \varepsilon) for num_points evenly spaced points in ((c - \delta, c + \delta))
  2. find_delta(f, c, epsilon) -- finds the largest (\delta) from the list ([1, 0.5, 0.1, 0.05, 0.01, 0.005, 0.001]) such that continuity holds (using 200 sample points)
Pyodide loading...
Loading...
Click "Run" to execute your code.