Dice Probability [Archive] - Wizards Community

Post/Author/DateTimePost
Man-Rata

12-09-06, 01:53 PM
Any one know what the formula for calculating Dice probability is?

What is the probability that X dice Y will roll higher than or equal to Z, I need a general formula for my spreadsheet if I want to be able to put in DR and Energy Resistance.

I know how to calculate probability, but I can't figure out how to make a general formula. :confused:
Solaris

12-09-06, 01:55 PM
What does "X dice Y" mean?
TheChilliGod

12-09-06, 01:59 PM
I suppose he means XdY. 4d4, 2d6, that sort of thing.

Unfortunately, I haven't been able to do a formula. I have attempted a spreadsheet on this, however, but I filled in all the blanks manually until I got all 1296 results of a 4d6DL.
But you may not have that much spare time. I wish you luck.
Man-Rata

12-09-06, 02:02 PM
Yes, it is exactly something like 4d6 or 10d4 i mean, must be an easy way, somthing like y!/y!(x-y)^x, well that's probably far fetched, but seem to remember something about the faculty of things, divided by something, gave the result.
Solaris

12-09-06, 02:44 PM
The best I've been able to work out is:

The number of ways to roll n on d s-sided dice is
sum{i,j : si + j = n-d} (-1)^i C(d,i) C(d+j-1,j)
where
C(a,b) = a!/(b!(a-b)!).

This still needs a program to compute, but completes in time proportional to d, instead of s^d for brute-force.
Man-Rata

12-09-06, 07:06 PM
What is 'i' and 'j' in your formula?
Solaris

12-09-06, 07:14 PM
What is 'i' and 'j' in your formula?

Summation variables; you're taking the sum over all i and j such that si + j = n - d. The simplest way is to loop for i from 0 to d, letting j = n - d - si, and summing when j is greater than or equal to 0.
Oswald Krato

12-09-06, 08:53 PM
You may need to split it into a few columns by dice type...

I'm pulling everything I've got from here: http://en.wikipedia.org/wiki/Combinatorics

NdS having probability of result greater than or equal to R...

Okay...order does not matter and each die can be chosen only once. N dice with each of S numbers which come up 1/S of the time.

R can only be from N to S*N, most probable are sums near the average of N and S*N... I don't know exactly.