Statistics is built on a small, friendly set of math tools. Master this handful and every formula in this book becomes readable. Treat this chapter as a cheat sheet with explanations: skim what you know, lean on what you don't.
Summation: the Σ Symbol
That big Greek Σ (sigma) scares people, but it just means "add them all up." Σxᵢ says: take every value x₁, x₂, …, xₙ and sum them.
Once you read Σ as a loop that adds, the scariest-looking formulas, mean, variance, regression, turn out to be simple bookkeeping. Its cousin Π (pi) means "multiply them all" and appears in probability.
Σxᵢ² (square each value, then add) is not the same as
(Σxᵢ)² (add first, then square). For [1, 2, 3]: Σxᵢ² = 1+4+9 = 14,
but (Σxᵢ)² = 6² = 36. This exact distinction lives inside the variance formula. Two handy rules:
Σ(c·xᵢ) = c·Σxᵢ and Σ(xᵢ + yᵢ) = Σxᵢ + Σyᵢ.
Order of Operations & Factorials
Two small things that cause most arithmetic slips in statistics formulas:
Order of operations (PEMDAS)
Parentheses → Exponents → Multiply/Divide → Add/Subtract. A formula like (x − μ)² / n only works if you do the parentheses and the square first.
Factorials
n! means n × (n−1) × … × 1, so 4! = 24. By definition 0! = 1. Factorials are the engine inside permutations and combinations.
Sets & Venn Diagrams
A set is just a collection of distinct things. In probability, an event is a set of outcomes, so these operations become the rules of probability:
Union ∪
A ∪ B = everything in A or B (or both).
Intersection ∩
A ∩ B = only what's in both A and B.
Complement Aᶜ
Everything not in A, the basis of "P(not A) = 1 − P(A)".
Counting: Permutations & Combinations
Probability often comes down to counting possibilities. The one question to ask: does order matter?
Order matters. Arrangements, 1st/2nd/3rd place, passwords, seating.
- Formula: P(n,r) = n! / (n−r)!
- "How many ways to arrange r of n?"
Order doesn't matter. Selections, teams, lottery numbers, committees.
- Formula: C(n,r) = n! / (r!·(n−r)!)
- "How many ways to choose r of n?"
Choosing 6 numbers from 49 gives C(49,6) = 13,983,816 combinations, so the odds are about 1 in 14 million. Counting makes the (un)likelihood concrete.
Logarithms & Exponents
A logarithm answers "what power do I raise the base to?" Since 2¹⁰ = 1024, we have log₂(1024) = 10. Two superpowers make logs essential in statistics:
Products become sums
log(a·b) = log(a) + log(b). This is why we maximize log-likelihood, turning a huge product of probabilities into a friendly sum.
Huge ranges become readable
A log scale squeezes 1, 10, 1,000, 1,000,000 into even steps, taming exponential growth on a chart.
"log" is ambiguous: log₁₀ (pH, decibels, log-axis charts), ln = base e (growth and likelihoods, and what most stats software means by "log"), and log₂ (information and entropy, measured in bits). Logs are only defined for positive numbers.
A Pinch of Calculus
You won't be solving integrals by hand here, but two ideas matter enormously:
How fast something changes. A slope of zero marks a peak or valley.
- Models "learn" by following slopes downhill (gradient descent)
- Minimizing error = finding where the slope is zero
The area under a curve.
- Probability = area under a continuous distribution's curve
- (For discrete data it's a sum, not an integral)
- The total area (or sum) over all outcomes is exactly 1
Derivatives power optimization (how every machine-learning model trains), and integrals power probability (areas under curves). That's calculus's whole job in this book.
Linear Algebra: the Math of Data
Open any dataset and you'll see a grid of numbers, rows and columns. That grid is a matrix, and a single row or column is a vector:
Why bother? Because linear algebra lets the computer operate on a whole table at once, averaging a column, combining features, or running a regression, without slow loops. Every model in this book ultimately speaks in matrices.
Bonus vocabulary you'll meet later: eigenvalues and eigenvectors capture a matrix's "main directions", the engine behind PCA and dimensionality reduction (see Unsupervised Learning).
Bring it to life in Python
The companion notebook runs all six tools, summation vs. NumPy, set operations with a Venn, lottery odds, log scales, a baby gradient descent, and data as a matrix.
View opens the rendered notebook instantly (no setup). Open in Colab runs &
edits it live in your browser. To run locally, install numpy, pandas, matplotlib
and launch jupyter notebook.
🎓 Key Takeaways
- ✓Σ (summation) means "add them all up", the heart of the mean, variance, and beyond.
- ✓Sets (∪ "or", ∩ "and", complement) are the language of probability events.
- ✓Permutations vs. combinations: order matters vs. order doesn't.
- ✓Logarithms turn products into sums and tame huge ranges.
- ✓Calculus: derivatives drive optimization (model training); integrals give probability (area under curves).
- ✓Linear algebra: your data is a matrix, so the computer can crunch it all at once.
Practice Challenges
Five short challenges, one per math area. Beginner-to-intermediate; try them on paper or in Python.
Summation · Add and average
For x = [3, 7, 2, 8], compute Σxᵢ and then the mean
(1/n)·Σxᵢ.
Sets · Union & intersection
Let A = {1,2,3,4} and B = {3,4,5,6}. Find A∪B,
A∩B, and the size of the union.
Counting · Permutation or combination?
(a) How many ways can 4 runners finish 1st/2nd/3rd? (b) How many 3-person teams can you form from 4 people?
Logarithms · Products into sums
Show that log(8 × 32) = log(8) + log(32). Then find log₂(1024).
Calculus & matrices · Slope & column mean
(a) For f(x) = (x−5)² with derivative 2(x−5),
find the slope at x=2 and say which way is downhill. (b) Find the mean of each column of
[[2,10],[4,20],[6,30]].
A fully-worked solutions notebook walks through all five challenges in the same visual style, try them yourself first, then compare.
Quiz: Test Yourself
Eight quick questions across the math toolkit. Answer them, hit Check Answers, and keep refining until you score 100%. Your progress is saved, so you can hop back to the chapter and return anytime.