31/08/2020

Advantage and Disadvantage Probability Calculations in D&D 5e

Previously, I have shown the curve of success probability of ability checks in D&D 5e. The idea there was to use the complementary event of rolling failing twice for advantage in order to show the success of at least one of the rolled d20

\[ P_\text{adv}(x \geq  DC) = 1 - P_\text{1d20}(x < DC)^2 = 1 - [1 - P_\text{1d20}(x \geq  DC)]^2  \] On the other hand, a success in a disadvantage roll occurs when both d20 succeed the ability check

\[ P_\text{dis}(x \geq  DC) = P_\text{1d20}(x\geq  DC)^2 \]


Though these probability functions are correct, there is a more graphical way of representing them, which I am showing next. We can build matrices showing which values prevail according to the result of 2d20. 

Matrix of probabilities showing the best result of 2d20. Same results are marked with the same colours.
Matrix of probabilities showing the worst result of 2d20. Same results are marked with the same colours.

In the matrices of showing the result of the best and worst of 2d20, we can count how many times each result appears in the \( 20 \times 20 = 20^2 = 400 \) possible combinations. For instance, the chance of the best in 2d20 being a 2 is \( P(\text{best of 2d20} = 2) = \frac{3}{20^2} \). We can also see a pattern in the matrices above. Both the best and the worst result in 2d20 form a half frame of a square, which we can use to deduce the probability formulas

\[ P_\text{best of 2d20}(x) = \frac{x^2 - (x - 1)^2}{20^2} \]

and

\[ P_\text{worst of 2d20}(x) = \frac{(21 - x)^2 - (20 - x)^2}{20^2} \]


Let's now plot and compare those equations above. The probability of rolling each value is shown below. Interestingly, the \(P_\text{best of 2d20}\) and \(P_\text{worst of 2d20}\) are increasing and decreasing linear curves, respectively. They both intercept at the middle of the uniform probability distribution function rolling the single 1d20. 

Nevertheless, the ability check is the roll of rolling the difficulty class (DC) or over. We can sum all those values to get the probability of success.

\[ P_\text{adv}(DC) = \sum_{x=DC}^{20} P_\text{best of 2d20}(x) = \frac{20^2 - (DC - 1)^2}{20^2}\] 

and

\[ P_\text{dis}(DC) = \sum_{x=DC}^{20} P_\text{worst of 2d20}(x) = \frac{(21 - DC)^2}{20^2}\] 

which are both second-order functions, as illustrated in the graphs below. 

Probability of rolling specific value (upper), and probability of rolling specific value or over it (under).

Yey, we have now analytical formulas for the advantage and disadvantage rolls in D&D 5e! 😃

House Rule: Higher Advantage & Disadvantage Rolls

We can also generalise this process for seeing what happens to the probability roll, if the DM applies a house rule where advantage and disadvantage conditions can stack up allowing a bigger pool do d20. These super advantage or disadvantage rolls could let the player roll 3 or more d20s, and use the best or worst results, accordingly. Hence,

\[ P_\text{best of Nd20}(x) = \frac{x^N - (x - 1)^N}{20^N} \]

and

\[ P_\text{worst of Nd20}(x) = \frac{(21 - x)^N - (20 - x)^N}{20^N} \]

Thus, the probability of success becomes

\[ P_\text{N adv}(DC) = \sum_{x=DC}^{20} P_\text{best of Nd20}(x) = \frac{20^N - (DC - 1)^N}{20^N}\] 

and

\[ P_\text{N dis}(DC) = \sum_{x=DC}^{20} P_\text{worst of Nd20}(x) = \frac{(21 - DC)^N}{20^N}\] 

which are both plotted below.
Probability of rolling specific value (upper), and probability of rolling specific value or over it (under), in the case of ability checks with super advantage.

We see a pattern, where the change of rolling low values become almost impossible for the super advantage, and very likely for super disadvantage.

No comments:

Post a Comment