# Analyses of the dice rolling strategies

## Problem

Problem from the FiveThirtyEight website

The fifth edition of Dungeons & Dragons introduced a system of “advantage and disadvantage.” When you roll a die “with advantage,” you roll the die twice and keep the higher result. Rolling “with disadvantage” is similar, except you keep the lower result instead. The rules further specify that when a player rolls with both advantage and disadvantage, they cancel out, and the player rolls a single die. Yawn!

There are two other, more mathematically interesting ways that advantage and disadvantage could be combined. First, you could have “advantage of disadvantage,” meaning you roll twice with disadvantage and then keep the higher result. Or, you could have “disadvantage of advantage,” meaning you roll twice with advantage and then keep the lower result. With a fair 20-sided die, which situation produces the highest expected roll: advantage of disadvantage, disadvantage of advantage or rolling a single die?

Extra Credit: Instead of maximizing your expected roll, suppose you need to roll N or better with your 20-sided die. For each value of N, is it better to use advantage of disadvantage, disadvantage of advantage or rolling a single die?

## Deriving statistics for 3 strategies

### Notations

- \(N\) - number of sides on a die
- \(b\) - number on one of the sides of the die, \(b \in [1, N]\)
- \(x, y, z, u, v\) - are results obtained from throwing a single die (results in range \([1, N]\))

### Abbreviations

**PMF**- Probability mass funciton**CMF**- Cumulative mass funciton

### Rolling a single die

PMF:

CMF:

### Advantages

This strategy is only needed in order to calculate a bit more complicated strategies that are only based on advantages and disadvantages. We need to find PMF

This problem could be solved rather easily by noticing that \(max(x, y)\) equals \(b\) either when \(x = y = b\) or one of the variables is equal to \(b\) but the other is smaller than \(b\). When one value is smaller than the other because there are two possibilities in which either \(x=b\) or \(y=b\) which means we need to count these cases twice. These observations lead to the following PMF

and by replacing \(p(b)\) and \(p(i)\) with PMF values from the single roll strategy we get the following PMF

### Disadvantages

Similar logic could be applied to the disadvantages strategy in which case we will get the following PMF

and by replacing \(p(b)\) and \(p(i)\) with PMF values from the single roll strategy we get the following PMF

From PMF we can see that advantages and disadvantages have the same shape, expect that one distributions is a flipped version of the other distribution

### Disadvantage of advantages

For this problem general PMF formula for disadvantages could be applied here as well

The only difference is that now we need to use PMF from advanages rather than from a single roll distribution

And from PMF it’s easy to find CMF

### Advantage of disadvantages

For this problem we can apply general formula for advantages

And similarly we can derive PMF

And as before we can calculate CMF

## Which strategy is more likely to produce 20?

From the PMF we can set \(N=b=20\) and check the results

- Single roll strategy: \(p(x = 20) = 0.05\)
- Disadvantage of advantages: \(p(x = 20) = \frac{39^2}{400^2} \approx 0.01 \)
- Advantage of disadvantage: \(p(x = 20) = \frac{801}{400^2} \approx 0.005 \)

From these values we can see that a single dice roll is a much more likely to produce 20 on a 20-sided dice.

## Which strategy is more likely to produce value above some fixed number?

For this problem we need to focus on CMF values.

we will try to find for which \(b\)s the following inequality holds, but we need to remember that true values needs to be adjusted by one unit

### Comparing disadvantage of advantages with advantage of disadvantages

by rearranging the terms we can find that this inequality holds when

and this is true for every \(b\) which means that **disadvantage of advantages
is always better compare to advantage of disadvantages**.

### Comparing disadvantage of advantages with a single roll strategy

by rearranging the terms we can find that this inequality holds when

and since \(N \geq b\) the whole inequality will be true when \((N^2 - N\,b - b^2) \geq 0\). This is a quadratic equation with two roots.

where \(\phi\) is a golden ration

And this equation could be greater than 0 only when \(b \leq \frac{N}{\phi}\) (although since \(\phi\) is irrational and \(N\) and \(b\) are integers equality will never be possible).

But in the original equation we subtracted 1 from \(b\) which means that the following condition should be true in order to have better probability of reaching the desired result with disadvantage of advantages strategy compared to the single roll strategy.

### Comparing advantage of disadvantages with a single roll strategy

by rearranging the terms we can find that this inequality holds when

and as before, since \(N - b \geq 0\) we only need to have the following inequality to hold

quadratic equation has two roots and could be written in the following form

left term is always negative for \(b \leq N\) which means that the only condition when above equation holds can happen only when

and as before we need to add 1, because \(b - 1\) was replaced with \(b\) in the initial equation

## Conclusion

Assuming that \(N=20\) the following conclusions could be made

- Disadvantage of advantages is always better than advantage of disadvantages
- Disadvantage of advantages is better than single roll only when \(b \leq 13\)
- Advantage of disadvantages is better than single roll only when \(b \leq 8\)

## Simulations

All of the conclusions could be verified with simple simulations