Showing posts with label probability. Show all posts
Showing posts with label probability. Show all posts

Thursday, 29 September 2016

For a Few Birthdays More

Okay, maybe it CAN be worse than Paint Your Wagon.

It's that time again. Time to solve some math problem involving birthdays. I've previously solved the Classic Birthday Problem, as well as the Near-Match, First Match (and First Near-Match), Same Birthday as You, and Matched Couples (and larger groupings) variations.

I'm going to call this the Cover All Birthdays variation. We're looking for the probability that a group of people has every day of the year covered for birthdays.

Let's start by looking at a simpler problem. Suppose that we're tossing rings at some pegs. In this scenario we're assuming that every peg has an equal probability of being hit and that every ring must land on a peg. For any given numbers of n rings and k pegs, what's the probability that every peg is hit at least once? It is impossible to hit k pegs with fewer than k rings, so there is an implicit assumption in this analysis that n ≥ k.

With only one peg, the problem is trivial because all rings necessarily land on that one peg. There is only one possible outcome irrespective of n: the probability of hitting all pegs is 100%.

Since rings can land on any peg, including on the same peg multiple times, the total number of possible outcomes in this ring toss scenario is equal to k to the n-th power. To calculate the probability of hitting all pegs we need to count all of the ways that we could have at least one lone peg. So let's look at a two-peg situation now. There are 2 to the n-th power possible outcomes with the ring tosses. If we have one lone peg, that means there's just one peg left to hit. We already know that there's only one way to hit just one peg. But now, either peg could be the one that gets all the rings, so with 2 pegs there are 2*1 = 2 possible ways to have a lone peg. That means there are 2^n - 2 ways of hitting each peg at least once. The probability of covering all the pegs is therefore [2^n - 2] / [2^n] = 1 - 2^(1-n).

Number of ways to throw n rings at 2 pegs, hitting all pegs at least once.

Probability of hitting all pegs at least once when throwing n rings at 2 pegs.


What happens when we add in a third peg? Again, we could have all the rings land on one peg. This time there are 3 different pegs that could get all the rings, so there are 3 * 1 = 3 ways to hit only one peg. We already figured out that there were 2^n - 2 ways of covering 2 pegs, but now there are three pegs we could choose the two from, or C(3,2) = 3 ways to pick two out of three pegs. That gives us a total of 3 * (2^n - 2) ways of covering exactly two out of three pegs. We're left with 3^n - 3*(2^n-2) - 3 ways of covering all the pegs, out of a total 3^n permutations. Therefore, the probability of covering all three pegs is:


Number of ways to throw n rings at 3 pegs, hitting all pegs at least once.

Probability of hitting all pegs at least once when throwing n rings at 3 pegs.

Let's now define a function F[n,k] as the number of ways of hitting each of the k pegs at least once from n tosses. That recursive relationship looks like this:

Recursive relationship defining the number of ways you can throw n rings hitting all k pegs at least once.

Probability of throwing n rings and hitting all k pegs at least once.

As you keep adding pegs you'll see that the equations quickly start to get lengthy. Using the recursive relationship we could take a brute force calculation approach to evaluate F[n,k], but that quickly gets to be very inefficient as k increases. We'd like a different form of the equation. If we expand and simplify for k = 4 and k = 5, we get the following:

Expanded and simplified expressions for F[n,k] and P[n,k] for k = 1 to 5.

Just for fun, let's plot those out as well so you can see how many tosses you need to have a reasonable chance of hitting all of the pegs.

Tabulated values of the probability of throwing n rings and hitting all k pegs at least once

Graph showing the probability of hitting all pegs at least once with n tosses.

In order to have at least 50% chance of hitting all of the pegs, you need only 2 tosses when there are 2 pegs, 5 tosses for 3 pegs, 7 tosses for 4 pegs, and 10 tosses for 5 pegs.

Now, going back to the expanded equations we wrote out, you might've spotted a pattern. We can define F[n,k] in closed-form using binomial coefficients and summation notation as follows:
  
Solution to the recursive relation for F[n,k].


Okay, so how does this relate to the Cover All Birthdays problem? Well if instead of n rings we have n randomly selected people and instead of k pegs we have 365 possible days a person could be born on, the problem is modeled exactly the same way. There are 365^n permutations of birthdays in a group of n people and there are F[n,365] ways of covering each possibility at least once:

Number of birthday combinations in a group of n people where every day of the year is covered at least once.


Dividing by 365^n to get the probability of covering all birthdays, we can make the following graph:


Probability of covering all 365 birthdays in a group of randomly selected people.

Size of group required to achieve the given threshold probabilities of covering all 365 birthdays.


For n < 365 we know the probability of covering all the birthdays is exactly zero. For n = 365, there's less than 1 in 6.873×10¹⁵⁶ chance of covering every day of the year. If we double that to n = 730, we increase the probability by a factor of nearly 3.45×10¹²⁸, but that's still a negligibly small chance of about 1 in 1.993×10²⁸. Chances of covering all birthdays are vanishingly small until approximately n = 1400. We need at least n = 2287 to exceed a 50% chance of covering all birthdays and at least n = 3828 to give us better than a 99% chance.

Saturday, 10 October 2015

A Fistful of Birthdays

What? Well, it can't be worse than Paint Your Wagon.

To commemorate my birthday, I'm going to solve yet another variation of the Birthday Problem. So far we've looked at the probability of any two people in a group having the same birthday, the probability of having a "near match", the probability of the first match or near-match as people join a group one at a time, and probability of matching or nearly matching a specific birthday (such as your own).

Suppose instead of looking to match any pair of individual birthdays, you want to match a pair of combinations of birthdays, like couples' birthdays or entire families' birthdays. For instance, how unusual would it be to discover that a couple has matching birthdays with another couple at a party?

Let's start with a little review from the classic birthday problem. What are the chances that two randomly selected people have the same birthday? Assuming that birthdays are evenly distributed among the 365 calendar days (let's neglect those leap-year birthdays) and everyone's birthdays are independent of each other, the probability is 1/365 (about 0.27%).

Well what about matching couples birthdays? We start by calculating the number of different possible combinations of birthdays that exist for two randomly selected people. Using the formula for combinations with repetition (Equation 1), where n = 365 days and m = 2 people, I calculate there are 66,795 possible combinations for a random couple. So there's a 1 in 66,795 (about 0.0015%) chance that two randomly selected couples will share the same birthdays between them.

Equation 1

This assumes that the order is not important; it is only necessary that the same birthdays be shared by both groups. For example, A1 & A2 are born January 3rd and February 5th. B1 & B2 would be considered a match if B1 is born January 3rd and B2 is born February 5th. B1 & B2 would also be considered a match if B2 is born January 3rd and B1 is born February 5th.

If there's a 1 in 66,795 that two couples have matching combinations of birthdays, that means there's a 66,794/66,795 probability that two couples don't have matching combinations of birthdays. Having taken up two combinations of birthdays with couples A and B means that a third couple, C, has a 66,793/66,795 chance of not sharing their combination of birthdays with either A or B. The probability of no shared combination of birthdays in the group of three couples is [66,794/66,795] * [66,793/66,795] (about 99.9955%). To find the probability of at least one successful match, simply subtract the probability of no shared birthdays from 100%. So about 0.0045% chance of a shared combination of birthdays among three randomly selected couples. Generalizing now to n randomly selected couples, we get this complicated-looking formula:

Equation 2: Probability of at least one shared combination of birthdays among n randomly selected couples.

While Equation 2 is correct, you're dealing with huge numbers that typical calculators simply can't handle, so it'd be good to have a different version of this expression. Using pi notation (product of a sequence), we can rewrite Equation 2 to get a version that's computationally easier to work with:

Equation 3: Alternate expression of Equation 2

And with that, we can crunch the numbers to figure out how many random couples you need to invite to the party to have a reasonable chance of a matching combination of birthdays.

Minimum number of couples required for a specified probability of at least one pair of couples with matching birthday combinations.

With 13 couples you have a little less than 0.12% chance of a match. You need 38 couples before there's at least 1% chance of a match, and 120 couples to have a 1 in 10 chance. At least one matching combination becomes more likely than not if there are at least 305 couples. There's less than 10% chance of not having a match if there are more than 555 couples. At 1,355 couples, you're practically guaranteed (better than 99.9999% probability) at least one match. Below is a pretty graph from n = just 1 couple (guaranteed no match since there are no other couples) all the way up to 66,796 couples (guaranteed to have at least one match by the pigeonhole principle).

Figure 1: Probability of at least one pair of couples with matching birthday combinations
in a group of
n randomly selected couples.
Note: horizontal axis is plotted on logarithmic scale. 

In case you were wondering, this analysis doesn't apply to groups of twins.
So the probability of finding at least two couples with matching birthday combinations is pretty unlikely in common scenarios like a dancing class or the office Christmas party, but there could be a reasonable chance at very large gatherings like a traditional Mediterranean wedding, and it's practically guaranteed at stadium-sized events like a concert or professional hockey game.

What if we want to know about matching birthday combinations involving a larger grouping, like a family of 4? Well if we go back to Equation 3 and replace the value 66,795 with the right-hand side of Equation 1, we'll have a general expression to calculate the probability that, among n randomly selected subgroups of m people, there's at least one pair of them having matching birthday combinations. That general formula looks like this:

Equation 4: General expression to find the probability of at least one pair of m-sized subgroups with matching birthday combinations among n subgroups.

So if you're interested in the probability of at least one pair of matching combinations of birthdays among 25,000 randomly selected families of 4, set m = 4 and n = 25,000 (p ≈ 34.0%). I've expanded the previous plot for m = 3, m = 4, and m = 6.

Figure 2: Probability of at least one pair of m-sized subgroups with matching birthday combinations
in a group of 
n randomly selected subgroups. 

As you probably guessed, as m increases, you need an increasingly large number of n subgroups to get to a reasonable probability of a match. It also quickly gets too difficult to solve with a personal computer unless you start using a more manageable numerical approximation. For m = 7 and up I switched to using Ramanujan's approximation of the factorial function (which is quite accurate) and used logarithms to reduce the size of the numbers involved.
By taking logarithms and using Ramanujan's approximation, the problem of solving for p begins to look more complicated, but is actually much easier for your computer to handle.

Fun fact: using logarithms simplifies math problems because exponentiation reduces to multiplication, multiplication reduces to addition, very large numbers become much smaller, and all the numbers you're working with become more similar in size. Before calculators and computers, most scientists and engineers were quite familiar with this trick and regularly referred to printed handbooks containing tables of logarithms in order to complete their calculations.


Equation 5: Calculate p after you've found the approximate solution to ln q.
I used the above approximations to calculate ln q and the false position method to find the minimum value of n required to have either a 50% or 95% probability of finding a matching pair:

Minimum number n for 50% or 95% probability of a matching pair of birthday combinations for m-sized subgroups

I also decided to work out what's the largest subgroup size m where we would have a reasonable chance of finding a matching combination of birthdays in another subgroup, assuming all subgroups are selected from the entire population of Earth. Set n = 7,300,000,000/m, vary m, and solve for the probability of finding at least one matching pair on Earth.

Just based on the pattern observed in Figure 2, I was able to extrapolate and guess that the largest subgroup size m would probably be 9 (there's almost an order of magnitude increase in n to get to the steeply sloped part of the curve as m increases by 1). In fact, for m = 8 and n = 912,500,000 random groups of 8, the probability of a matching pair of birthday combinations is infinitesimally close to a mathematical guarantee (slightly more than 99.999999999999999999964%). For m = 9 and n = 811,111,111 random groups of 9, the probability of a matching pair of birthday combinations is just over 60.99%. For m = 10 and n = 730,000,000, the probability of finding a matching pair of birthday combinations is a little under 2.02%. At m = 11 and n = 663,636,364, the probability of finding a match is about 1 in 2,024.

In summary:  Finding a pair of matching individual birthdays at the office: fairly likely. Matching couples' birthdays at a party? Maybe, but it'd probably need to be a pretty large party. Matching the combination of birthdays in a group of 10 or more? Nearly impossible, even if the whole planet is involved.

Monday, 28 September 2015

Contraceptive Efficacy and Combined Probability

When sex education sources quote numbers on the efficacy of different forms of contraception, they usually report a number like "98% effective". What they really mean is that, on average, 98 out of 100 women using that method of birth control for a whole year won't get pregnant. However, most people don't understand how a seemingly small annual risk of pregnancy might translate to a significant risk of pregnancy over a period of several years. In this post I show you how the probability of pregnancy grows over time and why it's commonly recommended that couples use two forms of contraception.

The annual risk of unintended pregnancy for several different contraceptive methods are given in the table below, taken from the 20th edition of Contraceptive Technology. The effectiveness typically reported by sex education sources is simply 100% minus the annual risk of pregnancy.

I'm not sure how typical use differs from perfect use when it comes to male sterilization...

It should be noted that "typical use" is perhaps misleading because it is an average for the people reportedly using that contraceptive method. For most contraceptive methods, including the condom and the pill, the most common deviation from "perfect use" is conscious user non-compliance (i.e. knowingly not using the contraception). Not using the contraception shouldn't really count in the typical use, but I guess they just do the best they can with the data they get.

So, suppose you're interested in calculating the risk of pregnancy within a period several years. From the table above, we can get the probability of not conceiving during the first year of use, equal to 100% minus the number from the table. We'll call this number p. The probability of not conceiving during a period of n years of use can be taken as p raised to the nth power. The risk of pregnancy is then calculated as


This simply estimates the risk of getting pregnant at least once during an n-year period while using a certain contraceptive method. The graph below compares a few common contraceptive methods for n = 1 to 10 years.

Comparing the risk of pregnancy using different contraceptive methods.

The graph shows that if you are not diligent in using the contraceptive method properly (i.e. you stray from "perfect use"), there's a pretty good chance of unintended pregnancy somewhere down the road. There's greater than 50% chance of unintended pregnancy within 8 years of "typical use" with the pill, within 6 years with the Standard Days method, 4 years with the male condom, and 3 years with the withdrawal method. Even with perfect use, if condoms are the only contraceptive method used, there's still about 18.3% chance of an unintended pregnancy in 10 years. That's 1 in 5.47. If you look at a 10-year period, comparing all the methods from the previous table, you'll find that if you use only a single method, only sterilization or IUDs reduce your risk of unintended pregnancy to less than 1 in 2 (i.e. less than 50%), assuming "typical use".



We can estimate the risk of pregnancy when contraceptive methods are combined by combining probabilities as shown in the following equation:


When two events, A and B, are independent, the probability of both A and B occurring is equal to the product of the probability of A and the probability of B. Applied to pregnancy risk, it means the risk of getting pregnant while using both methods A and B is equal to the probability of A failing multiplied by the probability of B failing. This approach to combining probability assumes that the individual probabilities are independent of each other. Before combining probabilities you should think about whether they actually are reasonably independent. For example, birth control pills and male condoms are probably independent (or nearly independent) because they are unrelated methods and it is unlikely that one method will influence the efficacy of the other. Therefore, the probability of an unintended pregnancy in the first year of use is probably approximately 0.18*0.09 = 1.62% when both male condoms and birth control pills are used (assuming "typical use"). A counterexample is the combination of the Standard Days Method and the TwoDay Method, which are probably not independent because they are both methods of achieving "fertility awareness". It's unlikely that one method negatively influences the other, but combining the two probably has little benefit either. The combination of Standard Days Method with the TwoDay Method is probably only slightly better than either one of them their own. That said, I've calculated the risk of pregnancy with some combinations of contraceptive methods which probably satisfy the assumption of independence in order to demonstrate how using two methods simultaneously dramatically reduces your risk of unplanned pregnancy.


Comparing the risk of pregnancy using different combinations of contraceptive methods.

As you can see, combining contraceptive methods reduces the risk of unintended pregnancy by a pretty significant margin. If using a single contraceptive method, assuming "typical use", only IUDs or sterilization were effective enough to reduce the risk of unintended pregnancy to less than 50% in 10 years. Combining 2 methods very effectively reduces the risk of unintended pregnancy without resorting to invasive or irreversible medical procedures.

Thursday, 27 August 2015

Gambling and Expected Value: NHL Lotto (OLG)

In this post on Gambling and Expected Value, we look at the "NHL Lotto" lottery offered by the OLG.
Click here to find similar posts on other lotteries and games of chance.

NHL Lotto (OLG)

NHL Lotto a lottery offered by the Ontario Lottery and Gaming Corporation (OLG). 

How the Game Works

To play NHL Lotto, the player selects a combination of 5 numbers chosen from 1 to 30, and an NHL team (of which there are also 30 options). Numbers cannot be repeated and the order is not important. The player also has the option of having the computer generate a random selection instead (known as "Quick Pick" in lottery vernacular). The game involves two portions, the "Instant Win" and the "Nightly Draw". In the Instant Win portion, you watch a computer-generated animation of a hockey player take three shots at a net with targets and hope that you've been randomly selected to be a winner. The system has been programmed to randomly mete out prizes based on OLGs predetermined odds of winning. In the Nightly Draw, prizes are awarded based on correctly matching the winning numbers and NHL team. It costs $2 to play NHL Lotto. 

Probabilities and Prizes

There are 13 different ways to win a prize in the Instant Win portion of NHL Lotto, ranging from $15,000 down to $2. The prize awarded corresponds to the targets hit by your computer generated hockey player, but it's not clear how exactly that translates into calculable probabilities. I'll have to assume the odds reported by the OLG are the exact probabilities programmed into their computers. But here's the summary of the Instant Win prizes and probabilities for NHL Lotto:

Summary of prizes and their probabilities in the Instant Win portion of NHL Lotto

There are 142,506 unique combinations of five numbers that can be chosen from the numbers 1 to 30. The number of combinations of items you can choose from a set without repetition is calculated using the following formula:

 \binom nk = \frac{n!}{k!(n-k)!},

where k is the number of items chosen, n is the total number of item to choose from, and ! denotes the factorial function. In this case, n = 30 and k = 5. But you also choose one hockey team out of 30 possible choices. You could repeat the above calculation for n = 30 and k = 1, but it should be intuitively obvious that there are 30 possible ways to pick one hockey team out of the 30. So in total there are 30 times 142,506 = 4,275,180 unique combinations of one NHL team plus 5 numbers chosen from the numbers 1 to 30.

The probability of matching some number of the winning 5 can be calculated from the hypergeometric distribution. The formula looks like this:

Equation 1 (general lottery prize probability formula)

where p is the probability of winning, n is the size of the set of numbers the winners are drawn from, k is the size of a combination, and r is the number of matching numbers required to win the prize. For example, to calculate the probability of matching four numbers in NHL Lotto, r = 4, k = 5, and n = 30. Plugging in the numbers gives the probability of approximately 0.088%, or about 1 in 1,140 (note this probability reflects the combined probability of winning either the 3rd or 4th prizes).

We can treat the NHL team matching as a bonus number drawn from a separate pool of numbers. The formula to calculate the probability of matching r out of k winning numbers plus a bonus number that is drawn from a separate pool of m numbers is a slight modification of Equation 1:

Equation 2 (general lottery with separate bonus number prize probability formula) 

Here is a table summarizing the payouts of the Nightly Draw portion of NHL Lotto and their probabilities:

Summary of prizes and their probabilities for the Nightly Draw portion of NHL Lotto.

Since for some of the prizes matching x out of 5 numbers has two different prizes depending on whether or not you match the NHL team, the probability has to be adjusted for overcounting. The probability of matching with the bonus is calculated from Equation 2 (m = 30). The probability of matching without the bonus is calculated from Equation 1 minus Equation 2.

So there's roughly 66.7% chance you lose on the Instant Win game and 94.5% you lose on the Nightly Draw. The combined probability of losing both games is calculated by multiplying the two probabilities together, which works out to a 63.1% probability that an NHL Lotto player has just thrown his money away.

Expected Value

Expected value here is pretty straightforward to calculate, just multiply each of the possible prizes by its respective probability, sum all the products, and then subtract the cost of the ticket. For example, the $100,000 prize in the Nightly Draw multiplied by the 1/4,275,180 probability of winning contributes an expected value of $100,000/4,275,180 (about 2.34 cents) to the overall expected value of an NHL Lotto ticket.


Summary of expected values of the prizes in the Instant Win portion of NHL Lotto

Summary of expected values of the prizes in the Nightly Draw portion of NHL Lotto
with overall expected value and house edge of NHL Lotto

From the tables, you can see there's a house edge of about 41.3%, meaning an average of 41.3 cents from every dollar spent on NHL Lotto goes straight to the OLG.

It's interesting to compare the two games. The total expected value of the Instant Win prizes is more than 4 times the expected value of Nightly Draw prizes. Similarly, the probability of getting a payout in the Instant Win portion is about 6 times the probability of getting a payout in the Nightly Draw. The OLG cleverly use a little computer animation, which is probably slightly entertaining to watch, and the fact that you get a payout about a third of the time, to hook people on the game. Most people appreciate that the chance of winning exists only if they buy a ticket, but don't really appreciate how minuscule that chance might be. The Nightly Draw is there to give players hope. The thinking is that if you lose the Instant Win game, well at least you've got another shot at free money. Too bad your chance of winning anything in the Nightly Draw is much lower than in the Instant Win. The Nightly Draw is even assigned a bigger top prize, because when the payout gets bigger, people tend to be more willing to make bad decisions (like buying another ticket).

From our analysis we can draw the following conclusions:

  1. NHL Lotto has a house edge of about 41.3%, which is a little better than a 50/50 draw. In other words, on average, OLG keeps 41.3 cents of every dollar spent playing NHL Lotto. Better than a lot of lotteries, but worse than casino games.
  2. The Instant Win portion of the game is significantly better than the Nightly Draw portion, both in terms of the expected prize value (about 4 times that of the Nightly Draw), and the odds of winning a payout (about 6 times higher chance of winning than in the Nightly Draw).
  3. The combination of flashy animation, small and relatively frequent payouts, and a second chance game that has a bigger top prize (but rarely pays out to anyone) is purposefully crafted to attract and hook gamblers on NHL Lotto. 

Monday, 24 August 2015

Gambling and Expected Value: Ontario 49 (OLG)

In this post on Gambling and Expected Value, we look at the "Ontario 49" lottery offered by the OLG.
Click here to find similar posts on other lotteries and games of chance.

Ontario 49 (OLG)

Ontario 49 is a lottery offered by the Ontario Lottery and Gaming Corporation (OLG). 

How the Game Works

To play Ontario 49, the player selects a combination of 6 numbers chosen from 1 to 49. Numbers cannot be repeated and the order is not important. The player also has the option of having the computer generate a random selection instead (known as "Quick Pick" in lottery vernacular). The six winning numbers are drawn at random, along with a seventh "bonus number". The bonus number is only important for the second or sixth prizes. Second prize is awarded to tickets matching 5 out of 6 numbers plus the bonus number. Sixth prize is awarded to tickets matching 2 out of 6 numbers plus the bonus number. Winnings are determined by how many of the numbers are matched. The minimum wager in Ontario 49 is $1 and additional plays are bought in $1 increments. A $1 wager buys 1 play. 

Probabilities and Prizes

There are 7 different ways to win a prize playing Ontario 49, ranging from a free ticket in a future draw to $2,000,000. The first and second prizes are capped to a total of $2,000,000 and $50,000 respectively, meaning that if there are multiple winners, the prize gets split between them.

There are 13,983,816 unique combinations of six numbers that can be chosen from the numbers 1 to 49. That number of combinations of items you can choose from a set without repetition is calculated using the following formula:

 \binom nk = \frac{n!}{k!(n-k)!},

where k is the number of items chosen, n is the total number of item to choose from, and ! denotes the factorial function. In this case, n = 49 and k = 6.

The probability of matching some number of the winning 6 can be calculated from the hypergeometric distribution. The formula looks like this:

Equation 1 (general lottery prize probability formula)

where p is the probability of winning, n is the size of the set of numbers the winners are drawn from, k is the size of a combination, and r is the number of matching numbers required to win the prize. For example, to calculate the probability of matching three numbers in Ontario 49, r = 3, k = 6, and n = 49. Plugging in the numbers gives the probability of approximately 1.765%, or about 1 in 56.7.

The second prize adds a complication because of the bonus number. The formula to calculate the probability of matching r out of k winning numbers plus a bonus number (also drawn from the pool of n numbers) is a slight modification of Equation 1:

Equation 2 (general lottery with bonus number prize probability formula)

Here is a table summarizing Ontario 49's payouts and their probabilities:


Since matching 5 out of 6 numbers has two different prizes depending on whether or not you match the bonus, the probability has to be adjusted for overcounting. The probability of matching 6 of 6, 4 of 6, or 3 of 6 numbers is calculated from Equation 1. The probability of matching 5 of 6 plus the bonus or 2 out of 6 plus the bonus is calculated from Equation 2. The remaining prizes, matching 5 of 6 but not the bonus, or 2 out of 6 but not the bonus, is calculated from Equation 1 minus Equation 2.

The last thing we need is the probability that your wager is just money thrown away. That's 100% minus the total of probabilities of winning the prizes in the table above, which works out to exactly 70,662,652,981/83,230,673,988 (about 84.9%). This means that an Ontario 49 number combination has about 15.1% chance of not losing. However, keep in mind most of those "winners" are just getting a free play in a future draw, which as you'll see in the expected value section, is almost worthless.

Expected Value

The precise expected value is a little tricky because the payout on the top two prizes depends on how many winners there were, and the value of a free play is actually significantly less than the cost of the play. Let's first start by calculating the contribution to the expected value coming from the guaranteed prize amounts. Each contribution is simply the net gain (prize minus wager) multiplied by the probability.


Next, lets calculate how much the losing tickets contribute to the expected value. Again, it's the net gain multiplied by the probability, or (-$1) * (70,662,652,981/83,230,673,988). That's about -$0.849. At this point, the expected value of a ticket, ignoring the top two prizes and the free tickets, is about -$0.609.

Next we have to figure out how much the top two prizes contribute to expected value. That depends on how many winners there are. We don't know how many winners there are, but if we know how many combinations are played, we can estimate how likely there are to be 0, 1, 2, etc. winners. This is calculated using the binomial distribution. If the probability of winning the prize is p, the probability of not winning the prize is (1-p), and N combinations are played, then probability of there being s winners of the shared pot is:


What do we need this for? Well, because the prize depends on the number of winners and the number of winners is a probabilistic function of the number of tickets sold. Therefore, we need to estimate an expected value of the prize. I've estimated that the number of combinations played in each Ontario 49 draw is on the order of 750,000. Accordingly, I've estimated the expected top prize based on there being up to 7 winners (more than 7 winners is too unlikely to be worth consideration). I've also checked N = 250,000 and N = 2,500,000 to show that the final result is not that sensitive to the accuracy of my estimate of N.

Probability of s winners of the top prize in a draw where N random combinations are played.
Expected prize amount based on
N combinations played.

The expected value of the top prize is $1,998,603.85 if 750,000 combinations are played in each draw. So for the top prize, the effect of prize sharing is pretty small, assuming my estimate of 750,000 combinations played per draw is reasonable. As you can see from the table, even if I was off by a factor of more than three and 2,500,000 combinations are played, the expected prize is still within 0.8% of the single-winner prize amount.

Working through the same process for the second prize, this time considering up to 10 winners because the likelihood of multiple second prize winners is higher, we get the following table:

Probability of s winners of the second prize in a draw where N random combinations are played.
Expected prize amount estimated based on 
N combinations played.

You can see from the difference between N = 750,000 and N = 2,500,000 that the expected payout for the second prize is little more sensitive to the accuracy of my estimate of N. But it is not excessively sensitive, so our estimate is probably still pretty close to correct.

Finally, we need to estimate the value of a free ticket. Start by taking the expected value of free ticket. It's the sum of the products of each prize and the likelihood of winning. Let's consider only the monetary prizes first.

Expected value of a free ticket, ignoring the value of additional free tickets.

Summing up the expected values of the prizes on a free ticket works out to a little under 43.5 cents. But a free ticket has roughly 12% probability of win another free ticket, and that ticket could win a monetary prize, or it could win yet another free ticket, and so on. What we have here is an infinite series that can be expressed by the equation below

The infinite summation to calculate the equivalent prize value of a free Ontario 49 ticket.
We could sum the first few terms until it converges, but it this case we have a very simple closed-form solution, shown below:

Solution to the sum of an infinite power series.
Therefore,
So winning a free ticket is equivalent to receiving a cash prize of about 49.4 cents.

We can also use a similar infinite sum to calculate the probability of getting any money back on an Ontario 49 ticket. The value of a becomes the sum of the probabilities of winning the monetary prizes and r is the probability of winning a free ticket.



Thus, after accounting for the possibility of winning money on a free ticket, the chance of winning money on an Ontario 49 play is still only about 3.52% (i.e. about 1 in 28.4).

Putting everything together now, the expected value of a single Ontario 49 play is


This means that, on average, for every dollar you spend playing Ontario 49, the OLG keeps about 50.6 cents for themselves.

From our analysis we can draw the following conclusions:

  1. Ontario 49 has a house edge of about 50.6%, which is slightly worse than a 50/50 draw. In other words, on average, OLG keeps 50.6 cents of every dollar spent playing Ontario 49.
  2. The OLG website is misleading in stating that your odds of winning are 1 in 6.6. There's only 3.52%, or 1 in 28.4, chance that you're going to win any money.