
![]() |

Didn't really know where to post this, and my Google-fu is weak right now (distracted by several things at the moment), so I figured I'd enlist the aid of the wonderful Paizo community to aid me.
How does one determine the average of dice rolls if some of those dice are being ignored?
Example: 3d6 averages to 10.5, or 10 or 11. What would the average of the highest 3 of 4d6 be? Or the highest 3 of 5d6?

Aaron Bitman |

I only know of one practical way to determine the answers: by writing a computer program to loop through all possibilities, and take the average.
Here are the results I got:
4d6 take highest 3 -> 12.24459876543210
5d6 take highest 3 -> 13.43016975308642
(That first result is funny. One might almost think that I'd made it up.)
Of course, you should never believe any programmer who claims to be infallible. The only double-checking I did was to "spot check" a few iterations. So anyone who's reading this should feel free to challenge my results.

Aaron Bitman |

You know, ever since I wrote that post - almost NINE YEARS AGO now - a little point has been troubling me. In the D&D 3.0 and 3.5 handbooks, the official, default method for ability score generation is 4d6-and-take-the-best-3... but with one additional bonus. If the ability score array you roll is too low (before racial adjustments), you may scrap it and roll a new array. Your ability scores are considered "too low" if your total modifiers are 0 or less, or if your highest score is 13 or lower.
So I've been wondering for these nine years: how does that affect the average?
Lately, I've been studying a new programming language, Python, and I've been writing programs in it for practice. Recently, it occured to me to write a program to find out the average ability-score roll that accounts for the reroll-if-too-low rule. How much of a difference would that make?
The TL;DR version of my conclusion is: not much. Instead of 12.2, the average becomes 12.5. Now I finally know.
The longer version of my story delves into some detail. When it was simply a matter of testing 4d6, there were only 6**4 possible rolls, a mere 1296. So I could just loop through all those rolls with no problem.
But when I had to account for the entire ability score array, that was a different story. Then I had to account for all TWENTY-FOUR rolls, so the number of possible rolls was 6**24, which is over 4 QUINTILLION! I somehow had the confused idea that I could write a program to loop through all those possibilities, so I did so, without even writing the code to compute the results. And understand that I'm just writing code with my humble laptop and free software, nothing fancy. I timed how long it took for my program to run through a few die-combinations, and soon realized that looping through all the possibilities would take TENS OF THOUSANDS OF YEARS!
So instead, I had my program take random die rolls and roll up a mere one million sample ability score arrays. I found that the results I got seemed pretty stable with a sample size that big.
And once again, I invite anyone to challenge my results. In fact, I'm going to do what I SHOULD have done nine years ago: post my source code so that other people have a chance to check it and find any mistakes I might have made, or at least criticize my approach to the problem. Look my code up here.

Aaron Bitman |

There's a way to use probability theory to calculate these without crunching all those numbers, but it's been 35 years since I took that course and my old textbook is long gone.
Well, if anyone can use an alternative approach, I would be interested in hearing whether that person's answer approximates mine or not.

Kir'Eshe |

I only know of one practical way to determine the answers: by writing a computer program to loop through all possibilities, and take the average.
Here are the results I got:
4d6 take highest 3 -> 12.24459876543210
5d6 take highest 3 -> 13.43016975308642(That first result is funny. One might almost think that I'd made it up.)
Of course, you should never believe any programmer who claims to be infallible. The only double-checking I did was to "spot check" a few iterations. So anyone who's reading this should feel free to challenge my results.
We did a simulation for the expected value of a point buy using d6's for the party. I adapted it to verify the 4d6 and take highest 3 to check.
12.2427 with 120k values and a s.d. of 2.8456
Your set space was more efficient and accurate for 4d6. The custom formula was used in different aspects to arrive at reasonable ability rolls that aligned with an expected point buy for us.

Aaron Bitman |

In the D&D 3.0 and 3.5 handbooks, the official, default method for ability score generation is 4d6-and-take-the-best-3... but with one additional bonus. If the ability score array you roll is too low (before racial adjustments), you may scrap it and roll a new array. Your ability scores are considered "too low" if your total modifiers are 0 or less, or if your highest score is 13 or lower.
So I've been wondering for these nine years: how does that affect the average?
Lately, I've been studying a new programming language, Python, and I've been writing programs in it for practice. Recently, it occured to me to write a program to find out the average ability-score roll that accounts for the reroll-if-too-low rule. How much of a difference would that make?
The TL;DR version of my conclusion is: not much. Instead of 12.2, the average becomes 12.5. Now I finally know.
In addition to Python, I've been writing programs in Java to stay in practice with THAT language as well. Java often seems more powerful than Python, so I thought I could write a Java version of that study as well and use a larger sample size this time. (With my Python study, I took a sample size of 1 million ability score arrays.)
And my results were much the same: the average was 12.5.
But although I found the results were pretty stable with a sample size of 10 thousand, I exercised Java's greater power with a sample size of one BILLION! Processing that many ability score arrays took Eclipse, running on my humble laptop, about 15 minutes.
And again, I submit my source code. Here it is.