Lesson 1.6foundation3 h⚡ live demo

Probability I: random variables and distributions

The language of uncertainty, from coin flips to the Gaussian

A classifier does not output an answer, it outputs a distribution over answers; a language model is a distribution over the next token (7.6 Decoder-only: GPT and autoregressive generation); a diffusion model adds and removes Gaussian noise (8.9 Generative models II: Diffusion and flow matching). Probability is the language in which all of that is written. This lesson builds the vocabulary — random variables, PMFs and PDFs, expectation and variance, the standard distributions — and spends extra time on the Gaussian, the distribution that keeps reappearing for reasons you will finally understand.

You'll be able to

  • State the probability axioms and distinguish discrete (PMF) from continuous (PDF) random variables
  • Compute expectations, variances and covariances and use their linearity rules
  • Recognize Bernoulli, Binomial, Categorical, Uniform, Gaussian, Exponential and Poisson distributions and where each appears in ML
  • Work with the Gaussian density, standardization and the multivariate Gaussian's covariance geometry

Key ideas

  1. Axioms: P ≥ 0, P(Ω) = 1, additivity for disjoint events; everything else (complements, unions) follows.
  2. Discrete variables have PMFs that sum to 1; continuous variables have densities that integrate to 1 and can exceed 1 pointwise; the CDF covers both.
  3. E[X] is a weighted average and is always linear; Var(X) = E[X²] − μ², Var(aX + b) = a²Var(X); variances of independent variables add.
Show 4 more key ideas
  1. Bernoulli/Categorical are classifier output distributions; the Gaussian is the default noise model and prior.
  2. Gaussian density ∝ exp(−½((x − μ)/σ)²): a squared distance in the exponent, which is why Gaussian noise ⇒ squared-error loss.
  3. Multivariate Gaussian level sets are ellipsoids with axes along the covariance's eigenvectors.
  4. Gaussians are everywhere because of the CLT, maximum entropy and closure under sums, linear maps and conditioning.

Suggested path through this lesson