Calculating lottery probability

In summary, the problem is that the expected number of total hits, when playing the lottery with 8 tickets, is not equal to the total number of tickets that you would expect to match 3 out of 5 numbers.
  • #1
Mugged
104
0
Hello, this lottery problem has been bothering me for months. I set it up here. Help appreciated.

Here is the setup:

Suppose you have to pick 5 numbers from a set of integers ranging from 1 to 39. The probability of matching x/5 (where x can be 1,2,3,4,5) numbers correctly can be found by computing the hypergeometric distribution formula, as found on wikipedia. we have that:

probability of matching x/5 = {5 choose x}*{(39-5) choose (5-x)} / {39 choose 5}

where {a choose b} = a! / (b!*(a-b)!)

Computing for x = 2,3,4,5 yields:

x=2: probability = 59840/575757 ≈ 0.104
x=3: probability = 1870/191919 ≈ 0.00974
x=4: probability = 170/575757 ≈ 0.000295
x=5:probability = 1/575757 ≈ 1.737e-6

Now here is the problem:

Suppose you buy 8 tickets, assume all of them have distinct sets of 5 integers, and play these 8 combinations for 1,000,000 drawings of the lottery. How many tickets in total (out of 8*1,000,000) do you expect to match x out of 5? i.e. in 8,000,000 plays, how many tickets yield 3 out of 5 matched?

I had originally thought that the solution was simply the probability of matching x/5 multiplied by the total number of plays, in this case 8e6, but this isn't the case. Although, this approach works for 2 out of 5 matches but not for 3 or 4...unsure about 5/5.

Any help is well appreciated.
 
Physics news on Phys.org
  • #2
If you know the expected hits (like the probability of "3 out of 5") for each ticket, the expected number of total hits is just the sum of all those expectation values - in your case, 8 million times the probability that a single ticket wins.

The variance is a bit more tricky, if those 8 tickets are not independent, but I think this can be neglected for every reasonable calculation.
 
  • #3
Right, but that approach doesn't seem to work. The reason I'm posing this question is because I've been running lottery simulations in Matlab and I'm getting results that are inconsistent with that idea.

I run 1,000,000 "games", where for each game I have 8 sets of 5 numbers chosen being compared to a winning game combination. Out of the 8 million plays, I get roughly 800,000 2/5 matches, 40,000 3/5 matches, can't remember 4/5,5/5.

But the point is the probability for 2/5 match is rougly 10%, so 8e6*.10 = 800k, which is fine. But for 3/5 match the probability is 0.009, times 8e6 is about 80k, but I only get 40k...so this doesn't match
 
  • #4
I would expect a bug in the code then.
 
  • #5


Hello,

Thank you for providing the setup and your thoughts on this lottery probability problem. It seems like you have a good understanding of the formula and how to calculate the probability of matching a certain number of numbers correctly. However, your approach for calculating the expected number of tickets that will match a certain number of numbers out of 5 is not correct.

The correct approach is to use the binomial distribution formula, which takes into account the number of trials (in this case, 1,000,000) and the probability of success (the probability of matching x out of 5 numbers). So for example, to calculate the expected number of tickets that will match 3 out of 5 numbers, you would use the formula:

Expected number of tickets = (number of trials) * (probability of success)^3 * (1 - probability of success)^2 * (number of combinations)

In this case, the number of combinations would be 8 choose 3, since you are choosing 3 tickets out of 8. So the final formula would be:

Expected number of tickets = 1,000,000 * (0.00974)^3 * (1 - 0.00974)^2 * {8 choose 3}

I won't do the calculation for you, but this is the correct approach for calculating the expected number of tickets that will match a certain number of numbers out of 5. This approach can be used for any number of matches, not just 3 out of 5.

I hope this helps and good luck with your lottery calculations!
 

1. What is lottery probability?

Lottery probability is the likelihood of winning a prize in a lottery game. It is calculated by dividing the number of ways to win by the total number of possible outcomes.

2. How is lottery probability calculated?

To calculate lottery probability, you need to know the number of possible outcomes and the number of ways to win. Then, you can use the formula P(win) = number of ways to win / total number of outcomes. For example, if there are 10,000 possible outcomes and 1,000 ways to win, the probability would be 1,000/10,000 = 0.1 or 10%.

3. What are the odds of winning the lottery?

The odds of winning the lottery depend on the specific game and its rules. Generally, the odds are very low, as there are usually millions of possible outcomes and only a few ways to win. It is important to remember that lottery games are based on chance and there is no guaranteed way to win.

4. How can I increase my chances of winning the lottery?

There is no way to guarantee a win in the lottery, but you can increase your chances by purchasing more tickets. Keep in mind that this also means spending more money. Another strategy is to play less popular games, as they may have better odds of winning.

5. Are there any other factors that affect lottery probability?

Yes, there are several other factors that can affect lottery probability. These include the number of players, the number of tickets sold, and any bonus features or special drawings in the game. The more players and tickets, the lower the chances of winning. The presence of bonus features or special drawings can also impact the probability of winning.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
25
Views
1K
  • Set Theory, Logic, Probability, Statistics
3
Replies
75
Views
6K
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
9
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
827
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
312
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
2K
Replies
1
Views
2K
Back
Top