Thursday, 22 May 2014

Gambling and Expected Value: Pick 3 (WCLC)

Gamblers have many options available to them, but by and large the typical gambler knows little about how games of random chance work or how to assess the difference between various gambling options. This is the first of several posts to describe and analyze various ways to gamble. Here we'll be looking at the Pick 3 lottery offered by the Western Canada Lottery Corporation.

A simple metric to compare two different gambling options is the expected value. In a gambling scenario, the expected value of interest is the expected monetary loss. Comparing the expected value between two games lets you know which is a worse choice. Note: Because all games have a negative expected value, the smartest choice is always to not gamble at all.


Click here to find similar posts on other lotteries and games of chance.

How the Game Works

The player chooses three numbers from '0' to '9' and the numbers can be repeated. Therefore, there are 10³ = 1,000 possible selections. From there, there are three ways to play the game: Straight, Box, and Straight/Box. In "straight" play the order of the digits matters. The player wins if his/her numbers are an exact match to the numbers drawn (i.e. chosen in the same order), but loses otherwise. 

In "box" play the order of the digits doesn't matter. If the player's three digits come up in the winning numbers in any order, the player wins. If the player chose three unique digits there are 6 possible draws favourable to the player. If the player chose two unique digits there are 3 possible draws that would win. Obviously, box play isn't an option if all three digits are the same. If the player chose box play but happened to get the order correct, he/she still gets the smaller prize.

In "straight/box" play the player is choosing both straight and box methods simultaneously. The perceived benefit of straight/box play is that the player gets the improved probability of winning afforded by box play coupled with a chance at a larger prize if he/she happens to get the order correct. However, the prize for the correct order is smaller in straight/box play than in straight play. Similarly, the prize for the correct digits but wrong order is smaller in straight/box play than in box play.


Probabilities & Prizes

In the table below, the possible prizes and their probabilities have been summarized for all possible ways to play Pick 3. 


Example

Five gamblers play Pick 3: 'A', 'B', 'C', 'D', and 'E'. 
'A' chooses 123 and Straight. 
'B' chooses 123 and Box. 
'C' chooses 231 and Box. 
'D' chooses 123 and Straight/Box. 
'E' chooses 231 and Straight/Box. 

They all bet $1. The winning numbers drawn are 123. They are all winners, but with different prizes. 
'A' wins $500 
'B' and 'C' each win $80
'D' wins $290
'E' wins $40

Expected Value

Calculating expected value is pretty straightforward. Take the weighted average of all possible outcomes of the game. We'll work through the Straight/Box type play for a 6-way combination. There are three possible outcomes with Straight/Box play: win with the exact order, win with the wrong order, or lose. Winning with the exact order occurs with a probability of 1 in 1000 and results in a net gain of 289 times the wager. You had to pay the money to play so your gain is your winnings less the wager. Winning with the wrong order occurs with a probability of 1 in 200 and results in a net gain of 39 times the wager. Losing occurs with a probability of 497/500 (99.4%) and results in a net loss of 1 times the wager. The probability of losing, i.e. the probability of not winning, is equal to: 
 (probability of straight win)  (probability of box win) = 100%  0.1%  0.5% = 99.4%
To calculate the weighted average outcome, multiply the net gain by its probability for each outcome and then sum for all outcomes. In this case:
289×0.001 + 39×0.005 + (-1)×0.994 = -0.51
What does that mean? It means that played over and over again, on average, you'd lose money at a rate of $0.51 for every $1 you ever wagered. Expected values for all types of play are given in the table below.

What do the numbers tell us? First, it tells us that the Pick 3 lottery is a pretty bad way to gamble as far as gambling goes. On average, you're losing more than half your wager every time you play. Second, all three ways to play have roughly the same expected value, so there isn't a big difference to your pocket in the long run. However, Box play is the worst choice by a small margin, followed by Straight/Box. If you're going to play Pick 3, you'll lose less money in the long run if you always choose the Straight play option.

Friday, 9 May 2014

The Birthday Problem: Round 4

We've looked at the probability of any two people having the same birthday in a group. We've also looked at the probability of two people having a "near match" in a group. We then looked at the probability of the first match or near-match as people join a group one at a time. But what happens when we want to match (or nearly match) a specific birthday (your own for example).

Matches to your birthday will follow a binomial distribution, which has a probability mass function:

Equation 1

where q is the number of trials, r is the number of successes, and p is the probability of success. If we're trying to match your birthday in a random group of people, r is any whole number greater than zero, p is (2k+1)/365 chance of an individual matching your birthday to within k days, and q is one less than the number of people in the group. If we substitute (n-1) = q, (2k+1)/365 = p, and r = 0 into Equation 1, we'll get the probability of NOT matching (or nearly matching) your birthday in a group of n people. That gives us Equation 2 below:

Equation 2

Subtract from 100% to get the probability of at least one match to your birthday within k days among a total of n people. After simplifying, we get Equation 3:

Equation 3
Plotting for different values of k and n (k = 0 if you're looking for a same-day birthday match) gives a graph like this:


It's hard to see the full picture with both k = 0 and k = 30 on the same plot, so here's another one:


We can also make a table showing the minimum size of the group for a corresponding probability that your birthday will be matched or nearly matched:


As you can see, matching your birthday is far less likely than matching any birthday. The results might be surprising though. Recall that we need only 23 people for there to be better than a 50% chance that two people in the group had matching birthdays. But in a group of you and 22 other people, there's only a 5.86% chance that your birthday is shared with someone else in the group. You need at least 253 other people in the group before it is more likely than not that your own birthday is shared with someone else.

We can also repeat the analysis from the third birthday post and figure out, if people entered randomly one at a time, who would be most likely to match your birthday. That perhaps isn't so interesting because the first person to enter after you always has the greatest chance of being the first person to match your birthday. The incremental probability of matching your birthday in a group of n versus n+1 people (i.e. the probability that the next person matches your birthday) is equal to:

Equation 4

It can be shown that Equation 4 is maximized by n = 1, irrespective of k. Therefore, the first random person joining you at the party is the most likely person to match your birthday, with a probability of a match simply equal to:
Equation 5

For completion, here is the plot of equation 4 and the tabulated data to show the probability of the first person entering the group after you matching your birthday.



In short, matching a specific birthday in a random group of people is uncommon and generally requires a large sample, but it's not unusual for any two people in a small group of random people to share a birthday. And now there will be no more talk of birthdays for a long time.