TwiddleLab / Math / Probability by Simulation
The Long-Run Average
What you will learn
- The expected value is the long-run average per game: add up each outcome × its chance.
- It is the balance point of the winnings, with each one weighted by its chance.
- A fair game has an expected value of 0. Pay $1 to win $5 on a 6: −$0.17 a game, so not fair.
How the lesson goes
Pay $1 to play. Roll a 6 and win $5.
Should you play all night? Play ten games first.
Put the game on a seesaw.
Each result is a weight: −$1 is 5/6 tall, +$4 is 1/6 tall. Drag the pivot until the plank is level.
The balance point is the weighted average: 5/6 × (−$1) + 1/6 × (+$4) = −5/6 + 4/6 = −1/6, about −$0.17.
Play all night: 1000 games.
The blue line is your average per game so far. Where does it settle?
Expected value.
The expected value of a game is its long-run average per game.
Multiply each outcome by its chance and add: 5/6 × (−$1) + 1/6 × (+$4) = −$0.17. It is the balance point of the seesaw.
A fair game has expected value $0: in the long run nobody wins or loses.
Make the game fair.
Turn the prize until the pivot sits on $0. Then the rule changes: try again.
Fair means the average prize equals the $1 you pay: prize × 1/6 = $1 gives $6, and prize × 2/6 = $1 gives $3.
Build your fair stall: a $2 ticket, one die.
Tap a face to put $1 on it. Make the average prize $1.50 to $2, with one big prize of $6 or more.
Each face comes up 1/6 of the time, so the average prize is the sum of the prizes / 6. Sums from $9 to $12 give $1.50 to $2.
Game: two slot machines.
An AI that picks between options faces this too. One machine pays more often. You have 20 pulls. Get 9 coins or more.
A machine's average coins per pull estimates its expected value. A few pulls on each tell them apart, then sticking with the better one wins most coins.
A raffle sells 100 tickets. One ticket wins $50. What is the expected prize per ticket, in dollars?
Expected value = $50 × 1/100 + $0 × 99/100 = $0.50.
Open your stall to 1000 players.
Each player pays $2 and wins the prize on the face they roll. Watch your cash box.
Previous lesson: Given That... · Next lesson: Shapes of Randomness · Part of the course: Probability by Simulation
Lessons are interactive and need JavaScript. Turn it on to play them.