Random Variables
Senior 6 · Mathematics
Random Variables
Lesson 1 of 5
35 min
In S5 you found probabilities of events: "a head", "a total of 7", "a defective bulb". Often what matters is a number attached to the outcome: how many seeds in a packet germinate, how many customers reach a mobile-money agent in an hour, how long a phone battery lasts. A quantity like this, whose value depends on chance, is a random variable. Its distribution says which values it can take and how likely each is. Insurance premiums, quality control in factories and the planning of hospital beds all rest on distributions.
Definition
A random variable is a function that assigns a real number to each outcome of a random experiment. Capital letters () name random variables; small letters () name their values.
Example: toss three coins and let be the number of heads. The outcome HTH gives ; the possible values are .
Definition
The probability mass function (pmf) of a discrete random variable is . It satisfies
The cumulative distribution function (cdf) of any random variable is defined for every real by
For a discrete , : a staircase that jumps by at each value .
Worked example 1: three coins
Three fair coins are tossed and is the number of heads. Find the pmf and the cdf of , and .
Solution. The 8 outcomes are equally likely. only for TTT; for HTT, THT, TTH; for HHT, HTH, THH; only for HHH.
| 0 | 1 | 2 | 3 | |
|---|---|---|---|---|
| 1 |
In full, for , for , for , for , and 1 for . Finally .
Important
Properties of a cdf
Reason for the second: the events and are mutually exclusive and together make , so .
Worked example 2: finding a constant
A random variable has for . Find , and .
Solution. The probabilities must add up to 1: , so . Then , and .
Worked example 3: from the cdf to the pmf
Two fair dice are rolled and is the larger of the two scores (the common score if they are equal). Find for , and hence the pmf.
Solution. means both dice show at most . The dice are independent, so . Then
Check: . The largest score is most likely to be 6, with probability .
Warning
is defined between the values too. In worked example 1, , not "undefined" and not 0.
Watch and for discrete variables. but ; they differ by . In worked example 1 they are and .
Tip
Before any other work, check that the table of a pmf adds up to exactly 1. Most errors in this topic, a missing outcome or a counting slip, show up at once in that sum.
Khan Academy: Random variables (about 10 min). Watch how a random variable maps each outcome to a number, and why a count is discrete while a measurement such as a mass is continuous.
Practice
Questions 1 to 3 are routine; 4 to 6 need more care; 7 asks you to explain.
Sources and credits