View Single Post
  #3   Report Post  
Jerry W. Lewis
 
Posts: n/a
Default

A particular ordered roll of dice occurs with probability 1/z^y,
multiply that by the number of ordered rolls, c, that can give a
particular sum. Assuming that the faces are numbered 1,2,...,z
sum c
<y 0
y 1
y+1 y=COMBIN(y,1)
y+2 y(y+1)/2=COMBIN(y,1)+COMBIN(y,2)
y+3 y(y+1)(y+2)/6
=COMBIN(y,1)+MULTINOMIAL(1,1,y-2)+MULTINOMIAL(1,1,1,y-3)/3!
...
The logic for y+3 is that
- one die could have 4, with the rest all 1's
- one die could have 3, another could have 2, with the rest all 1's
- three dice could have 2, with the rest all 1's

In the last case, MULTINOMIAL(1,1,1,y-3) is the number of ways to choose
locations that do not contain 1, but since all of those locations
contain the same value, MULTINOMIAL will overcount by a factor of 3!

You have to be careful to not overcount cases where multiple dice
contain the same value. You also have to be careful for y+k where k=z,
since it is no longer possible to have y-1 dice all with 1's and the
rest of the sum on a single die.

For 1<k<z,
sum(c[i],i=1..y+k) = Product(y+i,i=1..k)/i!
which gives individual c's by subtraction, but this will overcount for k=z.

You can take advantage of symmetry, since
Pr(sum=y*z-k) = Pr(sum=y+k)
for k=0

Jerry

Galamdring wrote:

Greetings,

I have been trying to make a worksheet in excel 2003 to calculate
probabilities associated with dice throws... I am setting it up so that
i can define the number of dice i want to roll and also the number of
sides they have... I found that rand between is a good way to simulate
it...

My problem is with probabilities. Is there a function or a way to
automatically calculate the probability of having a result of x as the
sum of y dice with z sides each? The prob function requires you to have
an array with results and probabilities... It is too cumbersome to make
by hand for... say... 40 eight sided dice!

Thanks in advance :)