Any Math Geeks out there that like to mess with Dice averages?

Re: Re: Re: Re: Average stat total for PHB PC's

CRGreathouse said:


The functions didn't make much sense, and I don't have Maple (that's a computer algebra system, or something similar, right?).

I'm using a hand calculator, Excel, basic programming software, and what I remember of probability...

Yes, Maple is a Computer Algebra System but I use it for this problem only as a programming tool, which can compute with large numbers.

You could also use any programming language which can handle very large integers. And for languages like C there are libaries for large integers.

Why did you say the functions didn't make much sense? Was my description of P(n, u, m, c) not clear enough?
 

log in or register to remove this ad

Re: Re: Re: Re: Re: Average stat total for PHB PC's

Nathan said:
Why did you say the functions didn't make much sense? Was my description of P(n, u, m, c) not clear enough?

No, it wasn't clear enough. Actually, did you explain it at all?

*****

The program finished!

I didn't get the same result as you did. mine was 74.13775939, vs. your 74.68778863.
 
Last edited:

Re: Re: Re: Re: Re: Re: Average stat total for PHB PC's

CRGreathouse said:


No, it wasn't clear enough. Actually, did you explain it at all?

*****

The program finished!

I didn't get the same result as you did. mine was 74.13775939, vs. your 74.68778863.

Edit: I can break this down by the probability of each stat total, if you'd like.

Hmmm... Do you think the discrepancy is due to numerical reasons, i.e. rounding errors? Since I calculated with rational numbers, then my result should be correct.

If you want, we can compare the probabilities of each stat total, however this will lead to a huge list, won't it?

*****

Another try (first try???) for the explanation of my function P:

Given n, m, u, c. The experiment is the following:

Roll n stats (with the normal method 4d6, drop lowest).

The question is: How many outcomes with stat total n, ability modifier total m, and with each stat less or equal c does this experiment have?

I call this number P(n, u, m, c).

For example:

P(1, 17, 3, 18) = 3, i.e. there are 3 possibilites to get a 17 (with total modifier 3, which is no extra condition here) with 1 stat roll that can be anything less or equal 18.
 

Correction of my previous result

Ehem, my 74.68... was the answer to the wrong problem. I calculated the average total stats for PC's which have to have at least a total modifier of 0 and not one of 1 as suggested in the PHB.

My new answer is 75.03... which is sadly even further away from CRGreathouse's result.
 

Re: Correction of my previous result

Nathan said:
Ehem, my 74.68... was the answer to the wrong problem. I calculated the average total stats for PC's which have to have at least a total modifier of 0 and not one of 1 as suggested in the PHB.

My new answer is 75.03... which is sadly even further away from CRGreathouse's result.

I'm not entirely sure I'm correct, either, to be honest. The numbers looked odd somehow.

There are rounding errors, but this isn't the main cause... rounding errors surely won't affect the first 5 digits. (I'm calculating these as 15-digit floating-point numbers.)

Edit: I've removed some portions of my program that could possibly introduce error beyond rounding. I don't think that any of these were causing the error, but I'm not sure how else I could have made a mistake... it's such a simple program.

Unfortunately, this means that the program will take near-forever to run. I'll just leave my computer on for the next hour and see how close it gets.
 
Last edited:

Elric said:

Nathan- a generalized formula will probably be very, very complex. I think that I figured out the exact formula for the average when you roll N S-sided dice and keep only the highest number rolled. However, it involves Bernoulli numbers and it was very hard to derive even the simplest case (roll 2, keep 1) by hand.

I haven't seen your post, Elric, so far. However it has convinced me to post my method of calculation:

The experiment is the following:

We roll an s-sided die n times and add up the k highest results.

We ask for the average outcome, say E(n, k, s), of this experiment.

The answer is:

E(n, k, s) = the sum of

n! / (l! * (n - l - k + r)! * (k - r)!) * (t - 1)^l * (s - t)^(k - r) * (r * t + (k - r) * (s + t + 1)/2)

over t = 1,..., k; l = 0, ... n-k; r = 1... k and then divided by
s^k.

Here n! means n faculty := 1 * 2 * ... * n, i.e.
4! = 1 * 2 * 3 * 4 = 24.
Further x^n means x to the power n := x * x * ... * x where the x occures n times, i.e.
6^4 = 6 * 6 * 6 * 6 = 1296.
 

OK, I have results.

For 7 4d6 drop lowest:
highest...... 2nd ......... 3rd.......4th........5th ........lowest
0.000000,0.000000,0.000000,0.000000,0.000000,0.000012
0.000000,0.000000,0.000000,0.000000,0.000002,0.000296
0.000000,0.000000,0.000000,0.000001,0.000050,0.002398
0.000000,0.000000,0.000000,0.000019,0.000637,0.012058
0.000000,0.000000,0.000011,0.000304,0.004784,0.041736
0.000000,0.000008,0.000211,0.002943,0.023751,0.105571
0.000005,0.000163,0.002305,0.017748,0.078850,0.191997
0.000098,0.001882,0.015405,0.068727,0.176521,0.247765
0.001117,0.012893,0.063214,0.168782,0.259088,0.216913
0.008047,0.056064,0.166167,0.268466,0.249504,0.126464
0.037207,0.154466,0.273646,0.264945,0.147849,0.045052
0.111862,0.266702,0.272883,0.153345,0.049857,0.008875
0.217702,0.278585,0.154494,0.047436,0.008477,0.000833
0.282793,0.171351,0.045980,0.006944,0.000617,0.000030
0.233109,0.052663,0.005543,0.000338,0.000012,0.000000
0.108059,0.005223,0.000142,0.000002,0.000000,0.000000

For 7 4d6 drop lowest and throw out hopeless chars.:

0.000000,0.000000,0.000000,0.000000,0.000000,0.000002
0.000000,0.000000,0.000000,0.000000,0.000000,0.000084
0.000000,0.000000,0.000000,0.000000,0.000004,0.000731
0.000000,0.000000,0.000000,0.000000,0.000097,0.005481
0.000000,0.000000,0.000000,0.000011,0.000942,0.022123
0.000000,0.000000,0.000005,0.000450,0.010047,0.082046
0.000000,0.000001,0.000159,0.004932,0.046465,0.174561
0.000000,0.000107,0.004463,0.042308,0.161036,0.268710
0.000006,0.002599,0.035234,0.144306,0.270244,0.242141
0.002446,0.036136,0.150330,0.283097,0.278632,0.142417
0.021597,0.134082,0.281221,0.291430,0.166130,0.050737
0.099558,0.275308,0.299073,0.171941,0.056145,0.009995
0.213137,0.298815,0.171606,0.053323,0.009547,0.000938
0.297093,0.188772,0.051528,0.007818,0.000695,0.000034
0.248661,0.058354,0.006221,0.000381,0.000014,0.000000
0.117502,0.005826,0.000159,0.000003,0.000000,0.000000

I checked the probability for having 18 as the highest score analytically in the 1st case. See my previous post for the columns/row labels. I didn't bother to compute the mean since it's not really very useful here, but you can easily do it from this data with Excel or something.

It took approximately 1 minute per run.
 

Re: Re: Correction of my previous result

CRGreathouse said:


I'm not entirely sure I'm correct, either, to be honest. The numbers looked odd somehow.

There are rounding errors, but this isn't the main cause... rounding errors surely won't affect the first 5 digits. (I'm calculating these as 15-digit floating-point numbers.)

Edit: I've removed some portions of my program that could possibly introduce error beyond rounding. I don't think that any of these were causing the error, but I'm not sure how else I could have made a mistake... it's such a simple program.

Unfortunately, this means that the program will take near-forever to run. I'll just leave my computer on for the next hour and see how close it gets.

How do you add your numbers? Do you add all possibilities for all possible outcomes? Maybe the very small ones lead to errors???

The lowest outcome is 62 according to my formula. Its possibility is 0.000424...

What is your result to this question?
 

Re: Re: Re: Correction of my previous result

Nathan said:


How do you add your numbers? Do you add all possibilities for all possible outcomes? Maybe the very small ones lead to errors???

The lowest outcome is 62 according to my formula. Its possibility is 0.000424...

What is your result to this question?

Addition to these results:

The possibility to get a total of 108 (i.e. rolling an 18 all six times) is

0.2 * 10^(-10).

For example if your program ran with 9 digit precision, it wouldn't even have noticed this value...

I'll try to force Maple to calculate with 15 digit precision. I would like to know if this will change the answer...

Edit: Answer: Even calculating with a two digit precision gives a correct result (up to two digits, of course). So this leads to know explanation of the discrepancy.

And, I will go to bed now. I am going to look tomorrow morning for new results in this thread.

Have a good night (or a nice day, depending on where you are)!
 
Last edited:

Nathan said:


Sigil, are you interested in my solution of the problem?
Quite.

I could give it a little more effort if I weren't literally in the middle of purchasing my first home here (just accepted a counter offer 5 minutes ago), so forgive me if my brain is elsewhere and my thoughts are scattered at best.

--The Sigil
 

Remove ads

Top