Index Ai Academy
Foundation · Foundation mathAlgebra

Sequences and Σ

About 40 minLooking ahead: some prerequisites aren't done yet

Why this matters

A sequence is a list of numbers that follows a rule, and Σ (the Greek capital sigma) is a single symbol for adding many of them. Almost every formula in machine learning has a Σ in it: an average, a loss, a dot product. Once you can read Σ as "a loop that adds", those formulas stop looking like code in a foreign language. This lesson reads and writes Σ, then uses it to measure how wrong a model is. Along the way you'll meet arithmetic and geometric sequences, subscripts, and Π, Σ's cousin for multiplying.

  • Find the nth term of arithmetic and geometric sequences
  • Read and write Σ notation, with its index, limits and subscripts, and see the mean as a sum over a count
  • Turn any Σ into a running total in a Python loop, or into sum()
  • Compute a model's mean squared error, the Σ at the heart of training
Quick check
Have a guess before you start. What comes next: 2, 5, 8, 11, …?

The math: patterns, and adding them up

Purpose. Describe patterns that go step by step, and add many numbers with one symbol.

A sequence is a list that follows a rule. Two kinds come up most:

  • Arithmetic: add the same amount d each step. 2, 5, 8, 11 has d = 3. The nth term is a + (n − 1)d, so the 10th is 2 + 9 × 3 = 29.
  • Geometric: multiply by the same factor r each step. 5, 10, 20, 40 has r = 2. The nth term is a·rⁿ⁻¹, so the 7th is 5 × 2⁶ = 320.

These are lesson 21's straight lines and lesson 24's exponentials, taken one whole step at a time.