The Straight Dope

Go Back   Straight Dope Message Board > Main > General Questions

Reply
 
Thread Tools Display Modes
  #1  
Old 09-03-2002, 05:31 AM
ricksummon ricksummon is offline
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!"
Reply With Quote
Advertisements  
  #2  
Old 09-03-2002, 05:46 AM
sirjamesp sirjamesp is offline
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.
Reply With Quote
  #3  
Old 09-03-2002, 06:41 AM
ricksummon ricksummon is offline
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!"
Reply With Quote
  #4  
Old 09-03-2002, 06:53 AM
SpaceDog SpaceDog is offline
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
Reply With Quote
  #5  
Old 09-03-2002, 06:55 AM
Diceman Diceman is offline
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.
Reply With Quote
  #6  
Old 09-03-2002, 06:56 AM
SpaceDog SpaceDog is offline
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.
Reply With Quote
  #7  
Old 09-03-2002, 06:58 AM
sirjamesp sirjamesp is offline
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.
Reply With Quote
  #8  
Old 09-03-2002, 06:58 AM
Jabba Jabba is offline
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.

Well, you asked.
Reply With Quote
  #9  
Old 09-03-2002, 10:13 AM
zut zut is offline
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.
Reply With Quote
  #10  
Old 09-03-2002, 11:11 AM
CurtC CurtC is offline
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.
Reply With Quote
  #11  
Old 09-03-2002, 11:29 AM
CurtC CurtC is offline
Guest
 
Join Date: Dec 1999
Please forget I said that. Other shapes of dice can be fair.
Reply With Quote
  #12  
Old 09-03-2002, 04:23 PM
xash xash is offline
Ogministrator
Administrator
 
Join Date: Jan 2001
Location: Palo Alto, CA
Posts: 4,132
here's some additional explanation:

http://boards.straightdope.com/sdmb/...hreadid=132737
Reply With Quote
  #13  
Old 09-03-2002, 05:43 PM
Chronos Chronos is offline
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
Reply With Quote
Reply

Bookmarks

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 Off
HTML code is Off
Forum Jump


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


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Send questions for Cecil Adams to: cecil@chicagoreader.com

Send comments about this website to: webmaster@straightdope.com

Terms of Use / Privacy Policy

Advertise on the Straight Dope!
(Your direct line to thousands of the smartest, hippest people on the planet, plus a few total dipsticks.)

Publishers - interested in subscribing to the Straight Dope?
Write to: sdsubscriptions@chicagoreader.com.

Copyright © 2013 Sun-Times Media, LLC.