Calculating Probability Distributions


log in or register to remove this ad

Piratecat said:
For the love of God, someone relate this to D&D so I don't have to move it to the Off Topic forum! :)

Mialee wants to know how much damage she can expect to inflict with her scorching ray against a creature with Fire Resistance 10 so that she can calculate whether her average damage with three rays would be better or worse than buckle boy's average damage after the odds of the foe successfully saving are figured in. :D
 

There are formulas out there, but they're far from elegant and much easier to implement in a software program than do them manually.

To calculate the probability of getting a certain result S on a roll of N M-sided dice, use the following:

P(S) = (M^(-N))*SUM(from k=0 to Floor((S-N)/M))[(-1)^k * C(N,k)*C((S-1-M*k),N-1) where C(x,y) implies x!/(y!*(x-y)!)

Complicated but simple in a PC. :) Hope I got that down correctly. :eek:

Let's see. For rolling 5 on a 1d6:

M=6,N=1,S=5: The floor function is 0 (rounding down 5/6), with k hence only being 0 to 0. C(N,k) is C(1,0) which is 1, while the other C function is C(4,0) which is 1 as well.

So the probability boils down to 1/6*1*1*1=1/6 which it should be. ;)

Edit: You can check out the following online calculator for this formula: http://www.vrtisworks.com/kiki/fun/cdice.htm

Pinotage
 
Last edited:

Oh, and averages are pretty straightforward. Just sum up all possible results of the particular die set roll, and divide by the number of results.

So for 4d6 sum 1 to 24 and divide by 24. For 4d6-10, first calculate the possible results: 10 cases of 0, and then 1 to 14. Sum those and divide by 24. The average of 4d6-10 (minimum 0) gives 4.375.

So Mailee is going to be pretty rubbish against that Fire Resistance creature. :)

Pinotage
 

Ok... So how about the following:
throw 4d6 and discard the lowest, what would the average result be?

btw, there's no result of 1-3 with 4d6...
 


there's a very useful theorem which says that the probability mass function (PMF) of the sum is the convolution of the PMFs of the addends. This sounds complicated perhaps, but it's very simple to apply with dice, since they have uniform discrete distributions. You can do it manually, but it's well suited to computer code, and there are extremely efficient algorithms for it. Also, if you happen to know the characteristic function (CF) of the addend distributions, the CF of the total is just the CFs of the addends multiplied together.

....

.......

mustn't sleep... clowns will eat me...
 



Remove ads

Top