Skip to content

Chapter 4 of 7

Sequences, Series, and Summation Notation

A sequence is an ordered list of numbers indexed by the positive integers, \(a_1, a_2, a_3, \ldots\), with a general term \(a_n\) given by some formula. The simplest families are arithmetic sequences, where each term differs from the previous by a fixed common difference \(d\) (so \(a_n = a_1 + (n-1)d\)), and geometric sequences, where each term is obtained by multiplying by a fixed common ratio \(r\) (so \(a_n = a_1 \cdot r^{n-1}\)). The sums of arithmetic and geometric series both have closed forms: \(S_n = n(a_1+a_n)/2\) for arithmetic, and \(S_n = a_1(1-r^n)/(1-r)\) for geometric with \(r \neq 1\).

Sigma notation \(\sum_{i=m}^{n} a_i\) compresses a sum into a compact form, with \(i\) being the index running from the lower limit \(m\) to the upper limit \(n\). Two properties make summation flexible: a constant factor can be pulled outside the sum, and a sum of sums splits into separate sums. More usefully, sums can be re-indexed (shifting the index by a constant adjusts both limits) and split at intermediate points. A double summation \(\sum_i \sum_j a_{ij}\) sums over a two-dimensional grid, which is exactly the structure of matrix multiplication and the layer-by-layer operations in a neural network.

The behavior of an infinite series depends on whether its sequence of partial sums approaches a finite limit. A geometric series with \(|r|<1\) converges to \(a/(1-r)\); one with \(|r| \geq 1\) diverges. The ratio test gives a general criterion: if \(\lim |a_{n+1}/a_n| < 1\) the series converges absolutely, if greater than 1 it diverges. A necessary condition is that \(a_n \to 0\), but not sufficient: the harmonic series \(\sum 1/n\) diverges despite its terms shrinking to zero. Telescoping series offer an elegant exception, where consecutive terms cancel in pairs so only the boundary values survive.

Two specific formulas appear constantly. First, the sum of the first \(n\) positive integers is \(n(n+1)/2\) (Gauss's famous result), and the sum of the first \(n\) squares is \(n(n+1)(2n+1)/6\). Second, factorials \(n!\) count arrangements, binomial coefficients \(\binom{n}{k} = n!/(k!(n-k)!)\) count unordered selections, and Pascal's identity \(\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}\) gives a recursive way to build them. The binomial theorem \((x+y)^n = \sum_{k=0}^n \binom{n}{k} x^{n-k} y^k\) packages all this into a single expansion formula. In machine learning, summation notation is essential for expressing expectations, dot products, mean squared error, cross-entropy, sample variance, and the matrix multiplications that drive every forward pass through a network.

All chapters
  1. 1Powers, Roots, and Logarithms
  2. 2Algebra, Polynomials, and Equations
  3. 3Functions, Coordinate Geometry, and Vectors
  4. 4Sequences, Series, and Summation Notation
  5. 5Calculus: Limits, Derivatives, and Integrals
  6. 6Multivariable Calculus, Linear Algebra, and Optimization
  7. 7Probability, Statistics, and Machine Learning Foundations

Drill it

Reading is not remembering. These come from the AI Math Beginner deck:

Q

What does "exponent" or "power" mean?

An exponent tells you how many times to multiply the base by itself. \[a^n = \underbrace{a \times a \times \cdots \times a}_{n \text{ times}}\]

Q

What are the "base" and "exponent" in an expression like \(2^5\)?

The base is the repeated factor (here 2) and the exponent is the count of multiplications (here 5), giving \(2^5 = 32\). \[2^5 = 2 \times 2 \times 2 \times 2 \...

Q

Why does any nonzero number raised to the power zero equal one?

Dividing \(a^n\) by itself gives 1, and the quotient rule gives \(a^n / a^n = a^{n-n} = a^0\), so \(a^0\) must equal 1. \[a^0 = 1 \quad (a \neq 0)\]

Q

What is \(x^1\) equal to?

\(x^1\) equals \(x\) itself, because raising to the first power means a single copy of the base. \[x^1 = x\]