Wikipedia:Reference desk/Archives/Mathematics/2019 January 22: Difference between revisions
Appearance
Content deleted Content added
edited by robot: archiving January 22 |
m →Chance of seeing any adjacent pairs in Powerball Lottery: Replaced deprecated <source> tags with <syntaxhighlight> |
||
Line 33: | Line 33: | ||
:Clam's answer is incorrect. The probabilities being multiplied aren't for independent events, so you don't get a valid answer (although as the number of total balls in the pool increases, it becomes a better and better approximation). Since the number of possibilities was low enough, I just wrote a quick program to brute force the answer. |
:Clam's answer is incorrect. The probabilities being multiplied aren't for independent events, so you don't get a valid answer (although as the number of total balls in the pool increases, it becomes a better and better approximation). Since the number of possibilities was low enough, I just wrote a quick program to brute force the answer. |
||
:{{cot|C code}} |
:{{cot|C code}} |
||
< |
<syntaxhighlight lang="c"> |
||
#include <stdio.h> |
#include <stdio.h> |
||
Line 59: | Line 59: | ||
printf("%d/%d without wraparound\n", withoutwrap, total); |
printf("%d/%d without wraparound\n", withoutwrap, total); |
||
} |
} |
||
</syntaxhighlight> |
|||
</source> |
|||
{{cob}} |
{{cob}} |
||
:This outputs |
:This outputs |
Latest revision as of 15:49, 9 May 2022
Mathematics desk | ||
---|---|---|
< January 21 | << Dec | January | Feb >> | Current desk > |
Welcome to the Wikipedia Mathematics Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
January 22
[edit]Chance of seeing any adjacent pairs in Powerball Lottery
[edit]In powerball lottery in USA, you pick 5 numbers out of 69 numbers (1 .. 69) and a single "powerball" number out of 26 (1 .. 26).
What is the probability of seeing at least one pair of adjacent numbers ( like {14,15} ) in the 5 numbers picked out of 69. You can assume the pair {1,69} to be a pair of adjacent number as well. Ohanian (talk) 12:25, 22 January 2019 (UTC)
- Assume the numbers drawn are a, b, c, d and e. The chances of any given pair being adjacent are 2 in 68 (the second ball could be 1 greater or 1 less than the first). More importantly, the probably of them not being adjacent is 66/68.
- There are 10 combinations of pairs to consider : a-b, a-c, a-d, a-e, b-c, b-d, b-e, c-d, c-e and d-e. Therefore the probability that none of them form a pair of adjacent numbers is (66/68)^10.
- The probability that there is at least on pair is therefore 1 - (66/68)^10, approximately 0.258. O Still Small Voice of Clam 13:05, 22 January 2019 (UTC)
- Additional - I overlooked the possibility of the powerball being adjacent. Maybe someone else can refine my solution... O Still Small Voice of Clam 13:07, 22 January 2019 (UTC)
- (NOTE: I didn't read the second disclaimer that 1 is adjacent to 69 when I wrote the following) For balls 1 and 68, the possibility of the next ball being adjacent is 1/68, not 2/68. That is only for two balls being drawn. There is a vagueness in the question. Does it mean that the balls are drawn in order or that, once sorted, two of the balls are in order. If it is two balls being in order out of five balls being drawn, then you have 4 shots at finding the adjacent ball for the first one, but the pool decreases. It is 1 or 2/68 the first time, then 1 or 2/67, then 1 or 2/66, then 1 or 2/65. But, the problem doesn't end there. You have 5 possible "first ball" choices when calculating the odds. So, you have to consider the odds that any of the 5 has an adjacent ball chosen. But, more complication, you can't double the odds. If the first ball is adjacent to the second ball, the second ball is automatically adjacent to the first ball. The chance that you chose an adjacent ball isn't twice because two of the balls were adjacent. I calculate it to be 26.5% chance of happening. (If you add the disclaimer that 1 is adjacent to 69, ti is a little simpler, but the chance of happening doesn't increase much. I calculate 26.9%.) 209.149.113.5 (talk) 15:27, 22 January 2019 (UTC)
- Clam's answer is incorrect. The probabilities being multiplied aren't for independent events, so you don't get a valid answer (although as the number of total balls in the pool increases, it becomes a better and better approximation). Since the number of possibilities was low enough, I just wrote a quick program to brute force the answer.
C code
|
---|
#include <stdio.h>
void main(void)
{
int a, b, c, d, e;
int withwrap = 0;
int withoutwrap = 0;
int total = 0;
for (a = 1; a <= 69; a++)
for (b = a + 1; b <= 69; b++)
for (c = b + 1; c <= 69; c++)
for (d = c + 1; d <= 69; d++)
for (e = d + 1; e <= 69; e++)
{
total++;
if (b - a == 1 || c - b == 1 || d - c == 1 || e - d == 1)
withoutwrap++;
if (b - a == 1 || c - b == 1 || d - c == 1 || e - d == 1 || e - a == 68)
withwrap++;
}
printf("%d/%d with wraparound\n", withwrap, total);
printf("%d/%d without wraparound\n", withoutwrap, total);
}
|
- This outputs
3018336/11238513 with wraparound
2978625/11238513 without wraparound
- Which works out to about 28.857% and 26.504%, respectively. There may or may not be a nice expression for exact values, but I'm not seeing it right away. If anything occurs to me, I'll update this. –Deacon Vorbis (carbon • videos) 17:47, 22 January 2019 (UTC)
- With wraparound is 26.857% - tiny math error. Your fraction is correct. I rounded it to 26.9% in my post. 209.149.113.5 (talk) 17:58, 22 January 2019 (UTC)
- In general, then number of ways to pick k numbers out of {1, ..., n} with no two consecutive is Choose(n-k+1, k). In this case n=69, k=5, so the the number of ways is Choose(65, 5) = 65!/(60!5!) = 8259888 and the probability of choosing 5 numbers with no two con consecutive is Choose(65, 5)/Choose(69, 5) = 65/69⋅64/68⋅63/67⋅62/66⋅61/65=73.5%=1-26.5% which matches wth above. The number of ways to select k numbers from {1, ..., n} with no two consecutive and not including both 1 and n is Choose(n-k+1, k)-Choose(n-k-1, k-2). In this case that's 8259888 - Choose(63, 3) = 8259888 - 39711 = 8220177. The probability of such a choice is (Choose(65, 5)-Choose(63, 3))/Choose(69, 5) = 73.1% = 1 - 26.9% with also matches the above. The proofs of the general formulas are applications of the Stars and bars (combinatorics) technique. These are related to the coefficients of Fibonacci and Lucas polynomials. --RDBury (talk) 20:12, 22 January 2019 (UTC)
- Argh, you just beat me to it, RDBury. I kind of took a roundabout way to get there, but this is certainly nicer. –Deacon Vorbis (carbon • videos) 20:33, 22 January 2019 (UTC)
- In general, then number of ways to pick k numbers out of {1, ..., n} with no two consecutive is Choose(n-k+1, k). In this case n=69, k=5, so the the number of ways is Choose(65, 5) = 65!/(60!5!) = 8259888 and the probability of choosing 5 numbers with no two con consecutive is Choose(65, 5)/Choose(69, 5) = 65/69⋅64/68⋅63/67⋅62/66⋅61/65=73.5%=1-26.5% which matches wth above. The number of ways to select k numbers from {1, ..., n} with no two consecutive and not including both 1 and n is Choose(n-k+1, k)-Choose(n-k-1, k-2). In this case that's 8259888 - Choose(63, 3) = 8259888 - 39711 = 8220177. The probability of such a choice is (Choose(65, 5)-Choose(63, 3))/Choose(69, 5) = 73.1% = 1 - 26.9% with also matches the above. The proofs of the general formulas are applications of the Stars and bars (combinatorics) technique. These are related to the coefficients of Fibonacci and Lucas polynomials. --RDBury (talk) 20:12, 22 January 2019 (UTC)
- With wraparound is 26.857% - tiny math error. Your fraction is correct. I rounded it to 26.9% in my post. 209.149.113.5 (talk) 17:58, 22 January 2019 (UTC)
For a theoretical explanation of why the two answers agree so closely, see Stein's method. Robinh (talk) 17:47, 24 January 2019 (UTC)