TwiddleLab / Math / Probability by Simulation
Project: Design a Fair Game
What you will learn
- A game is fair when the average prize equals the ticket: prize × chance = ticket.
- Count winning outcomes carefully: a cell in two events counts once.
- For two-step games, multiply along the winning path of the tree, then prize = ticket / chance.
How the lesson goes
Invent a dice game for the school fair. Tempting, but exactly fair.
And prove it, two ways.
Design your game.
Pick one die or two. Paint the outcomes that win a prize.
Every cell of the grid is equally likely, so your chance to win is the painted cells / all cells.
Try a $10 prize on the seesaw.
Drag the pivot until the plank is level. That is the average prize per player.
The average prize is $10 × chance + $0 × (1 − chance) = $10 × chance.
Dial the prize until the pivot sits on the $2 ticket.
Fair means exactly $2. If no prize works to the cent, change your cells on the small grid.
Fair: prize × k/N = $2, so prize = 2N/k. With N = 36 that is 72/k, a whole number of 10 cents only when k divides 720 (for example 4, 6, 8, 9, 10, 12 cells).
10 000 players pay $2 each. Where does your cash box end?
Your game is fair. Drag the pin to your bet.
Open the stall: 10 000 players.
Each one pays $2 and plays your game. Watch the cash box and the average prize.
Pip's stall: total 10 or a double. Pip says 9 ways, prize $8.
Something is counted twice. Tap the cell Pip counted twice.
Total 10 has 3 cells and doubles have 6, but 5 and 5 is in both. P(A or B) = 3/36 + 6/36 − 1/36 = 8/36. Fair prize: $2 × 36 / 8 = $9.
Challenge: three two-step games.
Read each tree, set the fair prize, then Test. Three lives.
Each game wins only on one path. Its chance is the product of the two branches, and the fair prize is $2 divided by that chance.
Your game in five lines of Python.
random_number(1, N) picks one of your outcomes; the first k of them win. What average prize will it print?
Each pass wins the prize with chance k/N. Over 10 000 passes the average is close to prize × k/N, which you made exactly $2.
Your game is fair. Which change keeps it fair?
The average prize is prize × chance. Doubling the chance and halving the prize multiplies it by 2 × 1/2 = 1, so it stays at the ticket.
Name your stall and print its card.
Pick a name and a sign color. The card carries both proofs.
Previous lesson: Shapes of Randomness · Part of the course: Probability by Simulation
Lessons are interactive and need JavaScript. Turn it on to play them.