# Limits and Continuity

Computer Science I · Calculus · https://tryals.app/learn/computer-science-i/limits-and-continuity

## The Approach to a Limit

Calculus is built on the **limit**: the value a function approaches as its input gets close to a point, even if the function is never evaluated there. We write $\lim_{x \to a} f(x) = L$ to say as $x$ approaches $a$, $f(x)$ approaches $L$.

A **one-sided limit** checks the approach from just the left ($x \to a^-$) or right ($x \to a^+$). A two-sided limit exists if and only if both one-sided limits agree.

| Limit Type | Notation | Meaning |
| --- | --- | --- |
| Left-hand | $\lim_{x \to a^-} f(x)$ | Approach from below |
| Right-hand | $\lim_{x \to a^+} f(x)$ | Approach from above |
| Two-sided | $\lim_{x \to a} f(x)$ | Both sides must match |

## Continuity and Pitfalls

**Continuity** captures having no breaks in a graph. A function $f$ is **continuous** at $a$ when three conditions hold: $f(a)$ is defined, $\lim_{x \to a} f(x)$ exists, and $\lim_{x \to a} f(x) = f(a)$.

Polynomials are continuous everywhere. A hole, jump, or vertical asymptote creates a discontinuity.

> **Common pitfall:** Confusing the **limit** of a function with its **value** at that point. $\lim_{x \to a} f(x)$ can exist even when $f(a)$ is undefined. The limit ignores the point $a$ and looks only at nearby behavior. Continuity is the special case where limit and value **agree**.

## Practice questions

5 of this lesson's 11 practice questions, with answers. The full set is in the app.

### 1. Adding a million small floats into one running total loses accuracy the same numbers would keep if summed pairwise.

**Answer:** True

**Why:** True. The running total grows large, so each small addend is rounded against it and error accumulates as O(n). Pairwise summation keeps the operands comparable and holds the error to O(log n); Kahan summation carries a compensation term and does better still, at three extra flops per element.

Page: https://tryals.app/practice/computer-science-i/limits-and-continuity/adding-a-million-small-floats-into-one-running-total-loses-accuracy

### 2. Select every condition that must hold for f to be continuous at the point a.

A. f is a polynomial
B. f(a) is defined
C. the limit of f(x) as x approaches a exists
D. the limit of f(x) as x approaches a equals f(a)
E. f(a) = 0

**Answer:** B. f(a) is defined; C. the limit of f(x) as x approaches a exists; D. the limit of f(x) as x approaches a equals f(a)

**Why:** Continuity needs the value to exist, the limit to exist, and the two to agree. Polynomials happen to be continuous everywhere, but being a polynomial is not a requirement, and f(a) = 0 has nothing to do with it.

Page: https://tryals.app/practice/computer-science-i/limits-and-continuity/select-every-condition-that-must-hold-for-f-to-be-continuous-at-the

### 3. Calculus assumes exact real numbers and computers have neither exact reals nor infinitely many of them. Why is numerical computing nevertheless trustworthy?

A. Because methods come with error analysis, so you get a bound
B. Because modern hardware computes with exact reals
C. Because the errors are too small to matter in any application
D. Because floating-point errors cancel out over long computations

**Answer:** A. Because methods come with error analysis, so you get a bound

**Why:** The discipline is bounding the error rather than pretending it away: truncation from stopping an infinite process, round-off from the arithmetic, both quantified. Option 2 is comforting and false, errors compound in some algorithms and cancel in others, which is exactly what stability analysis is for.

Page: https://tryals.app/practice/computer-science-i/limits-and-continuity/calculus-assumes-exact-real-numbers-and-computers-have-neither-exact

### 4. Order the steps of testing whether f is continuous at the point a.

**Answer:**

1. Check that f(a) is defined
2. Find the limit of f(x) as x approaches a from the left
3. Find the limit of f(x) as x approaches a from the right
4. Check that walking in from either side leads to the same place
5. Compare that limit with f(a) and declare continuity only if they match

**Why:** The value comes first, then each side separately, then their agreement, and only then the final comparison. Skipping straight to the last step is what makes students assume the limit and the value always coincide.

Page: https://tryals.app/practice/computer-science-i/limits-and-continuity/order-the-steps-of-testing-whether-f-is-continuous-at-the-point-a

### 5. For each described point, sort by whether the two-sided limit exists there.

**Answer:**

- Limit exists: A removable hole in an otherwise smooth curve, A sharp corner in an unbroken curve, A point where the plotted value sits far above the surrounding curve
- No limit: A jump from 4 on the left to 9 on the right, A vertical asymptote

**Why:** Holes, corners and misplaced single values all leave the two-sided approach intact, so the limit exists. Only a jump or an asymptote makes the two sides disagree. A corner is the instructive case: continuous, limit fine, yet it will fail differentiability in the next lesson.

Page: https://tryals.app/practice/computer-science-i/limits-and-continuity/for-each-described-point-sort-by-whether-the-two-sided-limit-exists
