Average Character Stats

6 minute read

Character Stats

In Dungeons and Dragons, each character has five primary abilities: strength, dexterity, constitution, intelligence, wisdom, and charisma. These allow your character to interact with the world. To determine ability scores, you roll four six-sided dice and record the total of the highest three; if you rolled 2, 6, 1, 4, one ability score would be \(2 + 6 + 4 = 12\).

Calculating the average ability score for ``roll four, drop the lowest" is a bit complicated (see the next section for details), but we can do a quick simulation study to find the average score. We call these averages expected values, which tell us the average value we would expect to see if we rolled out character stats millions and millions of times.

To do this simulation in R, we might use the following code:

  nrep <- 10000000
  scores <- numeric(length=nrep)
  for(i in 1:nrep){
    rolls <- sample(1:6, size=4, replace=TRUE)
    scores[i] <- sum(rolls[-which.min(rolls)])
  }
  mean(scores)

There are other ways to write this simulation, but I think this one has the easiest logic to follow! We set the number of repetitions (nrep) to be 10 million. Then, we create a variable to store all 10 million ability scores (scores). The next line starts a loop that runs 10 million times - the function sample represents the four rolls of the 6-sided dice and the sum function adds over the highest four (-which.min removes the lowest roll). Finally, we exit the loop and take the average of the 10 million simulated ability scores.

Running this with 100 million repetitions resulted in an average ability score of 12.24 with a standard deviation of 2.85. Of the 100 million simulated ability scores, 95% were between 6 and 17. This is a pretty simple system - possible scores are integers (whole numbers) ranging from 3 (by rolling 1, 1, 1, 1) to 18 (by rolling 6, 6, 6, and anything else) - so we should expect 100 million repetitions to give us an extremely precise picture of the distribution of rolls.

How much better is this than just rolling three six-sided dice and taking their sum? Well, the average roll for any given d6 is \[\frac{1+2+3+4+5+6}{6}=3.5\] so the average sum is \[3.5 + 3.5 + 3.5 = 10.5.\] The fifth edition D&D Player’s Handbook also offers the following ability scores as an alternative to rolling: 15, 14, 13, 12, 10, and 8. These have an average of 12, which is only slightly worse than the average using rolls of the dice.

Finally, the fifth edition D&D Player’s Handbook has a variant for customizing ability scores, where you have 27 points to spend increasing each score from a baseline of 8. Each time you increase a score by 1, you spend a point. (Increasing to 9 costs 1, to 10 costs 2, etc.). This method sets a maximum score of 15. Notice that the point cost for each ability score is (score\(-8\)). With 27 points to spend across 6 scores, \[\begin{align*} & (x_1 - 8) + (x_2 - 8) + (x_3 - 8) + (x_4 - 8) + (x_5 - 8) + (x_6 - 8) = 27 \\ & \implies x_1 + x_2 + x_3 + x_4 + x_5 + x_6 - 48 = 27 \\ & \implies x_1 + x_2 + x_3 + x_4 + x_5 + x_6 = 75 \end{align*}\] where \(x_i\) is the \(i\)th ability score. An ability score total of 75 means an average score of 12.5, which is actually slightly better on average than the other methods.

Advanced Concept: Order Statistics

The calculation of the expected value relies on something called order statistics. First, the sample space is defined as the collection of all possible unique outcomes. Here, we have a sample space of \(S = \{1,2,3,4,5,6\}\) for each die - all possible unique outcomes consist of all possible results from one roll of a die. We let \(X\) be the random variable associated with a single roll of a die. \(X\) has what is called a discrete uniform distribution, where each possible outcome has the same probability of occurring.

The \(\mathbf{k}\)th order statistic, denoted \(x_{(k)}\) is is the \(k\)th smallest value in a sample. The corresponding random variable \(X_{(k)}\) will have some distribution which is different from the distribution of \(X\). That is, we will find that each possible outcome is no longer equally likely.

In the setting where we roll four; drop the lowest, we drop \(x_{(1)}\) and take the sum \(x_{(2)} + x_{(3)} + x_{(4)}\). The expected value of this sum will be \[E[X_{(2)} + X_{(3)} + X_{(4)}] = E[X_{(2)}] + E[X_{(3)}] + E[X_{(4)}].\]

Another way to think about “roll four; drop the lowest” is by adding the four rolls and then subtracting the minimum, \(x_{(1)}\). This turns out to be a little easier to manage mathematically. Let \(X_i\) represent the \(i\)th (unordered) roll, where \(i\) takes on the values \(1, 2, 3, 4\). Then we can rewrite that expected value as \[E[X_1] + E[X_2] + E[X_3] + E[X_4] - E[X_{(1)}]\] Why is this easier? Well, the expected value of any unordered roll is just the average roll for a six-sided die, \(E[X_i] = 3.5\). So \[E[X_1] + E[X_2] + E[X_3] + E[X_4] - E[X_{(1)}] = 14- E[X_{(1)}]\] and we now only need to find the value of \(E[X_{(1)}]\), the expected value for the minimum roll.

In order to find this expected value mathematically, we will derive the \(k\)th order statistic. To start, we know that \[\begin{align*} P(X \le x) &= \frac{x}{6} \\ P(X=x) &= \frac{1}{6} \\ P(X < x) &= P(X \le x-1) = \frac{x-1}{6} \\ P(X > x) &= 1 - \frac{x}{6} = \frac{6-x}{6} \\ P(X \ge x) &= P(X > x-1) = 1 - \frac{x-1}{6} = \frac{7-x}{6} \end{align*}\] for \(x = 1,2,3,4,5,\) or \(6\). We can work out these quantities based on the discrete uniform distribution on (1,6) or we can work these out conceptually. For example, \[\begin{align*} P(X \le 2) &= P(\text{roll a 1 or roll a 2}) \\ &= \frac{\text{2 ways to get a roll that is less than or equal to two}}{\text{6 possible outcomes}}\\ &= \frac{2}{6}. \end{align*}\]

Consider \(P(X_{(1)} \ge x)\). If the minimum value is greater than or equal to \(x\), necessarily all of the other values will also be greater than or equal to \(x\). This idea will simplify our calculations significantly. \[\begin{align*} P(X_{(1)} \ge x) &= P(\text{all rolls are greater than or equal to }x) \\ &= P(X_1 \ge x \text{ and } X_2 \ge x \text{ and } X_3 \ge x \text{ and } X_4 \ge x) \\ &= P(X_1 \ge x)\times P(X_2 \ge x)\times P(X_3 \ge x)\times P(X_4 \ge x) \\ &= \frac{7-x}{6}\times\frac{7-x}{6}\times\frac{7-x}{6}\times\frac{7-x}{6} \\ &= \left(\frac{7-x}{6}\right)^4 \end{align*}\]

Similarly, \[\begin{align*} P(X_{(1)} > x) &= P(\text{all rolls are greater than }x) \\ &= P(X_1 > x \text{ and } X_2 > x \text{ and } X_3 > x \text{ and } X_4 > x) \\ &= P(X_1 > x)\times P(X_2 > x)\times P(X_3 > x)\times P(X_4 > x) \\ &= \frac{6-x}{6}\times\frac{6-x}{6}\times\frac{6-x}{6}\times\frac{6-x}{6} \\ &= \left(\frac{6-x}{6}\right)^4 \end{align*}\]

Finally, \[\begin{align*} P(X_{(1)} = x) &= P(X_{(1)} \ge x) - P(X_{(1)} > x) \\ &= \left(\frac{7-x}{6}\right)^4 - \left(\frac{6-x}{6}\right)^4 \end{align*}\]

With the probability distribution, or probability mass function, for the minimum, we are now ready to calculate the expected value of our roll 4, drop the lowest setting.

The probability distribution can be summarized as

x 1 2 3 4 5 6
\(P(X_{(1)} = x)\) 0.518 0.285 0.135 0.050 0.012 0.001

this probability distribution has expected value \[ E(X_{(1)}) = \sum_{j=1}^6 x_j P(X_{(1)} = x_j) = 1.755\]

Returning to the average value for the roll four and drop the lowest, \[\begin{align*} E[X_1] + E[X_2] + E[X_3] + E[X_4] - E[X_{(1)}] &= 14- E[X_{(1)}] \\ &= 14 - 1.755 \\ &= 12.2446 \end{align*}\] and we find that, in fact, the simulation study was quite accurate!