Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Bars, curves and running totals
For a die, draw a bar of height 1/6 over each face. That bar chart is the PMF. For a smoothly varying quantity like a waiting time, draw a curve instead, where the area under it between two values is the probability. That’s the PDF.
There’s a third view that works for everything: the running total “probability of being at most x”, called the CDF. For the die, it climbs in steps of 1/6. For a waiting time, it rises smoothly from 0 to 1.
“What’s the probability a battery lasts more than 1000 hours?” is read straight off the CDF. Simulators turn plain random numbers into realistic sensor noise or failure times by inverting the CDF. Every physics engine and reliability analysis does this millions of times.
- 1. For a die, P(X ≤ 3) = ?
- 2. For a smooth distribution, probability between a and b is the…
- 3. A CDF always ends at…
Level 1: Beginner
★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.Definitions
- PMF (discrete): , with .
- PDF (continuous): with and .
- CDF (all random variables): .
| Relation | Discrete | Continuous |
|---|---|---|
| from the PMF/PDF to | ||
| from back | jump size | |
| interval | same |
Properties of every CDF:
- non-decreasing;
- right-continuous;
- and .
Examples:
- : and .
- : on .
- 1. Exp(1): F(1) = ?
- 2. Uniform(0,1): P(0.2 < X ≤ 0.5) = ?
- 3. The density is the ___ of the CDF.
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.Quantiles
The quantile function is (the generalized inverse). It works even when jumps or is flat.
- The median is . For , it’s .
- Tail percentiles (the 95th, the 99.9th) set safety margins and real-time deadlines, where means are useless.
Change of variables
If with monotone and differentiable, then
The factor rescales lengths. For example, with is log-normal, with . For non-monotone , sum over branches, or go through the CDF.
Sampling from any distribution
- Inverse transform: if , then has CDF . For an exponential, .
- Rejection sampling: if , propose and accept with probability . The acceptance rate is .
- 1. The median of Exp(1) is…
- 2. Inverse-transform sampling of Exp(λ) uses…
- 3. Rejection sampling accepts a fraction…
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.Proofs
- Interval rule. , so . ∎
- CDF properties. Monotone because . Right-continuity and the limits follow from continuity of probability (A4.1-1) along decreasing or increasing events. ∎
- Change of variables (increasing ). . Differentiating with the chain rule gives . For decreasing , the sign flips, hence the absolute value. In several dimensions the factor becomes (A3.2-5, A3.2-8). ∎
- Inverse transform. For continuous strictly increasing , . With the generalized inverse it holds for every . ∎
The probability integral transform
Conversely, if has a continuous CDF , then . This is the basis of goodness-of-fit tests (Kolmogorov–Smirnov), of calibration checks (are predicted CDF values uniform?), and of copulas, which separate a joint distribution’s marginals from its dependence.
Exercise 3.1: Find the density of Y = X² for X ~ Uniform(0, 1)
, so on . That’s unbounded near 0, yet it integrates to 1.
- 1. If X has a continuous CDF F, F(X) is…
- 2. The density of X² for X ~ U(0,1)?
- 3. In n dimensions, the change-of-variables factor is…
Level 4: Expert
★★★★★ Expert⏱ 45 minResearchers: original papers and open problems.Simulation engines: sampling and checking
Monte Carlo reliability and mission-risk studies sample component lifetimes from fitted distributions. They often use Weibull, , with inverse . Shape models infant mortality, random failures, and wear-out (the bathtub curve). Heavy-tailed noise such as Cauchy or Student-t is sampled the same way to stress-test estimators. Every sampler should be checked with a Kolmogorov–Smirnov distance against its target (A3.5-2’s DKW bound).
CDFs in AI and robotics
- Normalizing flows chain invertible maps and track densities with the change-of-variables formula. Inverse autoregressive and spline flows are built from 1-D monotone CDF-like transforms (Rezende and Mohamed, 2015; Durkan et al., 2019).
- Calibration and conformal prediction. Probabilistic forecasts are calibrated when PIT values are uniform (Gneiting, Balabdaoui and Raftery, 2007). Conformal prediction uses empirical quantiles of residuals to give distribution-free prediction intervals (Angelopoulos and Bates, 2023), for example for safe robot planning.
- Risk-sensitive control and RL. Distributional RL learns the return’s quantile function (Dabney et al., 2018). Value-at-risk and CVaR are quantile-based objectives for safe planning (Majumdar and Pavone, 2020).
- Real-time systems. Control-loop deadlines use high latency percentiles from the empirical CDF (Practice Code 5).
References
- D. Bertsekas, J. Tsitsiklis (2008). Introduction to Probability, 2nd ed., Ch. 3–4. Athena Scientific.
- L. Devroye (1986). Non-Uniform Random Variate Generation. Springer.
- W. Weibull (1951). “A statistical distribution function of wide applicability.” Journal of Applied Mechanics, 18.
- D. Rezende, S. Mohamed (2015). “Variational inference with normalizing flows.” ICML.
- C. Durkan, A. Bekasov, I. Murray, G. Papamakarios (2019). “Neural spline flows.” NeurIPS.
- T. Gneiting, F. Balabdaoui, A. Raftery (2007). “Probabilistic forecasts, calibration and sharpness.” JRSS B, 69(2).
- A. Angelopoulos, S. Bates (2023). “Conformal prediction: a gentle introduction.” Foundations and Trends in ML, 16(4).
- W. Dabney, M. Rowland, M. Bellemare, R. Munos (2018). “Distributional reinforcement learning with quantile regression.” AAAI.
- A. Majumdar, M. Pavone (2020). “How should a robot assess risk? Towards an axiomatic theory of risk in robotics.” Robotics Research (ISRR 2017), Springer.