CoursesAIMathCodePhysicsAbout and FAQ

TwiddleLab / Math / Probability by Simulation

The Long-Run Average

Lesson 9 of 11 · 7 min · Free, no account needed

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.

Start the lesson

How the lesson goes

  1. Pay $1 to play. Roll a 6 and win $5.

    Should you play all night? Play ten games first.

  2. 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.

  3. Play all night: 1000 games.

    The blue line is your average per game so far. Where does it settle?

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. 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.

  9. 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.

Loading TwiddleLab