Tuesday 8 January 2019

Advantage (Math)

The publication of 5th edition D&D introduced several new ideas to the RPG community, maybe the most popular of which is advantage (and disadvantage). Advantage was an improvement over 3rd edition in a myriad number of ways: it cut down on fiddly modifiers, it encouraged DM rulings over a slavish attention to written rules, and it kept results bounded between 1 and 20 while still rewarding beneficial situations in-game. Also, it's more fun to roll more dice.


More generally, we can think of advantage-style mechanics as roll x y-sided dice, keep the highest (or lowest) n dice. Notationally, I'll write Hn:xdy, so 5th edition advantage is H1:2d20. What do advantage-style mechanisms offer for rules tinkerers? There are many, many explanations of the math behind advantage, often by more mathematically talented and clear writers than myself. I'll write down some of my thoughts / math-scribbles / insights into this mechanism, but I expect that there are other posts and forum-threads out there that you should read as well. That's what Google is for.

Success or Failure with Advantage-Style Mechanics

Say you need to roll more than z to succeed in doing something in-game. A single roll of a y-sided die is essentially a uniform random variable with a minimum of 1 and a maximum of y. The probability of getting z or less is z/y, and conversely, the probability of getting more than z is (y-z)/z.



Success on the highest of n dice is equivalent to not failing on every single die roll. The probability of failing two dice rolls is the probability that you fail the first die roll and then fail the second, so

probability of failing x rolls = (z / y) * (z / y) [n times] = (z / y)^x,

and the probability of success is

probability of success = probability of rolling more than z on 1 out of x dice = 1 - (z / y)^x.

This formula can be plugged into Excel to visualize. Another way to visualize what is happening is the example below.

The figure depicts rolling 2d10. One roll is on the x-axis, the other on the y-axis. Green squares indicate successful combinations with advantage if a 6 or higher needs to be rolled, and red squares indicate failure. One die roll would be the like the ten squares in the first row, with 5 successful roll results and 5 failing roll results. Advantage expands the possible results to two dimensions, with success proportional to area instead of length.

Advantage is really beneficial for tests that already are likely to succeed: if you need to roll a 2 or more on d10, the probability is 90%, but with advantage, the probability is 99%. Likewise, it is not very beneficial for tests that are likely to fail. If you need to roll a 10 on d10, the probability is 10%, and with advantage the probability is 19%. In both cases, though, the absolute probability only went up by 9%. Absolute probabilities increase by the most for tests that are of average difficulty. In the example above, a 50% probability jumps to 75%.

Another way to put things is that advantage makes accomplishing average-difficulty tasks more reliable. It does this better than a static 15 percentage point bonus would because in the mid-range of probabilities, it gives a higher effective bonus.Finally, there are diminishing returns to rolling additional dice with advantage. Going from 1 to 2 dice in the example above increases the probability of success by 25 percentage points, while going from 2 to 3 increases it only by 12.5 percentage points. This property is nice if you want two distinct factors that would make success more likely to matter jointly less than having one distinct factor, although the 5th edition D&D designers opted to not have multiple advantage dice, presumably to make play faster.

Magnitudes with Advantage-Style Mechanics

Now say you're rolling to determine how much you accomplish, for instance how much damage your axe crashing into a goblin did. (Note that in standard D&D combat the success roll is totally independent of the effectiveness of a hit. It's a bit of a strange choice, but it's worked for 40 years). You can use advantage-style rolls for magnitudes as well.
Damage: a question of magnitude

For these sorts of rolls, it's meaningful to talk about the average roll. Technically, we're interested in an order statistic for uniform random variables (link, technical). Conveniently, there's a simple expression for the nth highest value of a uniform variable ranging between 0 and (y-1):

Expected value of nth lowest value of x values = (y-1) * n / (x + 1).

(nth lowest means arrange the values in order from lowest to highest and take the nth result). Therefore the average highest value on xdy is about

Average H1:xdy = (y - 1) * x / (x + 1) + 1 = (y x + 1) / (x + 1).

So the average highest roll of 1d10 is (10 * 1 + 1)/(1 + 1) = 5.5 because (duh) its just one die. The average highest die roll of 2d10 is about (10 * 2 + 1)(2 + 1) = 7. As a rule of thumb, advantage increases the average result by about 30% and disadvantage reduces the average result by about 30%.

(While the uniform distribution behaves exactly like a single die roll, order statistics on two uniforms only approximate advantage or disadvantage with two rolls --  H1:2d10's exact average is 7.15).

The formula is also useful for thinking about taking multiple high dice or equivalently discarding a low die. For instance, the famous roll 4d6 discard lowest attribute rolling method is H3:4d6, and the average is approximately equal to the expected value of the 2nd lowest, 3rd lowest, and 4th lowest dice on 4d6:

Average H3:4d6 = 3 + (6 - 1) * 2 / (4 + 1) + (6 - 1) * 3 / (4 + 1) + (6 - 1) * 4 / (4 + 1) = 12

(it is exactly equal to 12.24. To mess around with these ideas, you could use anydice or the simpler one here).

So the average result is higher with advantage, unsurprisingly. A more interesting property is that results are usually higher than the average. By that I mean that most of the time your roll will be at least the average roll. 75% of H1:2d10 rolls are 7 or higher (refer to the figure above again).

This will apply, approximately, to any magnitude roll with advantage: three-quarters of rolls will be above average. Advantage-style mechanics' increased reliability extend to magnitudes as well. Of course, with disadvantage, three-quarters of rolls will be below average, reliably modeling unreliable magnitudes.

This also explains why 4d6 drop lowest is nice if you want above-average but interesting characters. More than half of attributes will end up greater than 12, but low attributes may still end up low in a meaningful way (i.e., 8 or less).






No comments:

Post a Comment