Straight Dope Message Board > Main Dice Probability
 Register FAQ Calendar Mark Forums Read

#1
09-03-2002, 05:31 AM
 ricksummon Guest Join Date: Apr 2000
Dice Probability

If you have x dice with y sides each, the total of the dice roll can be anywhere from x to x*y. My question is, how do you calculate the probability of rolling a specific number?
__________________
"Look, if I argue with you, I must take up a contrary position."
"Yes, but that isn't just saying 'No, it isn't!'"
"Yes, it is!"
"No, it isn't!"
#2
09-03-2002, 05:46 AM
 sirjamesp Guest Join Date: Sep 2001
I'm no maths guru, but I'd just work out the probability of not getting a specific number, and subtract this from 1.

So - on one die with y sides, the probability of not getting your particular number is:

p = [y-1]/y

(i.e. 5/6 for a 6 sided die)

The probability of not getting your number when throwing two dice (or one die twice) is thus

p = [y-1]/y * [y-1]/y = ( [y-1]/y] )^2

(i.e. 25/36 for teo 6 sided dice)

And thus for x dice:

p = ( [y-1]/y )^x

So, the probability of getting a specific number must be:

p = 1 - ( [y-1]/y )^x

(i.e. around 2/3 chance of throwing a single 6 when rolling six 6-sided dice)

...I think.
#3
09-03-2002, 06:41 AM
 ricksummon Guest Join Date: Apr 2000
No, that's not quite what I'm talking about.

Say you roll 2d6. The total of this dice roll can be anything from 2 to 12. The following permutations are available:

11 = 2
12 21 = 3
13 22 31 = 4
14 23 32 41 = 5
15 24 33 42 51 = 6
16 25 34 43 52 61 = 7
26 35 44 53 62 = 8
36 45 54 63 = 9
46 55 64 = 10
56 65 = 11
66 = 12

So, the probability of rolling a 2 on 2d6 is 1/36, while the probability of rolling a 7 is 6/36. What I want to know is a formula that can be used to generalize this result for any number of dice with any number of sides.
__________________
"Look, if I argue with you, I must take up a contrary position."
"Yes, but that isn't just saying 'No, it isn't!'"
"Yes, it is!"
"No, it isn't!"
#4
09-03-2002, 06:53 AM
 SpaceDog Guest Join Date: Sep 2001
Well you've got x dice with y sides each. That x * y possible combinations.

So if you work out the number of ways to get your number (remembering the ordering is important) and call this C.

Then the probability of getting the number C is C/(x*y).

I think. I'll see if I can think of a fast way to find the C part.

SD
#5
09-03-2002, 06:55 AM
 Diceman Guest Join Date: Mar 1999
Dice Probablility? Is s/he related to me somehow?

(sorry, couldn't reseist )
__________________
Reality is an illusion caused by lack of alcohol.
#6
09-03-2002, 06:56 AM
 SpaceDog Guest Join Date: Sep 2001
Quote:
 Originally posted by SpaceDog Well you've got x dice with y sides each. That x * y possible combinations.
Which is, of course, nonsense. There's y ^ x combinations.
#7
09-03-2002, 06:58 AM
 sirjamesp Guest Join Date: Sep 2001
Ah, I misunderstood. That's a bit embarrassing...

Still, SpaceDog has the method, but I don't know off hand what the general formula for working out what the "C" is. Hopefully some smart Doper can come on and tell us, saving anyone the hassle of working it out from scratch.
#8
09-03-2002, 06:58 AM
 Jabba Guest Join Date: Mar 2002
sirjamesp has answered the question: what is the probability that at least one die shows the number n, where 1 £ n £ y. But this is not how I interpreted your question. I shall attempt to answer the question: What is the probability that the sum of the scores on the dice is m, where x £ m £ xy.
Let the score on the ith die be Xi. Then the total score is
X = Xi+ ... + Xx
The probability generating function ( pgf) for Xi is
G(t) = ( t + t2 + ... + ty)/y
= t( 1 - ty)/y( 1 - t)
Since the Xi are independent, the pgf of X is the product of these, namely
tx( 1 - ty)x/yx( 1 - t)x

The rquired probability is the coefficient of tm in this expression, namely the coefficient of tm-x in
( 1 - ty)x/yx( 1 - t)x

We need to expand the expressions in the numerator and denominator of this fraction. Let C(n,r) denote the binomial coefficient. Then
( 1 - ty)x = 1 - C(x,1)ty + C(x,2)t2y - ... + (-1)xtxy
and
( 1 - t)-x = 1 + C(x,1)t + C(x+1,2)t2 + ...

To get a term tm-x we need a term tky from the first expression and a term tm-x-ky from the second. The coefficient of this product is (-1)kC(x,k)C(m-ky-1,m-x-ky). The required probability is thus
{C(m-1,m-x) - C(x,1)C(m-y-1,m-x-y) + C(x,2)C(m-2y-1,m-x-2y) - ...}/yx
where the sum continues as long as all the binomial coefficients are defined.

#9
09-03-2002, 10:13 AM
 zut Charter Member Join Date: Apr 2000 Location: Detroit, MI Posts: 3,569
Dunno if this helps, but here is MathWorld's answer to the question. If'n you just want to calculate a probability number, and not necessarily know the formula behind it, try this Java applet I stumbled across.
#10
09-03-2002, 11:11 AM
 CurtC Guest Join Date: Dec 1999
Of course, you could do it manually for four-sided, six-sided, eight-sided, twelve-sided, and twenty-sided dice. Any others couldn't have equal probabilities for all the sides.
#11
09-03-2002, 11:29 AM
 CurtC Guest Join Date: Dec 1999
Please forget I said that. Other shapes of dice can be fair.
#12
09-03-2002, 04:23 PM
 xash Ogministrator Administrator Join Date: Jan 2001 Location: Palo Alto, CA Posts: 4,132

#13
09-03-2002, 05:43 PM
 Chronos Charter Member Join Date: Jan 2000 Location: The Land of Cleves Posts: 47,976
If you have enough dice, you can approximate this very well by a Gaussian distribution. For n dice, each with k sides (numbered 1 to k), the mean will be n*(k+1)/2, and the standard deviation will be sqrt(n)*s(k), where s(k) is the standard deviation for a single k-sided die (s(6) = 1.7078251, and s(k) ~= .28867*k for k large).
__________________
Time travels in divers paces with divers persons.
--As You Like It, III:ii:328

 Bookmarks

 Thread Tools Display Modes Linear Mode

 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 Off HTML code is Off
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Main     About This Message Board     Comments on Cecil's Columns/Staff Reports     Straight Dope Chicago     General Questions     Great Debates     Elections     Cafe Society     The Game Room     In My Humble Opinion (IMHO)     Mundane Pointless Stuff I Must Share (MPSIMS)     Marketplace     The BBQ Pit Side Conversations     The Barn House

All times are GMT -5. The time now is 10:16 PM.