What’s the explanation for the distribution of this kind of dice roll

diceprobabilityprobability distributionsstatistics

Consider the following type of dice roll for the attack damage in some tabletop RPG:

  • Roll three six-sided dice.
  • Pick two of them that have a sum greater six.
  • The remaining die is the attack damage.
  • If no combination of two dice has a sum greater than six then the attack damage is zero.

Naturally players want to maximize damage and thus pick the lowest possible sum of two dice that is still greater than six.

I tried to simulate that roll to see the probability distribution of the attack damage and was surprised that there is a probability of ~20% to roll the maximum damage of six.

Here is the full distribution after 1M rolls:

dmg p
0 0.195335
1 0.153332
2 0.097448
3 0.125001
4 0.101249
5 0.115615
6 0.21202

I makes sense to me that the attack damage is biased towards higher values, because players will choose the higher one when having the choice, but I kind of expected the distribution to increase from 1 to 6 as a result of that instead of fluctuating so much.

So what's happening here?


Inspired by some of the comments I plotted the distribution with this roll/selection for different kind of dice:

enter image description here

The target value is always the most probable value when rolling two dice and taking the sum (so 7 for d6, 11 for d10 and 21 for d20).

Best Answer

This is an answer to the question being discussed in comments by @Brian Tung and @Henry.

Let's start with the closest analogue of the original question: three numbers $a, b, c$ are uniformly generated in $[0, 1]$, and the final score is computed by choosing two of them that add to at least $1$ and discarding them; or is equal to $0$ if no two of them sum to $1$.

As @David K observes in comments, the probability of getting score $0$ is exactly $\frac{1}{4}$: for example, we can see that the situation $a + b + c \leq 1$ forms a tetrahedron of volume $\frac{1}{6}$ in the corner of the probability space $[0, 1]^3$, while the situation $a + b + c > 1$ but $a + b < 1$, $a + c < 1$, $a + c < 1$ forms a tetrahedron with vertices $(0, 0, 1)$, $(0, 1, 0)$, $(1, 0, 0)$, and $(\frac{1}{2}, \frac{1}{2}, \frac{1}{2})$ which is exactly half as large. So we have a point-mass of $\frac{1}{4}$ at score $0$.

The rest of the probability distribution will be continuous. Let's compute the probability that we get final score $t$, contingent on the first die coming up $t$. (Presumably this is where the factor of $3$ Brian Tung noted comes from, since there are three dice.) When $0 < t < \frac{1}{2}$, the space of pairs $(b, c)$ that work consists of three triangles in $b, c$-plane: one is defined by the inequalities $b + c \geq 1$, $0 \leq b \leq t$, $1 - t \leq c \leq 1$, the second by the inequalities $b + c \geq 1$, $t \leq b \leq 1- t$, $t \leq c \leq 1 - t$, and the third by the same inequalities the first with $b, c$ switched. This gives a probability density of $\frac{t^2}{2} + \frac{(1 - 2t)^2}{2} + \frac{t^2}{2}$, which can be written in the form in my comment above. The situation when $ \frac{1}{2} < t < 1$ is very similar (actually you get the same pictures, just with $t$ and $1 - t$ reversed, so the PDF is symmetric across $t = \frac{1}{2}$).

Case <span class=$\alpha = 1$ graph" />

Now let's suppose that instead we have a cutoff of $\alpha$ (i.e., we discard two dice whose sum is at least $\alpha$, instead of whose sum is at least $1$). Set aside the point-mass at $0$ (which in principle we could compute after the fact). When $\alpha$ is large ($1 \leq \alpha \leq 2$) we end up with three regimes: for $t < \alpha - 1$, the event that we get score $t$ is the same event that $b + c \geq \alpha$ (since we don't have to worry about discarding $t + b$ or $t + c$ in this case), with constant probability density $\frac{(2 - \alpha)^2}{2}$ (just as @Henry observed). When $t > \alpha - 1$, the situation is very similar to the case $\alpha = 1$: for $\alpha - 1 < t < \frac{\alpha}{2}$, the probability space in the $b,c$-plane consists of three triangles: one defined by $b + c \geq \alpha$, $\alpha - 1 \leq b \leq t$, $\alpha - t \leq c \leq 1$, a second defined by $b + c \geq 1$, $t \leq b \leq \alpha - t$, $t \leq c \leq \alpha - t$, and the third the same as the first with $b, c$ switched. This gives density $\frac{(t - (\alpha - 1))^2 + (\alpha - 2t)^2 + (t - (\alpha - 1))^2}{2}$. The third regime is the mirror image of the second across the line $t = \frac{\alpha}{2}$.

Case <span class=$\alpha = 1.5$ graph" />

When $\alpha$ is small ($0 \leq \alpha < 1$) there are again three regimes; omitting the details, if $t < \frac{\alpha}{2}$ then the probability density is (proportional to) $2 \times t \cdot \frac{(1 - \alpha) + (1 - \alpha + t)}{2} + \frac{(\alpha - 2t)^2}{2}$, if $\frac{\alpha}{2} < t < \alpha$ then the density is the mirror-image of the first case (replacing $t$ with $\alpha - t$), and if $t > \alpha$ then the density is $t^2 - \frac{\alpha^2}{2}$.

Case <span class=$\alpha = .5$ graph" />