Probability

Probability from the ground up, with calculus where it helps: sample spaces and counting, conditioning and Bayes' rule, random variables and expectation, the binomial, Poisson, exponential and normal distributions, joint distributions, and the limit theorems that explain why averages settle and bell curves appear everywhere. Every idea starts from dice, cards, tests or queues.

Lessons

  1. Sample spaces and events: An experiment's sample space is the set of all its outcomes and an event is a subset of it, so "or", "and" and "not" become union, intersection and complement.
  2. The axioms of probability: A probability gives every event a number by three rules (never negative, the whole space gets $1$, disjoint events add), and the complement rule and $P(A \cup B) = P(A) + P(B) - P(A \cap B)$ follow from them.
  3. Equally likely outcomes: When every outcome is equally likely, $P(A)$ is the number of outcomes in $A$ over the number in the sample space, which only works if the outcomes counted really are equally likely.
  4. Counting arrangements: Multiplying the choices at each stage counts ordered arrangements, $n!$ of $n$ things and $n(n-1)\cdots(n-k+1)$ of $k$ taken from $n$, which is enough to find the chance that two of $23$ people share a birthday.
  5. Choosing without order: Each unordered choice of $k$ from $n$ appears $k!$ times among the arrangements, so there are $\binom{n}{k} = \frac{n!}{k!\,(n-k)!}$ of them, and good choices over all choices gives the chance of a hand or a sample.
  6. Conditional probability: Knowing that $B$ happened shrinks the sample space to $B$, so $P(A \mid B) = \frac{P(A \cap B)}{P(B)}$, which is usually a different number from $P(B \mid A)$.
  7. The multiplication rule and trees: Turned around, the definition gives $P(A \cap B) = P(A)\,P(B \mid A)$, so a path through a tree has the product of its branches' chances, each conditional on the path so far.
  8. The law of total probability: Splitting on cases that cover everything without overlapping, $P(B) = \sum_i P(B \mid A_i)\,P(A_i)$, an average of the conditional chances weighted by how common each case is.
  9. Bayes' rule: Bayes' rule turns a conditional around, $P(A \mid B) = \frac{P(B \mid A)\,P(A)}{P(B)}$, and shows why a positive result from an accurate test for a rare condition is often a false alarm.
  10. Independent events: $A$ and $B$ are independent when learning one leaves the chance of the other unchanged, $P(A \cap B) = P(A)\,P(B)$; that is not the same as being disjoint, and independent trials have no memory.
  11. Random variables and their distributions: A random variable gives a number to each outcome; its probability mass function lists $P(X = x)$ for each value, the values sum to $1$, and that distribution answers every question about $X$.
  12. Expected value: The expected value $E[X] = \sum_x x\,P(X = x)$ is the balance point of the distribution and the long-run average over many repetitions, and it need not be a value $X$ can take.
  13. Expectation of a function: $E[g(X)] = \sum_x g(x)\,P(X = x)$ weights the values of $g$ by the original probabilities; it equals $g(E[X])$ for a straight line, $E[aX + b] = aE[X] + b$, but not in general.
  14. Variance and standard deviation: Variance is the expected squared distance from the mean, $E[(X - \mu)^2] = E[X^2] - \mu^2$; its square root, the standard deviation, is in the units of $X$, and $\operatorname{Var}(aX + b) = a^2 \operatorname{Var}(X)$.
  15. Linearity of expectation: The expectation of a sum is the sum of the expectations, whether or not the parts are independent, so a count can be split into indicators whose expectations are just probabilities.
  16. The binomial distribution: The number of successes in $n$ independent trials, each with chance $p$, has $P(X = k) = \binom{n}{k}p^k(1-p)^{n-k}$, mean $np$ and variance $np(1-p)$.
  17. The geometric distribution: The number of trials up to the first success has $P(X = k) = (1-p)^{k-1}p$ and mean $\frac{1}{p}$, and it is memoryless, so failures so far never make a success due.
  18. The Poisson distribution: Counts of rare events from many independent chances follow $P(X = k) = e^{-\lambda}\frac{\lambda^k}{k!}$, the limit of the binomial with $np = \lambda$ held fixed, with mean and variance both $\lambda$.
  19. Probability densities: A continuous random variable has a density whose area over an interval is the chance of landing there, so the total area is $1$, a single value has probability $0$, and a density can be bigger than $1$.
  20. Cumulative distribution functions: The CDF $F(x) = P(X \le x)$ climbs from $0$ to $1$ and gives $P(a < X \le b) = F(b) - F(a)$; for a continuous variable its derivative is the density.
  21. Means and variances from densities: For a density, sums become integrals, $E[X] = \int x f(x)\,dx$, and for the uniform distribution on $[a, b]$ they give mean $\frac{a + b}{2}$ and variance $\frac{(b - a)^2}{12}$.
  22. The exponential distribution: A waiting time with constant rate $\lambda$ has density $\lambda e^{-\lambda x}$, tail $P(X > x) = e^{-\lambda x}$ and mean $\frac{1}{\lambda}$, and it is memoryless, so time already waited changes nothing ahead.
  23. The normal distribution: The normal density is a bell centred at $\mu$ with spread $\sigma$; every normal is the standard normal stretched and shifted, so about $68\%$, $95\%$ and $99.7\%$ of it lies within one, two and three standard deviations.
  24. Normal probabilities by standardizing: Standardizing, $Z = \frac{X - \mu}{\sigma}$, turns any normal question into one about the standard normal, whose CDF $\Phi$ is read from a table, forwards for a probability and backwards for a percentile.
  25. The distribution of a function: To find the density of $Y = g(X)$, write its CDF $P(g(X) \le y)$ as a probability about $X$ and differentiate; putting $g$ into the density alone gives the wrong answer.
  26. Joint distributions and marginals: A joint distribution gives the chance of every pair of values at once, and adding up a table's rows or columns, or integrating one variable out, leaves each variable's own marginal distribution.
  27. Conditional distributions and independence: Fixing one variable and rescaling that slice of the joint gives the other's conditional distribution, and the two are independent exactly when the joint is the product of the marginals.
  28. Covariance and correlation: $\operatorname{Cov}(X, Y) = E[XY] - E[X]\,E[Y]$ measures how two variables move together, correlation rescales it to lie between $-1$ and $1$, and zero correlation does not mean independence.
  29. Sums of random variables: Means always add, and $\operatorname{Var}(X + Y) = \operatorname{Var}(X) + \operatorname{Var}(Y) + 2\operatorname{Cov}(X, Y)$, so for independent terms variances add and the standard deviation of a sum grows like $\sqrt{n}$, not $n$.
  30. Markov's and Chebyshev's inequalities: A mean alone bounds the tail of a variable that is never negative, $P(X \ge a) \le \frac{E[X]}{a}$, and a variance bounds the distance from the mean, $P(|X - \mu| \ge k\sigma) \le \frac{1}{k^2}$, whatever the distribution.
  31. The law of large numbers: The average of $n$ independent draws has variance $\frac{\sigma^2}{n}$, so by Chebyshev its chance of missing the mean by any fixed amount goes to $0$; early luck is diluted, never corrected.
  32. The central limit theorem: A sum of many independent, identically distributed terms, standardized, is close to the standard normal whatever the terms' own distribution, which is why bell curves turn up everywhere.
  33. The normal approximation at work: To approximate a probability about a sum or a count, use its mean $n\mu$ and standard deviation $\sigma\sqrt{n}$, standardize and read $\Phi$, moving half a unit outward for a whole-number count.