Beautiful Math
Path

Algebra · Lesson 8

Sequences and fitting

Sequences list terms by a rule; series sum them. Linear and quadratic patterns jump off tables, and least squares fits a simple model to noisy data - algebra meeting measurement.

Core ~16 minDeep study ~47 minHow do first differences reveal a linear sequence?Why square errors in least squares?

Before this: Graphs: seeing relationships, Exponentials and logarithms

How this idea was born

A single equation describes a relationship. A sequence describes a procession: term after term, year after year, measurement after measurement. Farmers, astronomers, and census-takers needed rules for "what comes next" and honest ways to summarize messy tables when no exact rule fits every point.
Finite patterns (arithmetic, geometric) are old. The modern habit of fitting a line or curve to overdetermined observations crystallized around least squares: choose parameters that minimize the sum of squared residuals. Adrien-Marie Legendre published the method in 1805. Carl Friedrich Gauss published on it in 1809, acknowledged Legendre's appearance in print, and still claimed earlier use. MacTutor's Legendre biography records how bitterly that priority fight was felt. Teach the method; do not flatten the credit into one name.
For a modern rereader, this chapter closes the algebra track's second arc: from exact claims (equations, inequalities) through special functions (quadratics, exponentials) to patterns plus data.

First principles

better fitweaker fit
Same points, two candidate lines. Vertical gaps are residuals - squared and summed, one line wins.
A sequence {an}\{a_n\} assigns a term to each index nn (usually n=1,2,3,n = 1, 2, 3, \ldots).
  • Arithmetic: constant difference dd, so an=a1+(n1)da_n = a_1 + (n-1)d.
  • Geometric: constant ratio rr, so an=a1rn1a_n = a_1 r^{n-1} (cousin of exponentials).
A series sums terms: sn=a1++ans_n = a_1 + \cdots + a_n. Closed forms exist for arithmetic and geometric series; infinite series wait for calculus.
Finite differences: for a sequence, first differences Δan=an+1an\Delta a_n = a_{n+1} - a_n. Constant first differences suggest linear (arithmetic). Constant second differences suggest quadratic.
Least squares (linear case): given points (xi,yi)(x_i, y_i), choose line y^=mx+b\hat{y} = mx + b to minimize
S(m,b)=i(yi(mxi+b))2S(m,b) = \sum_i (y_i - (mx_i + b))^2
Squared error penalizes large misses heavily and makes the calculus (or algebra) of minimization clean. The normal equations that follow are linear systems - a reunion with the systems lesson.

Worked intuition

Spotting patterns in a table

Sequence: 3,7,11,15,3, 7, 11, 15, \ldots. First differences all 44 → arithmetic with d=4d = 4. Formula an=3+(n1)4a_n = 3 + (n-1)4.
Sequence: 2,6,12,20,302, 6, 12, 20, 30. First differences 4,6,8,104, 6, 8, 10; second differences constant 22 → quadratic pattern (like n(n+1)n(n+1)).

Geometric link

5,10,20,405, 10, 20, 40 has ratio 22. Same multiplicative story as 52n15 \cdot 2^{n-1}, which is exponential in the index.

Tiny least-squares sketch

Points (0,1)(0,1), (1,3)(1,3), (2,4)(2,4). Guess a line. Residuals for y=1.5x+1.2y = 1.5x + 1.2 are small; for a wild line they explode. Minimizing SS picks the best (m,b)(m,b) in the squared-error sense - not magic truth, a chosen loss.

Common confusions

Confusing sequence with series. Sequence lists; series sums.
Declaring a pattern from too few terms. Many formulas pass through three points; more data disciplines the claim.
Thinking least squares proves the model is true. It finds best parameters inside a chosen family. Wrong family, wrong story.
Awarding Gauss sole invention of least squares. Cite Legendre's 1805 publication and the dispute.

History and stories

Astronomers needed orbits from noisy observations - more equations than unknowns. Least squares was a practical answer: define total squared misfit, minimize it. Probability justifications (Gauss-Markov type stories) came with and after the method; beginners can start with the algebraic definition.
Gauss's broader fame (number theory, astronomy, magnetism) can overshadow Legendre's publication priority. Holding both names is historical hygiene.

Real world

  • Census and finance tables: arithmetic and geometric growth approximations.
  • Spreadsheet trendlines: often least squares under the hood.
  • Calibration: fit sensor reading to true value with a line or quadratic.
  • Sports and biometrics: progressions across weeks of training.

Open when you want the machine-learning connection. Skip freely.

Field notes, extra examples, and glossary live here when you want more than the core path.

Carry this forward

  • Sequences encode patterns; differences diagnose degree.
  • Least squares fits models to data with a clear loss.
  • Algebra track checkpoint: equations through fitting. Calculus and linear algebra deepen the same tools.

Read more

Go deeper when curiosity hits - videos, essays, and primary trails.

Check your understanding

A short learning loop - try a few, learn from misses, mark complete when you have engaged. No timer, no scoreboard.

1.An arithmetic sequence has…
2.A series is…
3.Constant second differences suggest…
4.Least squares chooses parameters to…
5.Legendre vs Gauss on least squares…

Try at least 3 core prompts, or choose I'll return later.