What's the explanation for the distribution of this kind of dice roll? 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:

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).
 A: 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}$).
$\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}$.
$\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}$.
$\alpha = .5$ graph" />
A: For the record, the exact count of ordered rolls with a given "score" is, in order from $0$ to $6$: $$\{42,33,21,27,22,25,46\}$$
which closely matches the simulation.
Perhaps it helps with intuition (or, at least, understanding...it's hard to have useful intuition here, I think) to do the count for score $2$, to see why there are so few cases.  The "problem" is that it's hard to get a $5$ or $6$ in there since $2+5>6$ and the score will probably be the other roll.
Specifically, the possible unordered rolls with score $2$ are:
$$\{2,2,6\},\{2,2,5\},\{2,4,4\},\{2,1,6\}, \{2,3,4\}$$
There are $3$ orderings for each of the first three, and $6$ for each of the last two, to get the total of $21$.
For a score of $1$, by contrast. we have:
$$\{1,1,6\},\{1,4,4\},\{1,5,5\},\{1,2,5\}, \{1,3,4\},\{1,3,5\}, \{1,4,5\}$$
And for a score of $3$ we get:
$$\{3,3,4\},\{3,3,5\},\{3,3,6\},\{3,1,6\}, \{3,2,5\},\{3,2,6\}$$
As I say, it's hard to have intuition...the selection process is a bit more subtle than it appears at first.
