Expected value and fair games · Statistics & Data… | StemPy Lab
Course 3.3·Lesson 3 of 3
Expected value and fair games
The expected value of a game is the average gain per play in the long run: each outcome times its probability, added up. A game is fair when its expected gain is zero. A casino game is built with a small negative expected gain for the player, and a simulation shows the average settling exactly there.
about 25 min1 simulation1 practice question
Lesson 3 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
find the expected value of a game from its outcomes and their probabilities;
decide whether a game is fair, and find the prize that makes it fair;
explain the house edge of a casino game and confirm it by simulation.
A game at a school fair
A made-up stall at a school fair has a spinner with 8 equal sectors. One play costs 2 tokens. One sector pays 10 tokens, two sectors pay 3 tokens each and the other five pay nothing. Should you play?
Imagine 8 plays in which every sector comes up once. You pay 8×2=16 tokens. You win 10+3+3=16 tokens. On average you win back exactly what you pay.
The same sum, written with probabilities, is the expected prize:
10×81+3×82+0×85=1.25+0.75=2tokens
The play costs 2 tokens, so the expected gain is 2−2=0 tokens.
Expected value
For an outcome that takes the values x1,x2,… with probabilities p1,p2,…, the expected value is
E=x1p1+x2p2+…
It is not the value you expect on one play. You never win exactly 2 tokens on this spinner. It is the average per play in the long run, by the law of large numbers. The next chapter, on random variables, builds on this idea.
A game is fair when the expected gain is 0. The fair game above favours neither the player nor the stall.
The house edge
A roulette wheel of the European kind has 37 pockets: the numbers 1 to 36 and a green zero. Eighteen of the numbers are red. A bet of 1 token on red wins 1 token if the ball lands on red, and loses the token otherwise. The expected gain is
1×3718+(−1)×3719=−371≈−0.027tokens
The green zero is what makes the game unfair. On average a player loses about 2.7 tokens for every 100 tokens bet. This is the house edge. On a single evening a player may win. Over millions of bets the casino's share is very steady.
A line graph of the average gain per bet against the number of bets, from 1 to 10000 bets on a log scale, for three made-up players who each bet 1 token on red on a wheel with 37 pockets. The lines swing widely at first, then all move towards a dashed horizontal line just below zero, which marks the expected gain.
Try it in Python
The program plays the fair spinner and the bet on red 100000 times each, and prints the average gain of each.
Making a game fair
Suppose the top sector of the spinner paid W tokens instead of 10. The game is fair when the expected prize equals the cost:
W×81+0.75=2
So 8W=1.25, and W=10 tokens. A bigger prize favours the player, and a smaller one the stall.
Your turn
The usual mistakes
Forgetting the cost. The expected prize is not the expected gain. Take away what you pay to play.
Expecting the expected value on one play. It is a long-run average, and often not a possible result.
Leaving out the outcomes that pay nothing. Their probabilities still matter, because all the probabilities must add up to 1.
Thinking a long run of losses must turn. A casino game has no memory, as the lesson on streaks showed.
Remember these
E=x1p1+x2p2+…, the long-run average.
Expected gain = expected prize minus the cost. A fair game has an expected gain of 0.
A negative expected gain for the player is the house edge. Over many plays the average settles near it.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
A fair die is rolled. You win 6 tokens for a six and nothing otherwise. What is the expected prize?
The game in question 1 costs 1.5 tokens to play. What is the expected gain? Is the game fair?
A made-up game pays 4 tokens with probability 0.25 and 1 token with probability 0.5, and nothing otherwise. Find the expected prize.
On the European wheel, a player bets 1 token on red 1000 times. About how much should the player expect to lose?
Why can a casino be sure of a profit while each player cannot be sure of a loss?
References
OpenStax, Introductory Statistics, Chapter 4, the section on mean or expected value.
Enroll free in Two-Way Tables and Fair Games
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.