M06.6 · Continuous random variables and densities
M06.6 L1 · Core 4 lessons · about 100 min Live · in review
Part of M06 Probability I in the Mathematics track.
A spinner can stop anywhere, so every single value has probability 0, yet intervals still have probabilities. These four lessons scale histograms until they settle on a curve, the density, and read every probability as an area under it: by hand for the uniform, the dart-distance density 2x and an exponential waiting time, then with Riemann sums and SciPy. The CDF turns those areas into a curve that gives medians and, read backwards, random samples, and a change of units shifts and stretches a density into the normal family N(μ, σ²).
What you need first. Discrete random variables, their PMFs and CDFs (M06.5), the definite integral as an area (M04.5), the fundamental theorem of calculus (M04.6), improper integrals (M04.7.3), the chain rule (M04.3) and NumPy arrays (P02).
Lessons
From histograms to a density M06.6.1 25 min
A spinner that can stop anywhere gives every single value probability 0, yet intervals still have probabilities. Scale a histogram so that area is probability, narrow its bins, and the bars settle on a curve: the density.
Probabilities by integration M06.6.2 25 min
Check that a function is a density, find the constant that makes it one, and compute probabilities by integrating: for the uniform, the density 2x and a waiting time whose tail runs to infinity, then with a Riemann sum and scipy.integrate.quad.
The CDF, quantiles and sampling M06.6.3 25 min
The CDF of a continuous variable is the area under its density to the left of x, and its slope is the density. Read medians and other quantiles off it, then turn it round to make any distribution out of uniform random numbers.
Shift, scale and the normal density M06.6.4 25 min
Changing units moves and stretches a density, and a stretch must lower it to keep the area 1. Derive the rule from the CDF, then meet the standard normal bell, its shifted and stretched family N(μ, σ²), z-scores and the 68, 95, 99.7 rule.
The interactive
M06.6-X1 · Area under a density. Pick a density (uniform, the line 2x, an exponential wait or the normal bell) and move two handles a and b. The shaded area is P(a ≤ X ≤ b), and the CDF drawn below shows the same number as F(b) − F(a). Squeeze the handles together and the probability of a single value falls to 0 while the height of the curve stays put. It lives in The CDF, quantiles and sampling.