So, I recently started playing Dungeons and Dragons. The game involves determining virtually every outcome through dice rolls. Unsurprisingly, this yields a lot of room for probabilistic analysis.

Rolling Base Stats

When building a new character, there are 6 base stats that are calculated:

  • Strength
  • Dexterity
  • Constitution
  • Intelligence
  • Wisdom
  • Charisma

Each stat determines different abilities, and every class values different stats.

There are three ways to calculate base stats:

  • 27 point buy
  • Allocate from the standard array: 15, 14, 13, 12, 10, 8
  • for each stat, roll four 6-sided dice (4d6) and take the sum of the highest 3

I was curious about the balance between the three options. The first two options make for building a character are fairly straightforward. Evenly distributing the points with the 27-point buy yields an average stat value of 12.5, while the standard array yields an average of 12. Also, note that the standard array can be generated using the 27-point buy.

The third option is a bit trickier to analyze. Fortunately, using Anydice, I could simulate the distribution of outcomes. It yields a mean of 12.24, with a mode at 13. In essence, you can expect a similar stat distribution with this method compared to the 27-point buy.

However, the 27-point buy system sets a hard limit on how many points can be allocated towards a single stat (stats at first level can’t be set to higher than 15 or lower than 8).

Advantage and Disadvantage

When playing Dungeons and Dragons, most challenges (attacks, ability checks and saving throws) will be resolved with a d20 roll (a 20-sided dice). The expected value for a single (fair) 20-sided dice is simple to compute: 10.5.

However, sometimes a player will have advantage on a d20 roll, in which case they roll two d20’s and take the higher roll. On the flipside, disadvantage forces a player to take the lower value from two d20 rolls. Of course these will shift the probability distributions and the expected rolls, but by how much?

Again, using Anydice, a roll with advantage has a distribution where the PMF increases linearly with the value of the roll, yielding a 9.75% chance of rolling a natural 20. With disadvantage, the PMF is virtually the same, but sloping in the opposite direction, yielding a 9.75% chance for rolling a natural 1.

The expected value in each case shifts by about 3.33.

Exact probabilities:

  • Normal: \(\begin{equation} P(x \ge n) = \frac{21-n}{20} \end{equation}\)
  • Advantage: \(\begin{equation} P(x \ge n) = \frac{-n^2 + 2n + 399}{400} \end{equation}\)
  • Disadvantage: \(\begin{equation} P(x \ge n) = \frac{n^2 - 42n + 441}{400} \end{equation}\)

I’ve made a little visualization (original credit) that shows how success probabilities vary with ability modifiers, Difficulty Class (DC), and advantage/disadvantage. The DC describes the d20 roll (before adding modifiers) required to succeed in a particular task (resisting poison or magical effects, avoiding a hostile creature, finding food, etc.).

One thing should be noted: In many games, a natural 20 is always considered a success and a natural 1 a failure, regardless of the DC. This is why the probability is always strictly greater than 0, but strictly less than 1.


Great Weapon Master/Sharpshooter

Great Weapon Master (GWM) and Sharpshooter are optional abilities which enable characters to sacrifice accuracy for additional damage. Generally, when declaring an attack, the attack hits if the d20 roll (plus the player’s attack modifier) equals or exceeds the target’s armor class (AC). With these feats, a player can take a -5 penalty to their roll in exchange for +10 damage.

The expected damage for each case is as follows (assuming no advantage/disadvantage):

  • With GWM/Sharpshooter: \(\begin{equation} \frac{(damage+10)(16-AC+modifier)}{20} \end{equation}\)
  • Without GWM/Sharpshooter: \(\begin{equation} \frac{(damage)(21-AC+modifier)}{20} \end{equation}\)

The question becomes: When should a player choose to use it?

By setting the two expected values equal and applying some tedious algebra, we get the following:

\[\begin{equation} AC = 16+modifier - \frac{damage}{2} \end{equation}\]

This describes the maximum AC for which it is beneficial to utilize the GWM/Sharpshooter damage bonus. Beyond this threshold, it is better to attack normally. Intuitively a higher attack modifier means a higher threshold, as the chance of an attack landing is higher.

What is not as intuitive is the penalty associated with having higher expected damage (without the ability). I interpret is as being an opportunity cost; The higher one’s base damage, the more damage output they risk losing by taking the -5 penalty.

With Advantage/Disadvantage, the probability distribution for a successful hit changes, so this formula doesn’t necessarily apply.

Parting words

“I’m attacking the darkness!”

Update: Interesting read