Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Putting a number on chance
When you roll two dice, you often don’t care about the exact pair, only the total. When you toss 10 coins, you might only care how many came up heads. A rule that turns each random outcome into a number is a random variable.
Some random variables jump between separate values: a dice total, a count of heads. Those are discrete. Others can be any value in a range: a height, a time, a temperature, how far a dart lands from the bullseye. Those are continuous.
A robot doesn’t know its joint angles exactly. Each one is a random variable, so the position of its hand, a function of those angles, is random too. Engineers need to know that distribution to decide whether the gripper will safely clear an obstacle.
- 1. The number of heads in 2 tosses can be…
- 2. A person's exact height is…
- 3. A random variable turns outcomes into…
Level 1: Beginner
★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.Definition and distribution
A random variable is a function . Its distribution tells you for sets of values: . You find it by collecting the outcomes that give each value.
Example: for on two dice, and .
| Type | Probability lives on | Described by | Example |
|---|---|---|---|
| discrete | points | PMF | dice sum, # defects |
| continuous | intervals | density : | waiting time, sensor noise |
| mixed | both | CDF (A4.1-6) | censored lifetime |
For a continuous , for every single . A density value is a probability per unit length, and it can exceed 1.
- 1. P(sum of two dice = 5) = ?
- 2. For a continuous X, P(X = 2.5) = ?
- 3. Can a density value exceed 1?
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.Functions of random variables
If is a random variable and is a function, then is a random variable. For discrete , . For continuous , work through the CDF: , then differentiate (A4.1-6).
Indicators: events as random variables
if , else 0. It’s a discrete random variable with . Counts are sums of indicators. “How many of these 253 people share my birthday?” is , so its expectation is even though the events are dependent. That’s linearity of expectation (A4.1-7).
A continuous example from geometry
Throw darts uniformly at a unit disk, and let be the distance from the centre. Then , so the density is . Darts land far out more often because the outer rings have more area. This is a frequent bug in “uniform disk” sampling: taking uniform clusters points at the centre. The fix is .
- 1. E[1_A] = ?
- 2. Uniform darts on a disk: P(R ≤ 0.5) = ?
- 3. To sample uniformly in a disk with polar coordinates, take r = …
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.Measurability
Formally, a random variable must be measurable: for every , so its probability is defined. All functions you’ll meet in practice (continuous, piecewise, limits of such) are measurable. The distribution is the pushforward of by . Once you have it, you can usually forget entirely.
Why P(X = x) = 0 doesn’t mean “impossible”
For a continuous , every exact value has probability 0, yet some value happens. Countable additivity isn’t violated, because there are uncountably many values. Probability 0 means “never happens” only for countably many alternatives.
Mixed random variables
A battery test stops at time . The observed is continuous below with an atom . Neither a PMF nor a density describes it alone. The CDF does (A4.1-6). Censoring is everywhere in reliability, survival analysis and RL episode cut-offs.
Exercise 3.1: Find the PMF of the maximum of two dice
, so .
- 1. The distribution of X is the ___ of P.
- 2. min(L, T) for an exponential L is…
- 3. P(max of two dice = 6) = ?
Level 4: Expert
★★★★★ Expert⏱ 45 minResearchers: original papers and open problems.Uncertainty propagation through nonlinear maps
A 2-link arm’s joint angles are uncertain, , from encoder noise or calibration error. The hand position is then a random variable. There are two ways to describe it:
- Linearization (EKF-style) approximates , giving . It’s accurate for small noise.
- Monte Carlo samples the exact distribution. For large noise this is a curved “banana” that can’t exceed the arm’s reach. Its mean is shifted toward the base, which linearization misses.
The unscented transform (Julier and Uhlmann, 2004) and particle methods exist because of this. Long et al. (2012) showed the “banana distribution” of robot poses, and Barfoot (2017) treats propagation on rotation groups.
Random variables across engineering and AI
- Reparametrization. Writing with expresses a random variable as a deterministic function of a fixed one. That lets gradients flow through sampling (Kingma and Welling, 2014, VAEs).
- Generative models and normalizing flows are functions of random variables: . Their density follows from the change-of-variables formula (A4.1-6, A3.2-8).
- Sensor models treat a measurement as a random variable . Its distribution is the likelihood that Bayes filters use (A4.1-3).
- Reliability data are often censored (mixed type). Ignoring the atom biases lifetime estimates. Survival analysis (Kaplan and Meier, 1958) handles it.
References
- D. Bertsekas, J. Tsitsiklis (2008). Introduction to Probability, 2nd ed., Ch. 2–3. Athena Scientific.
- G. Grimmett, D. Stirzaker (2020). Probability and Random Processes, 4th ed. Oxford.
- S. Julier, J. Uhlmann (2004). “Unscented filtering and nonlinear estimation.” Proceedings of the IEEE, 92(3).
- A. Long, K. Wolfe, M. Mashner, G. Chirikjian (2012). “The banana distribution is Gaussian: a localization study with exponential coordinates.” RSS.
- T. Barfoot (2017). State Estimation for Robotics. Cambridge.
- D. Kingma, M. Welling (2014). “Auto-encoding variational Bayes.” ICLR.
- E. Kaplan, P. Meier (1958). “Nonparametric estimation from incomplete observations.” JASA, 53.