Discrete vs continuous random variables
5 min read
Short answer
A random variable turns outcomes into numbers. It is discrete if it takes countable values (0, 1, 2, ...) described by a probability mass function , and continuous if it takes any value in an interval, described by a probability density function whose area gives the probability. For a continuous variable, for any single value.
Why a single point has probability zero
A continuous variable has infinitely many possible values, so each single value gets zero probability; only ranges have positive probability. is a density (probability per unit length), so it can even exceed 1 as long as the total area is 1. Because of this, for continuous variables.
Mean and variance in each case
The ideas are the same, with sums for discrete variables and integrals for continuous ones: versus .
Worked example
(a) Let be the number of heads in two fair flips. List its distribution. (b) If is uniform on , find and .
(a) , , . These add to 1. ✓
(b) The density is on , so . And : a single point has no width, so no area.
Try it yourself
Is the time you wait for a bus a discrete or a continuous random variable? What about the number of buses that pass in an hour?
Show the answer
Waiting time is continuous (it can be any value in an interval, like 3.27 minutes). The number of buses is discrete (0, 1, 2, ...).
Keep going with practice
Vidi's interactive distribution plot lets you switch between discrete and continuous distributions and compare their shapes.