M5.7.1 Chapter 1
Random variables
If you throw two dice and add the scores, which total comes up most often, and what total should you expect?
Your guess
Pick one before you read on. It is fine to be wrong.
By the end you can
- Make a probability table for a discrete random variable
- Find the expected value of a random variable
- Say why an expected value is a balance point and not a likely value
Chance gives us a number in many places. It may be the total of two dice, the number of seeds out of ten that grow, or the number of buses that pass in an hour. Each of these is a random variable. We name it with a capital letter such as X. A small letter x stands for one of the values it may take.
A random variable is discrete when its values can be listed one by one, such as 0, 1, 2, 3. The number of heads in three tosses is discrete. A waiting time is not, because it can take any value along a stretch of the number line. Chapter 4 meets that kind. Until then every variable here is discrete.
The probability distribution of X lists every value x with its probability P(X = x). Two rules always hold. Each probability is from 0 to 1. And all the probabilities add up to 1, because X must take one of its values.
Draw it first
Draw the distribution of the total of two dice
1 Put each total, 2 to 12, under its own bar. Each bar is as high as its probability, from 1/36 for the total 2 up to 6/36 for the total 7.
2 The bar for 7 is the tallest. Six of the 36 equally likely pairs of scores make 7, so P(X = 7) = 6/36 = 1/6.
To make a table, list the values and find the probability of each. Let X be the number of heads in three tosses of a fair coin. The tree shows all 8 outcomes. They are equally likely, so each has probability 1/8. The hatched ends are the outcomes with X = 2.
Worked example
X is the number of heads in three tosses of a fair coin. Make a probability table for X.
- X can be 0, 1, 2 or 3.
- The tree has 2 × 2 × 2 = 8 ends. Each end has probability 1/2 × 1/2 × 1/2 = 1/8.
- Count the ends for each value. X = 0 only for TTT. X = 1 for HTT, THT and TTH. X = 2 for HHT, HTH and THH. X = 3 only for HHH.
- So the probabilities are 1/8, 3/8, 3/8 and 1/8.
- Check that they add to 1: 1/8 + 3/8 + 3/8 + 1/8 = 8/8 = 1.
Answer: For x = 0, 1, 2, 3 the probabilities are 1/8, 3/8, 3/8 and 1/8.
The rule that the probabilities add to 1 lets you find one that is missing. Sometimes a rule gives the probabilities, with an unknown number in it. Add the probabilities, put the sum equal to 1, and solve for the unknown.
Worked example
The chance that X takes each of the values 1, 2, 3 and 4 is in proportion to the value. So P(X = x) = kx for some number k. Find k.
- The probabilities are k, 2k, 3k and 4k.
- They add to 1, so k + 2k + 3k + 4k = 1.
- That is 10k = 1, so k = 1 ÷ 10 = 0.1.
- So P(X = 1) = 0.1, P(X = 2) = 0.2, P(X = 3) = 0.3 and P(X = 4) = 0.4.
- Check: 0.1 + 0.2 + 0.3 + 0.4 = 1.
Answer: k = 0.1
Now the expected value. Suppose you could repeat the chance a very large number of times and take the mean of all the values of X. That mean settles down to a fixed number, the expected value E(X), also called the mean of X and written μ. To find it, multiply each value by its probability and add: E(X) = Σ x P(X = x).
Worked example
X takes the values 1, 2, 3 and 4 with probabilities 0.1, 0.2, 0.3 and 0.4. Find E(X).
- Multiply each value by its probability: 1 × 0.1 = 0.1, 2 × 0.2 = 0.4, 3 × 0.3 = 0.9 and 4 × 0.4 = 1.6.
- Add the four products: 0.1 + 0.4 + 0.9 + 1.6 = 3.
- So E(X) = 3.
Answer: E(X) = 3
Think of each bar as a weight on a beam, with the beam resting on one point. The beam balances where the mean is. That is why E(X) is not always the middle value: a heavy bar far out pulls the balance point towards it.
Worked example
X is the score on one throw of a fair die. Find E(X). Can the die show this value?
- Each score from 1 to 6 has probability 1/6.
- E(X) = 1 × 1/6 + 2 × 1/6 + 3 × 1/6 + 4 × 1/6 + 5 × 1/6 + 6 × 1/6 = (1 + 2 + 3 + 4 + 5 + 6) × 1/6.
- The scores add to 21, so E(X) = 21 ÷ 6 = 3.5.
- No throw scores 3.5. The expected value is a mean over many throws. It does not have to be a score you can get.
Answer: E(X) = 3.5. The die cannot show this value.
See it three ways
With things
A bag holds 10 stones. One stone is marked 1, two are marked 2, three are marked 3 and four are marked 4. Pick one without looking. The mark on it is X.
As a picture
In words
A probability distribution lists every value of X with its chance. The chances add to 1.
In symbols
P(X = x) = x/10 for x = 1, 2, 3, 4, and 0.1 + 0.2 + 0.3 + 0.4 = 1. E(X) = Σ x P(X = x) = 3.
Try it
Add the scores of two bags
You need: 12 small slips of paper, two bags or two cups, a pencil.
- Write the numbers 1 to 6 on six slips and put them in one bag. Do the same for the other bag.
- Take one slip from each bag, add the two numbers, and put the slips back. Mark the total with a tally stroke.
- Do this 36 times. Then look at which totals have the most strokes.
- Compare your strokes with the table of pairs. The total 7 should be the tallest, and 2 and 12 the shortest.
What you will see: Your counts will not match the table exactly, because the draws are random. The more draws you make, the closer the strokes come to the shape of the table.
A wrong idea many people have
The expected value is the value that X is most likely to take.
Why it feels right: In everyday speech, "expect" means "think will happen". So E(X) sounds like the best guess for the next result.
The test that breaks it: Take X as the number of heads in three tosses. E(X) = 0 × 1/8 + 1 × 3/8 + 2 × 3/8 + 3 × 1/8 = 12/8 = 1.5. But P(X = 1.5) = 0, because X can only be 0, 1, 2 or 3.
What is true: The expected value is the mean of many results, and the balance point of the bars. It can be a value that X can never take. The most likely value is a different thing, called the mode.
A wrong idea many people have
Any list of numbers between 0 and 1 is a probability distribution.
Why it feels right: A probability must be from 0 to 1, so a list of such numbers looks fine.
The test that breaks it: Take the probabilities 0.6, 0.7 and 0.5 for the values 1, 2 and 3. Each is from 0 to 1. But 0.6 + 0.7 + 0.5 = 1.8, so X would take one of its values with probability 1.8.
What is true: Each probability must be from 0 to 1 and the probabilities must add to exactly 1. Always add them as a check.
Key words
- random variable
- a number that depends on chance, such as the total of two dice. It is named with a capital letter, X.
- discrete
- a variable whose values can be listed one by one, such as 0, 1, 2, 3.
- probability distribution
- a list of every value of X with its probability. The probabilities add to 1.
- expected value
- the mean of X over very many repeats, E(X) = Σ x P(X = x). It is the balance point of the bars.
Back to your guess
The answer is C: The total 7 is the most likely, because more pairs of scores make it.
The total 7 comes up most often. Six of the 36 equally likely pairs of scores make it: 1 and 6, 2 and 5, 3 and 4, and the same three the other way round. The totals 2 and 12 are made by only one pair each. The expected total is also 7, because the bars are symmetric about 7. A list of every total with its chance is a probability distribution.
Check yourself
Try each one before you look. A wrong answer tells you where to go next.
X takes the values 1, 2, 3 and 4 with the probabilities in the table. One probability is hidden by c. Find c.
See the answer
0.3
The probabilities add to 1, so c = 1 − (0.1 + 0.35 + 0.25) = 1 − 0.7 = 0.3.
- If you chose A: You added the three given probabilities, and 0.1 + 0.35 + 0.25 = 0.7. That is the total they already use. The hidden probability is what is left to reach 1. Read this page again.
- If you chose B: That is the probability of the first value. The hidden one is 1 minus the sum of the others. Read this page again.
- If you chose C: You added the given probabilities to 1. A probability cannot be above 1. Take them away from 1. Read this page again.
X takes the values 1, 2 and 3 with probabilities 0.5, 0.3 and 0.2. What is E(X)?
See the answer
1.7
E(X) = 1 × 0.5 + 2 × 0.3 + 3 × 0.2 = 0.5 + 0.6 + 0.6 = 1.7.
- If you chose B: That is the mean of the three values, 1, 2 and 3, as if each were equally likely. The probabilities are not equal, so each value must be weighted by its probability. Read this page again.
- If you chose C: You added the values. Multiply each value by its probability first, then add. Read this page again.
Which of these lists could be the probabilities of the four values of a random variable?
See the answer
0.4, 0.3, 0.2, 0.1
The probabilities must each be from 0 to 1 and add to 1. Only 0.4 + 0.3 + 0.2 + 0.1 = 1 does both.
- If you chose A: Each is from 0 to 1, but the four add to 1.2. They must add to 1. Read this page again.
- If you chose C: These add to 1, but a probability cannot be negative. Read this page again.
- If you chose D: This list has only three numbers, and they add to 0.75. Four values need four probabilities that add to 1. Read this page again.
For one fair die, E(X) = 3.5. What does that tell us?
See the answer
The mean of very many throws will be close to 3.5.
The expected value is the long run mean. Single throws vary, but their mean over many throws settles near 3.5.
- If you chose A: A die cannot show 3.5. Its scores are 1 to 6. Read this page again.
- If you chose B: The expected value says nothing sure about one throw. Any score from 1 to 6 may come. Read this page again.
X is the number of heads in three tosses of a fair coin. What is P(X = 2)?
See the answer
3/8
Three of the 8 equally likely outcomes have exactly two heads: HHT, HTH and THH. Each has probability 1/8, so P(X = 2) = 3/8.
- If you chose B: That is the chance of one outcome such as HHT. Two heads in three tosses can happen as HHT, HTH and THH. Go to M4.6.4.
- If you chose C: You divided the number of heads by the number of tosses. That is not a probability of X = 2. Read this page again.
Which of these is a discrete random variable?
See the answer
The number of eggs in a nest.
A count takes separate values: 0, 1, 2, 3 and so on. Times and masses can take any value in a range, so they are not discrete.
- If you chose A: A time can be any value along a stretch, such as 24.37 minutes. It is not a list of separate values. Read this page again.
- If you chose C: A mass can be any value along a stretch. It is not a list of separate values. Read this page again.
X takes the values 10, 20, 30 and 40 with probabilities 0.1, 0.4, 0.3 and 0.2. Find E(X).
See the answer
26
E(X) = 10 × 0.1 + 20 × 0.4 + 30 × 0.3 + 40 × 0.2 = 1 + 8 + 9 + 8 = 26.
X takes the values 0, 1, 2 and 3. The probabilities of 0, 1 and 2 are 0.15, 0.4 and 0.3. Find P(X = 3).
See the answer
0.15
The four probabilities add to 1, so P(X = 3) = 1 − (0.15 + 0.4 + 0.3) = 1 − 0.85 = 0.15.
A spinner gives 1, 2 or 5 points with probabilities 0.5, 0.3 and 0.2. Find the expected number of points on one spin.
See the answer
2.1
E(X) = 1 × 0.5 + 2 × 0.3 + 5 × 0.2 = 0.5 + 0.6 + 1 = 2.1 points.
P(X = x) = 0.1x for x = 1, 2, 3 and 4. Find P(X ≥ 3).
See the answer
0.7
X ≥ 3 means X = 3 or X = 4. So P(X ≥ 3) = 0.3 + 0.4 = 0.7.
Keep it
Copy this into your exercise book.
Probabilities add to 1. E(X) = Σ x P(X = x). Multiply each value by its probability, then add. E(X) is the long run mean and the balance point. It need not be a possible value.
Draw: A bar chart of a distribution with a triangle under the balance point, named mean.