Dice Distribution

-Eä-

First Post
Greetings people!

This is just a thingy if you are interested in how dice behave.


When you throw n s-sided dice, the probability of getting the sum p is:


(1/s^n)sum(((-1)^k)(n*Gamma(p-k*s)/(Gamma(1+k)*Gamma(1-k+n)*Gamma(1-n+p-k*s))),k=0..Floor((p-n)/s)))


The probability for a range of numbers, where p1 is the lower bound and p2 is the upper bound, is hence:

sum((1/s^n)sum(((-1)^k)(n*Gamma(p-k*s)/(Gamma(1+k)*Gamma(1-k+n)*Gamma(1-n+p-k*s))),k=0..Floor((p-n)/s))),p=p1..p2)


The standard deviation for throwing n s-sided dice is:

sqrt(n(-1+(s^2))/3)/2


The arithmetic average is:

(n+n*s)/2



If it's interesting, some gaussian distributions may be applied for large n, so that it's more practical to create a large number of results in very little time.


Edit: Fatal typo.
 
Last edited:

log in or register to remove this ad


G'day

Gamma functions are a bitch to compute. And since n and s are integers you can use the much simpler factorial functions instead. But then, your objective is to add heat, not light, isn't it?

And by the way, the expression for the mean simplifies to n(1+s)/2.

Regards,


Agback
 

Agback said:
Gamma functions are a bitch to compute. And since n and s are integers you can use the much simpler factorial functions instead. But then, your objective is to add heat, not light, isn't it?

What, you don't think half-integral and miscellaneous reals are defined for number of dice and their sides?

What if I wanted to roll 2d3.5? ;)
 

-Eä- said:
Greetings people!

This is just a thingy if you are interested in how dice behave.


When you throw n s-sided dice, the probability of getting the sum p is:


(1/s^n)sum(((-1)^k)(n*Gamma(p-k*s)/(Gamma(1+k)*Gamma(1-k+n)*Gamma(1-n+k-k*s))),k=0..Floor((p-n)/s)))


>- snip -<


The standard deviation for throwing n s-sided dice is:

sqrt(n(-1+(s^2))/3)/2


The arithmetic average is:

(n+n*s)/2



If it's interesting, some gaussian distributions may be applied for large n, so that it's more practical to create a large number of results in very little time.
:eek:

.... well, when you put it THAT way it makes sense.

I never was good at equations...
 



Agback said:
G'day

Gamma functions are a bitch to compute. And since n and s are integers you can use the much simpler factorial functions instead. But then, your objective is to add heat, not light, isn't it?

And by the way, the expression for the mean simplifies to n(1+s)/2.

Regards,


Agback


Nahh... Not heat...

The reason why I posted it, was that in the beginning of 3rd edition, I didn't have an apparatus to calculate those distribution, and I could not find any on the boards. Therefore I had to deduce the apparatus myself, which was a lengthy process, so I though that if someone on these boards was interested in the distribution, I would spare them the work to the deduce the formulas themselves.

And, by the way, anyone who wants to compute this for large n and s, needs a computer anyhow, so there is no point in giving the function as a factorial, "faculty" expression.

By the way, nice idea, that with 4d3.5 (-: I might try that!
 

Remove ads

Top