Random Variables
Senior 6 · Mathematics
Random Variables
Lesson 4 of 5
40 min
The time a pupil takes to walk to school, the mass of a bag of maize flour, the lifetime of a light bulb: these quantities can take any value in an interval, not just whole numbers. The chance of exactly 12.000… minutes is zero, so a table of single values no longer works. Instead, probability is spread along the number line by a curve, the density, and the probability of an interval is the area under that curve. The integrals you learned in S5 and S6 do the work.
Definition
A random variable is continuous if there is a function , its probability density function (pdf), such that
Its cumulative distribution function is , and wherever is continuous. The median satisfies .
Example: if is equally likely to be anywhere in , then on that interval and 0 outside.
Important
Single values have probability zero. . So for a continuous , : strict and non-strict inequalities give the same answer. A density value is not a probability, and it may be greater than 1.
Mean and variance replace sums by integrals:
The rules and still hold.
Worked example 1: finding the constant, a probability, the mean and the variance
has pdf for , and otherwise. Find , , and .
Solution. , so and .
The graph is symmetric about , so . (Check: .) Next, , so and .
Worked example 2: the cdf and the median
has pdf for , and 0 otherwise. Find , the median, and .
Solution. For , ; for and for .
Median: , so and . . . The mean (1.5) is less than the median (1.587) because the density is heavier on the right and has a long tail to the left.
Worked example 3: a uniform waiting time
A bus passes a stop every 20 minutes, and a passenger arrives at a random moment, so the waiting time is uniform on . Find , and the standard deviation of .
Solution. on . . minutes. , so and minutes.
In general, the uniform distribution on has , mean and variance .
Warning
Integrate over the whole support. If is defined in pieces, must add the full areas of all the pieces to the left of .
is not . In worked example 2, , which is not a probability. Only areas under are probabilities.
Tip
Use symmetry before integrating. If the graph of is symmetric about , then and the median is also , as in worked example 1.
3Blue1Brown: Why “probability of 0” does not mean “impossible” (about 10 min). Watch how a density spreads probability over an interval so that every single value has probability zero, while areas, not heights, give probabilities.
Practice
Questions 1 to 3 are routine; 4 to 6 need more care; 7 asks you to explain.
Sources and credits