Two Plus Two Publishing LLC Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > General Gambling > Probability

Notices

Probability Discussions of probability theory

Reply
 
Thread Tools Display Modes
Old 06-23-2011, 07:49 PM   #16
newbie
 
Join Date: Jun 2011
Posts: 49
Re: Dice rolling question

Quote:
Originally Posted by R Gibert View Post
I wrote a short Monte Carlo program and ran it 1,000,000 times. The expected number of throws came out to about 61.2
Me too. The math is way to hard.
Maybe not for some members here.

As for a practical application - In my short gambling life I have seen 2 roulette players bet for a complete set and they both won before going bankrupt.
I guess if one played Crapless Craps they could possibly use this knowledge to bet on the 11 numbers. Maybe...
Code:
trials:                  1,000,000   

minimum value:               11.00
first quartile:              36.00
median:                      52.00
third quartile:              76.00
maximum value:              512.00

mean value:                  61.23

sample variance (n):       1297.51
sample std dev (n):          36.02
How about the 21 unique combinations.
These can be bet on at some Craps tables that offer all the hop bets. Well, with very high house edges, maybe not
Code:
mean	94.96
median	86
mode	72
min	27
max	528
sd	39.01
sallymustang is offline   Reply With Quote
Old 06-24-2011, 10:18 AM   #17
Carpal \'Tunnel
 
BruceZ's Avatar
 
Join Date: Sep 2002
Posts: 7,138
Re: Dice rolling question

Quote:
Originally Posted by OmahaDonk View Post
I asked my father, who is somewhat of a math guru - with no explanation he says he believes its 54. Thanks dad.
54 is just the average number of rolls to get the 2 rarest numbers 2 and 12. That is 18 + 36. Clearly the average number to get all of them is greater than this, otherwise we would have to be guaranteed to always get the others first.
BruceZ is offline   Reply With Quote
Old 06-24-2011, 10:10 PM   #18
grinder
 
Join Date: Apr 2011
Posts: 510
Re: Dice rolling question

Quote:
Originally Posted by BruceZ View Post
54 is just the average number of rolls to get the 2 rarest numbers 2 and 12. That is 18 + 36. Clearly the average number to get all of them is greater than this, otherwise we would have to be guaranteed to always get the others first.
Yeah, when I pressed him for some sort of analysis, he said that's what he thought I wanted. Will see if he does the more difficult problem
OmahaDonk is offline   Reply With Quote
Old 06-26-2011, 05:14 AM   #19
Carpal \'Tunnel
 
BruceZ's Avatar
 
Join Date: Sep 2002
Posts: 7,138
Re: Dice rolling question

Quote:
Originally Posted by OmahaDonk View Post
Yeah, when I pressed him for some sort of analysis, he said that's what he thought I wanted. Will see if he does the more difficult problem
I got it *trumpets*.

I figured out how to compute the average number of rolls to get all of the numbers 2-12. The answer is 61.21738 rolls. The principle is simple, but the computations were automated to get the exact result.

The average rolls to get a 2 is 36. The average rolls to get a 2 and a 12 is

36 + (1-0.5)*36 = 54

The 0.5 is there because half of the time the 12 will come before the 2, and so the other half of the time it comes after the 2, in which case we need another 36 rolls to get the 12.

To understand the remaining terms, refer to this table, where E is the average number of rolls for each number.

Code:
number     prob (in 36)     E

2                1          36
12               1          36
3                2          18
11               2          18
4                3          12
10               3          12
5                4           9
9                4           9
6                5           7.2
8                5           7.2
7                6           6
Now to include another number, say 3, we get

54 + [1 - (2/3 + 2/3 - 2/4)]*18 = 57

The value in () is the probability that the 3 will come before either the 2 or the 12 by inclusion-exclusion. The probability is 2/3 that it comes before the 2, plus 2/3 that it comes before the 12, minus 2/4 that it comes before both. 1 minus that fraction of the time it comes after both, in which case we need another 18 rolls to get the 3 since it has probability 1/18.

The next one for including the 11 is

57 + [1 - (2/3 + 2/3 + 2/4 - 2/4 -2/5 - 2/5 + 2/6)]*18 = 59.4

The value in () is the probability that the 11 will come before the 2, 12, or 3. In this case, we add the 3 probabilities for coming before each of the previous 3 numbers, then subtract the 3 probabilites for coming before each of the C(3,2) = 3 combinations of 2 of the 3 numbers, then add back the probability of coming before all 3 numbers. 1 minus this fraction of the time it comes after all 3, in which case we need another 18 rolls to get the 11 since it has probability 1/18.

The next term for including the 4 is

59.4 + [1 - (3/4 + 3/4 + 3/5 + 3/5 - 3/5 - 3/6 - 3/6 - 3/6 -3/6 -3/7 + 3/7 + 3/7 + 3/8 + 3/8 - 3/9)]*12

=~ 60.05714

The value in () is the probability that the 4 will come before the 2, 12, or 3, or 11. In this case, we add the 4 probabilities for coming before each of the previous 4 numbers, then subtract the 6 probabilites for coming before each of the C(4,2) = 6 combinations of 2 of the 4 numbers, then add back the 4 probabilities of coming before each of the C(4,3) = 4 numbers, then subtract the probability of coming before all 4 numbers. 1 minus this fraction of the time it comes after all 4, in which case we need another 12 rolls to get the 4 since it has probability 1/12.

As you can see, the calculations are getting complicated quickly, and we still have 6 numbers to go. However, the numbers in [] are guaranteed to keep getting smaller since the probability of each number being after all the previous numbers gets smaller as we have more numbers and as the numbers become more probable. At this point, we know that the remaining rolls to be added must be smaller than than the last term in [], which is about 0.054762, times the sum of the average number of rolls for the remaining numbers. So the final answer T must be

T > 60.0571

and

T < 60.05741 + 0.054762*(12+9+9+7.2+7.2+6) =~ 62.81741

So by hand we have computed that it must lie between these two numbers.

Now these terms follow a pattern which I've identified, and such a pattern could be used either in an automated program to compute all of the terms, or it could possibly be used to find a generating function. However, R provides us with a convenient function which will enumerate the combinations of the elements in an array slice. This is exactly what we need here, and this makes the R program to compute all the terms very short. The function is called combn. It returns a 2-dimensional array with the combinations of a given size in each column. We sum these columns for each size combination just as we have been doing by hand.

The following R program computes the exact answer, which comes to 61.21738 rolls, in agreement with the simulations.

Code:
in_36 = c(1,1,2,2,3,3,4,4,5,5,6)
E = c(36,36,18,18,12,12,9,9,7.2,7.2,6)
T = 36
for (i in 2:11) {
  p = 0
  for (j in 1:(i-1)) {
    terms = combn(in_36[1:(i-1)],j)
    for (k in 1:(length(terms)/j)) {
      p = p + (-1)^(j+1) * in_36[i]/(in_36[i] + sum(terms[1:j,k]))
    }
  }
  T = T + (1-p)*E[i]
}

T

Last edited by BruceZ; 06-27-2011 at 07:34 PM. Reason: typo, few more words of explanation
BruceZ is offline   Reply With Quote
Old 06-26-2011, 06:18 AM   #20
newbie
 
Join Date: May 2011
Posts: 17
Re: Dice rolling question

Very clever how BruceZ obtained the answer 61.217 for the two-dice problem with outcomes 2,...,12. Using a tricky approach, Sheldon Ross obtained in his book Introduction to Probability Models the answer to the general coupon collector's problem. Suppose you have $n$ possible outcomes with respective probabilities $p_1,..., p_n$ , then the expected number of trials until you have obtained all possible outcomes is given by the intimidating formula

$E(T)=\inf{0}^{\infty}[1-(1-exp(-p_1 t))*...*-(1-exp(-p_n t))]dt.

In this way you also obtain the answer $E(T)=61.217$ for the two-dice problem with outcomes 2,..,12. However, this requires heavy artillery. How much simpler is the approach of BruceZ.

Note: the integral can numerically be computed by using the free tool www.wolframalpha.com

Last edited by guardiola; 06-26-2011 at 06:32 AM. Reason: hint
guardiola is offline   Reply With Quote
Old 02-23-2012, 02:31 PM   #21
Carpal \'Tunnel
 
BruceZ's Avatar
 
Join Date: Sep 2002
Posts: 7,138
Re: Dice rolling question

I'm bumping this to keep it out of the archive because the Wizard of Odds did a column about my solution and linked to it. He did that back in November, and I just found out about it now. That was for the average rolls to get all the numbers 2-12.

http://wizardofodds.com/ask-the-wizard/278/

4th answer down.

Last edited by BruceZ; 02-23-2012 at 02:47 PM.
BruceZ is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 01:22 PM.


Powered by vBulletin®
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.
Copyright © 2008-2010, Two Plus Two Interactive