Project 6: Sequences, Series, and Recurrence Lab
A self-contained deep-dive from the canonical Math from Foundations to Machine Learning curriculum.
- Difficulty: Intermediate
- Time: 8-16 hours
- Language: Python (alternatives: Julia, R, JavaScript)
- Prerequisites: Project 5
- Source:
HS P14
What You Will Build
Build a sequence engine that accepts arithmetic and geometric parameters, explicit formulas, and a constrained recurrence definition. Produce term tables, partial-sum tables, and plots of values and errors. For arithmetic and geometric families, compare iterative generation and finite sums with their closed forms. For recurrences, record state transitions and explore fixed-point behavior, oscillation, growth, and sensitivity to the starting value. Add convergence diagnostics that report finite evidence and a tolerance window without falsely claiming a proof from a limited number of terms.
Real World Outcome
The tool can generate the first 100 terms of an arithmetic progression, verify its partial-sum formula, show a geometric series approaching its finite limit when |r| < 1, and plot a recurrence such as x[n+1] = cos(x[n]) approaching a fixed point. A report distinguishes convergent-looking, divergent, oscillatory, and inconclusive runs and includes the parameters and stopping rule needed to reproduce them.
Core Question
How do local rules for producing the next value create global patterns, and what can finite computation legitimately say about infinite behavior?
Concepts You Must Understand First
- Sequence notation: index, term, explicit formula, and recurrence relation.
- Arithmetic and geometric progressions: common difference/ratio and finite sum formulas.
- Series and partial sums: a sequence of accumulated totals is distinct from the terms being summed.
- Limits and convergence intuition: approaching a value differs from reaching it; oscillation can remain bounded.
- Fixed points: a recurrence approaches
Lonly if its update is compatible withL = f(L)and locally stable.
Build Milestones
- Implement structured arithmetic/geometric generators and compare terms with explicit formulas.
- Compute finite partial sums and compare them against trusted closed-form results.
- Add safe recurrence definitions, initial state, trace output, and termination limits.
- Plot terms, partial sums, and successive differences on suitable scales.
- Add convergence heuristics, parameter sweeps, and adversarial examples that fool simplistic rules.
Hints in Layers
- Keep
terms[n]andpartial_sums[n]separate; many conceptual bugs come from mixing them. - A useful heuristic requires several consecutive small changes, not one lucky near-equality.
- Compare different initial values and plot
|x[n]-L|on a log scale when a reference limit is known.
Common Pitfalls and Debugging
- Symptom: a geometric sum is wrong by one term. Cause: inconsistent zero-based versus one-based indexing. Fix: document the first term and test
n=1before larger cases. - Symptom:
1, 0, 1, 0...is declared convergent. Cause: boundedness was confused with convergence. Fix: inspect a trailing window and detect periodic behavior. - Symptom: recurrence evaluation never stops. Cause: no iteration budget or non-finite check. Fix: require maximum steps and stop on overflow/NaN.
Definition of Done
- Arithmetic and geometric terms and finite sums match hand calculations.
- Recurrences produce reproducible state traces with explicit initial conditions.
- Terms, partial sums, and error/difference trends are plotted separately.
- Convergence output is labeled heuristic and includes tolerance/window settings.
- Tests include convergent, divergent, oscillating, and inconclusive examples.
Navigation
Previous: Project 5 · Complete learning path · Next: Project 7