High School Mathematics · Grades 10–12
18Probability and Random Variables
Probability models experiments whose outcome is uncertain: a die roll, a card drawn, a game played. This chapter sets up the vocabulary on finite sets, then introduces the central character of all of probability theory: the random variable and its expectation. These notions are reviewed and deepened in Chapter 33, and conditional probabilities follow in Chapter 32.
18.1 Probability on a finite set
Definition 18.1 (Probability model)
An experiment with finitely many outcomes is modelled by its sample space (the set of outcomes) together with a probability assigning to each outcome a number , with . An event is a subset , and
When all outcomes are equally likely (: the uniform model),
Example 18.2
Roll two distinguishable dice: is the set of the ordered pairs with , all equally likely. The event = “the sum is ” contains the pairs , , , , , , so . The event “the sum is ” contains only : probability . Choosing the right sample space — ordered pairs, not unordered — is what makes the uniform model applicable.
Proposition 18.3 (Rules of probability)
For events :
where is the complement of (all outcomes not in ). In particular, when and are incompatible ().
Proof. The empty event contains no outcome (empty sum), and contains them all (total sum ). Every outcome is in exactly one of , , so . For the union: summing the over and then over counts the outcomes of twice; subtracting corrects the double count. ∎
Example 18.4
In a class, study music (), play a sport (), and do both. The proportion doing at least one is , so do neither (complement).
18.2 Random variables
Definition 18.5 (Random variable, distribution)
A random variable on is a function assigning a number to each outcome. Its distribution is the table of its possible values together with their probabilities
Example 18.6
A game: pay euros, roll one fair die, receive the value shown if it is at least , nothing otherwise. Let be the gain (received minus paid). The outcomes give ; the outcome gives ; the outcome gives . The distribution of :
Method 18.7 (Building a distribution table)
List the possible values of ; for each value, collect the outcomes producing it and add their probabilities; check that the row of probabilities sums to .
18.3 Expectation
Definition 18.8 (Expectation)
The expectation (or mean) of is the average of its values weighted by their probabilities:
Remark 18.9
is what the mean of a huge number of independent repetitions of the experiment would be — the precise version of this statement is the law of large numbers, proved in Chapter 34. Note the formal analogy with the mean of a dataset with frequencies (Definition 17.1): probabilities play the role of the relative frequencies .
Example 18.10
For the game of Example 18.6:
On average the player loses about cents per game: the game is unfavorable. A game is called fair when the expected gain is .
Proposition 18.11 (Linearity)
For all reals :
18.4 Variance and standard deviation
Definition 18.12 (Variance)
The variance of measures the spread of its values around the expectation :
Proposition 18.13 (Shortcut formula)
Proof. Expand inside the sum:
which is . This is the random-variable version of the identity proved for datasets in Proposition 17.7. ∎
Proposition 18.14 (Affine transformation)
and .
Proof. By linearity, deviates from its expectation by : every deviation is scaled by , hence every squared deviation by , and so is their weighted mean. The shift has disappeared — shifting a variable does not change its spread. ∎
Example 18.15
For the game of Example 18.6: , so
The loss of per game on average comes with swings of typical size euros — expectation without standard deviation tells only half the story.
18.5 Exercises
Exercise 18.1 ★
A card is drawn from a standard -card deck. Compute the probability of drawing: a heart; a king; a heart or a king; neither a heart nor a king.
Solution
Solution of Exercise 18.1.
Uniform model on cards. Hearts: . Kings: . Heart or king: (the king of hearts is counted once). Neither: .
Exercise 18.2 ★
Two fair dice are rolled and their sum is recorded. Using the -outcome model of Example 18.2, compute , and .
Solution
Solution of Exercise 18.2.
: the pairs , so .
: three pairs for , two for , one for : .
even: sums have pairs: probability .
Exercise 18.3 ★
A random variable has distribution
Find , then compute .
Solution
Solution of Exercise 18.3.
The probabilities sum to : . Then
Exercise 18.4 ★
satisfies and . Give the expectation, variance and standard deviation of .
Solution
Solution of Exercise 18.4.
; ; .
Exercise 18.5 ★★
A wheel of fortune has equal sectors: show euros, show euros, show euros. Playing costs euros. Give the distribution of the gain (winnings minus stake), compute , and decide whether the game is favorable.
Solution
Solution of Exercise 18.5.
The winnings are , , euros with probabilities , , ; subtracting the -euro stake, takes the values :
: the player loses cents per game on average — unfavorable.
Exercise 18.6 ★★
An urn contains red and blue balls; two balls are drawn without replacement. Let be the number of red balls drawn. Build the distribution of (enumerate the ordered draws, or use a tree), and compute .
Solution
Solution of Exercise 18.6.
Drawing in order: (red then red); (blue then blue); hence . Then
consistent with intuition: of the two draws are red on average.
Exercise 18.7 ★★
For the wheel of Exercise 18.5, compute and .
Solution
Solution of Exercise 18.7.
, so by the shortcut formula and euros.
Exercise 18.8 ★★
An insurance company sells a policy for euros. With probability the client claims euros, with probability the client claims euros, otherwise nothing. Let be the company’s benefit on one policy. Give the distribution of , compute , and interpret.
Solution
Solution of Exercise 18.8.
The benefit is minus the claim:
: at this price the company loses euros per policy on average. The premium is too low for the risks covered (it would need to exceed euros for a positive expected benefit).
Exercise 18.9 ★★
A multiple-choice question has answers, one correct. A correct answer scores ; to discourage guessing, a wrong answer scores . A student answers at random. For which value of is the student’s expected score zero?
Solution
Solution of Exercise 18.9.
The random score is with probability and with probability :
With the penalty , random guessing brings nothing on average.
Exercise 18.10 ★★
Two fair coins are tossed. Ann proposes: “if both coins match, I pay you euro; if they differ, you pay me euro.” Compute the expected gain of each player. Is the game fair? Same question with three coins, where Ann pays euros if all three match.
Solution
Solution of Exercise 18.10.
Two coins: they match (HH or TT) with probability . The player’s gain is or with equal probabilities: expectation for both players — the game is fair.
Three coins: all match (HHH or TTT) with probability . The player receives with probability and pays with probability : . The game favours Ann by cents per round; it would be fair if she paid euros for a triple match.
Exercise 18.11 ★★★
A lottery sells tickets at euros each. One ticket wins euros, five tickets win euros, twenty tickets win euros.
- Give the distribution of the organizer’s total revenue minus prizes, and of a single player’s gain .
- Compute and the total expected profit of the organizer. Check that the two answers are consistent.
Solution
Solution of Exercise 18.11.
1. The organizer receives euros and pays out euros in all: the profit is the constant (no randomness once all tickets are sold). A single player’s gain (prize minus the -euro ticket):
2.
Each player expects to lose euros; over players that is euros — exactly the organizer’s profit. The books balance: what the players lose on average is precisely what the organizer collects.
18.6 Problem: The unfinished game
Problem 18.1
Weekend problem — Pascal, Fermat and the fair split of an interrupted bet: the birth of expectation, the magic of linearity, and what expectation cannot see
In 1654 the Chevalier de Méré — the same gambler whose dice bets opened the Middle School volume’s probability problem — asked Blaise Pascal a deeper question: two equally skilled players must stop their series at the score of to , six wins taking the -pistole pot. How should the pot be split fairly? The letters between Pascal and Fermat answering it founded the concept at the heart of this chapter: expectation (Definition 18.8). You will re-derive their answer both ways, then meet linearity’s party trick and expectation’s one blind spot.
Part I — Expectation fluency.
- Roll a fair die; your gain is (face ) euros. Build the distribution table of the gain (Method 18.7) and compute .
- Compute with the shortcut formula (Proposition 18.13) and (two decimals).
- Without any new table, give and (Proposition 18.14).
- A stall charges euros to roll two dice and pockets you the sum in euros. What is the fair price ? The stall charges : what is your expected loss per game?
- A laptop worth euros has a chance of destruction each year. Compute the fair insurance premium, and the insurer’s expected profit per policy if it charges euros.
Part II — Splitting the pot. Score –, first to wins the pistoles, rounds are fair coin flips.
- Two tempting wrong answers: split (proportionally to rounds won), or give everything to the leader. Say in one sentence each what is unfair about them.
- Fermat’s method: player A needs more win, B needs ; imagine playing exactly more rounds regardless. List the equally likely outcomes, mark who wins the series in each, and deduce the fair split of the pistoles.
- The subtle point Fermat had to defend: the real game might stop after one round — why is it nevertheless legitimate to reason on all imaginary rounds?
- Pascal’s method, backwards from the end: compute A’s fair share at the (hypothetical) scores –, then –, then –, each time averaging the two equally likely futures. Compare with question 7.
- Same question at the score –: how many imaginary rounds, which outcomes give B the series, and what is the fair split?
- State the principle the two methods share — the fair value of an uncertain future is its expectation — and name two modern industries running entirely on it (question 5 shows one).
- A sanity check for every score: explain, with the linearity of expectation (Proposition 18.11), why the two players’ fair shares must always add up to exactly the -pistole pot.
Part III — Linearity’s party trick.
- Recover in one line with linearity (Proposition 18.11), no -cell table. For the variance of the sum, the rule needs the dice to be independent (admitted): compute it.
- The hat-check party: guests throw their hats in a pile and each takes one back at random. Let count the guests who recover their own hat. For one fixed guest, what is the probability of recovering their own hat? Summing these chances (linearity!), compute . The answer should surprise you: it does not depend on .
- Verify by brute force for and (list the and equally likely hat-assignments and average the counts).
- The guests’ recoveries are far from independent (if guests got their own hats back, the last one must too). Where exactly did question 14’s computation not require independence? State linearity’s superpower.
Part IV — What expectation cannot see.
- Two -euro scratch cards: card A wins euros with probability ; card B wins euros with probability . Check that both gains have the same expectation, then compute both variances. Which card do real people buy, and what are they buying?
- The St Petersburg game: flip until the first tails; if the first tails occurs at flip you receive euros. Compute the contribution of each to the expectation and the expectation itself. Would you pay euros to play once? What does the clash teach about expectation?
- Insurance from the customer’s side: pay euros, or face a risk of losing ? Compare the two expectations, and explain why buying the insurance can still be rational (what can a single family not “average over”?).
- Finale — expectation’s biography, one sentence per chapter: born in 1654 to split a pot; its superpower, linearity, which adds expectations without asking independence (the hats); its blind spot, risk, which variance measures (cards, St Petersburg, insurance); and its coronation next year, when the law of large numbers explains exactly why the house always wins.
Solution
Solution of Problem 18.1.
1. takes , each with probability : euro.
2. ; ; .
3. ; .
4. : fair price euros. At , the expected loss is euro per game.
5. Fair premium: euros. Charging : expected profit euros per policy.
6. Splitting rewards the past — but the pot belongs to whoever wins the future, and B might still win. Giving all to A treats a probable win as certain — B’s small chance is worth something.
7. Rounds to play: ; outcomes (A-win/B-win per round): AAA, AAB, ABA, ABB, BAA, BAB, BBA, BBB. Player B takes the series only by winning all three: BBB alone. A wins the series in of cases: fair split pistoles for A, for B.
8. Playing the extra, pointless rounds changes nobody’s victory: once A has her sixth win, later rounds are ceremony. But fixing the horizon at exactly rounds makes all outcomes equally likely — honest counting needs same-length stories, and padding them out costs nothing.
9. At –: one deciding round, each. At –: A gets . At –: the next round leads to (A wins it) or to the – position worth : A’s share — Fermat’s , re-derived by walking backwards.
10. A needs , B needs : play imaginary rounds ( outcomes). B takes the series with or B-wins: outcomes. Split: : ; : .
11. The fair present value of an uncertain future payoff is its expectation — probability-weighted average of what may come. Insurance (question 5) and finance (pricing uncertain payoffs) are this sentence turned into industries; so are casinos, from the other side of the table.
12. The pot always ends up somewhere: the two shares are random variables summing to the constant , so by linearity — fair shares exhaust the pot, at every score.
13. Linearity: , table-free — true even for glued-together dice. Variance of one die: ; for independent dice .
14. Each fixed guest recovers their own hat with probability (their hat is one among ). Summing over the guests: — one lucky guest on average, whether the party has two hats or two thousand.
15. : assignments: both right () or swapped (): . : the six assignments give : .
16. The computation added the expectations of the individual indicators (“guest got their hat”), and linearity adds expectations unconditionally — dependence would wreck a product or a variance, but never a sum of expectations. That is linearity’s superpower: no independence questions asked.
17. Both gains: and . Variances (of the gain): A: ; B: : , . People buy B: what they purchase is not expectation (zero in both) but the spread — a small chance of a life-changing right tail.
18. First tails at flip has probability and pays : each contributes to the expectation, which is therefore : infinite. Yet no sane person pays to play once: with probability the payout is at most . Expectation summarizes the long run of repeatable bets; a once-in-a-lifetime game with a wild tail is not priced by its mean.
19. Expectations: insure ; go bare . The naked strategy wins on average — for someone who can absorb the loss and repeat the bet many times. A family that cannot survive the is not in the averaging business: it pays extra to delete the variance. Insurers average; households buy certainty.
20. Born splitting a pot between two impatient gamblers; empowered by linearity, which sums hopes without asking permission of dependence; blind to risk, which variance — the lotteries, the Petersburg game, the family’s policy — must measure instead; and crowned next year by the law of large numbers, which explains why the averages always, eventually, collect.