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.
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: