# Sequences and Series

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

## Adding Infinitely Many Terms

A **sequence** is an ordered infinite list of numbers $a_1, a_2, a_3, \dots$, while a **series** is the sum of those terms: $\sum_{n=1}^{\infty} a_n$.

| Concept | Definition | Example |
| --- | --- | --- |
| **Sequence** | List approaching limit $L$ | $\frac{1}{n} \to 0$ |
| **Series** | Sum of **partial sums** $S_N$ | $\sum_{n=0}^{\infty} \frac{1}{2^n} = 2$ |

**Convergence** asks if adding infinite terms yields a finite total. A **geometric series** $\sum r^n$ **converges** when $|r| < 1$, summing to $\frac{1}{1 - r}$ for $n = 0$.

## Tests and Pitfalls

Series are vital in computing: they define functions, analyze algorithm running times, and power numerical methods.

| Rule / Test | Condition | Outcome |
| --- | --- | --- |
| **Term Test** | $a_n$ does **not** go to $0$ | Series **diverges** |
| **Harmonic Series** | $\sum \frac{1}{n}$ terms go to $0$ | Series **diverges** |

**Common pitfall:** Assuming terms shrinking to zero guarantees convergence. That is **false**. Shrinking to zero is **necessary** but **not sufficient**.

## Practice questions

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

### 1. Monte Carlo integration is hopeless in one dimension and indispensable in three hundred. What flips the verdict?

A. Random sampling becomes more accurate as dimension grows
B. Grid methods cannot be implemented above three dimensions
C. High-dimensional integrals have smaller values, which are easier to estimate
D. Its 1/√N error is independent of dimension, unlike a grid's n^d

**Answer:** D. Its 1/√N error is independent of dimension, unlike a grid's n^d

**Why:** 100¹⁰ is 10²⁰ grid points and Monte Carlo's error does not contain d at all. The 1/√N rate is genuinely slow, a hundredfold more samples per extra digit, and it is the only thing that survives the curse of dimensionality, which is why finance and statistical physics run on it.

Page: https://tryals.app/practice/computer-science-i/sequences-and-series/monte-carlo-integration-is-hopeless-in-one-dimension-and

### 2. A geometric series starts at n = 0 with ratio r = 0.2. What does it sum to?

**Answer:** 1.25 (within ±0.001)

**Why:** 1 divided by 0.8 is 1.25. Note how much smaller this is than the r = 0.5 case, which sums to 2: the closer the ratio sits to 1, the more slowly the series converges and the more terms a computer must add for a given accuracy.

Page: https://tryals.app/practice/computer-science-i/sequences-and-series/a-geometric-series-starts-at-n-0-with-ratio-r-0-2-what-does-it

### 3. An infinite series with terms tending to zero may still diverge - the harmonic series does. Why is "the terms shrink to zero" not enough for convergence?

A. Because the harmonic series' terms do not actually reach zero, unlike convergent series.
B. Because divergence depends on the order of the terms rather than on their sizes.
C. Because what matters is how fast the terms shrink, not that they do.
D. Because convergence requires the terms to become negative at some point.

**Answer:** C. Because what matters is how fast the terms shrink, not that they do.

**Why:** The grouping argument makes it concrete: 1/3 + 1/4 > 1/2, the next four terms also exceed 1/2, and so on indefinitely. Terms going to zero is necessary and not sufficient, and the p-series boundary is sharp at p = 1. The computing consequence is that partial sums are not evidence, the harmonic series passes 20 only after about 250 million terms.

Page: https://tryals.app/practice/computer-science-i/sequences-and-series/an-infinite-series-with-terms-tending-to-zero-may-still-diverge-the

### 4. Sort each series by whether it converges.

**Answer:**

- Converges: The sum of 1/2^n, The sum of 0.9^n
- Diverges: The sum of 1/n, the harmonic series, The sum of n/(n+1), The sum of 2^n

**Why:** Ratios of 1/2 and 0.9 both lie below 1, so those converge; a ratio of 2 blows up. The terms of n/(n+1) tend to 1 rather than 0, so it fails the term test outright. The harmonic series is the famous case: its terms do reach zero, yet it still diverges.

Page: https://tryals.app/practice/computer-science-i/sequences-and-series/sort-each-series-by-whether-it-converges

### 5. The terms of a series shrinking toward zero is not enough to make the series converge.

**Answer:** True

**Why:** True. $\sum 1/n$ diverges although its terms tend to zero: grouping as $1/3+1/4 > 1/2$, then the next four terms $> 1/2$, and so on gives unboundedly many half-units. Terms tending to zero is *necessary* for convergence and not sufficient, the distinction the nth-term test makes precise.

Page: https://tryals.app/practice/computer-science-i/sequences-and-series/the-terms-of-a-series-shrinking-toward-zero-is-not-enough-to-make-the
