0

I was playing around with extensions of Euler problem 205 and got the following somewhat surprising result:

Let the random variable $X$ be the sum of 10d4 (i.e. 10 four sided fair dice) and let $Y$ be the sum of 7d6 (i.e. 7 six sided fair dice). Then $P(X>Y)=\frac{1}{2}$. It doesn't seem obvious at first, because e.g. $E(X)=10\cdot 2.5=25 > E(Y)=7\cdot 3.5=24.5$, so my question is, if there is an elegant way to prove this result?

What I have done so far is to:

  1. Calculate the probability using the Troll dice roller with the expression count ((sum 10d4) > (sum 7d6))

  2. Done the convolution $X := \sum_{i=1}^{10} X_i$ with $X_i \stackrel{\text{iid}}{\sim} U(\{1,\ldots,4\})$ to get the probability mass function $f_X(x)$ using a small R program. Similar calculations to get $f_Y(y)$. Now since $X$ and $Y$ are independent, I can calculate $P(X>Y) = \sum_{x=0}^{40} \sum_{y=0}^{42} I(x>y) f_{X}(x) f_{Y}(y) = \frac{1}{2}$.

However, since doing the convolutions is a somehwat brute force approach and cannot be done by hand (at least not while having fun...), I was wondering if there is a better technique to show the result, e.g. using characteristic or generating functions?

Michael
  • 80
  • 1
    What would make the result "obvious at first"? Did you expect to find $E(X)=E(Y)$? Remember that with dice, unlike with (say) normal distributions, $P(X=Y)>0.$ If it were indeed the case that $E(X)=E(Y)$ then the symmetry of the distribution of $X-Y$ would dictate that $P(X>Y)=P(X<Y)<\frac12.$ – David K Feb 18 '25 at 14:11
  • @DavidK Good point. Initially, I was surprised by the result and thought maybe the two PMFs are equal. However, as you point out, even in this case (>)<1/2. So I guess the above statement about () and () isn't very helpful. Maybe as a stupid question: How do we know the symmetry of $X-Y$? – Michael Feb 18 '25 at 16:56

2 Answers2

7

The distributions of $X$ and $Y$ are symmetric, as sums of uniform (hence symmetric) distributions. Using their respective expected values from OP, we can state explicitly $X\sim 50-X$ and $Y\sim 49-Y$.

Moreover, independance of $X$ and $Y$ leads to independance of $50-X$ and $49-Y$, so $$\mathbb P(X>Y)=\mathbb P(50-X>49-Y)=\mathbb P(Y>X-1)=1-\mathbb P(Y<X).$$ Hence, $P(X>Y)=1-P(X>Y) \Leftrightarrow P(X>Y) = \frac{1}{2}$.

  • I would upvote. But here folks don't like "no work shown" questions answered. – coffeemath Feb 18 '25 at 09:33
  • 2
    @coffeemath There is shown work up there. And the question is not the one in Euler problem 205. Anyway, thanks for your notice. – Christophe Boilley Feb 18 '25 at 09:36
  • @coffeemath I'm new here, so I'm not sure what "no work shown" means. At least the convolutions have been implemented in R (link to the code in the pastebin), which took a while to get right? – Michael Feb 18 '25 at 10:12
  • This is very elegant. If I want to extend the problem to any type of md4 and nd6, the trick is that the difference in the two constants $c_1-X$ and $c_2-Y$ has exactly c_1-c_2=1. So for all pairs of n4-m6 = m-n+1 we would have that P(X>Y)=1/2. So the probability that the sum of 94d4 is larger than the sum of 67 d6 is also 0.5... – Michael Feb 18 '25 at 12:53
  • 1
    on the flip side, n = 3, m = 2 will do it: P(3d4 > 2d6) = 1/2. – Michael Lugo Feb 18 '25 at 18:56
  • I'm going to accept this as the answer due to its simplicity. In principle, one would need to show/argue that the claim that the two distributions $50-X$ and $49-Y$ have the same distribution as $X$ and $Y$, respectively. For a more elaborate answer (including a proof of this) as well as a generalization, see the answer by David K. – Michael Feb 19 '25 at 10:17
  • 1
    I agree with you about the work and will delete if you wish, for now leaving it so others know context... – coffeemath Feb 19 '25 at 11:04
  • 1
    @Michael I add a simple argument about symmetry. – Christophe Boilley Feb 19 '25 at 12:37
3

We can generalize this problem.

Roll a standard fair $d_1$-sided die ("standard" meaning it has one face for each integer from $1$ to $d_1,$ inclusive), then roll a standard fair $d_2$-sided die and add it to the sum. The distribution of the sum is a convolution of the two individual distributions with mean $\dfrac{d_1 + d_2 + 2}{2},$ symmetric around that mean. Moreover, the support of the distribution of the sum is the entire set of integers from $2$ (the minimum sum) to $d_1 + d_2$ (the maximum sum); that is, there are no integers between those two extremes where the probability of the sum is zero.

Now take any discrete random variable $X_1$ whose mean is an integer multiple of $\dfrac12$, whose probability distribution is symmetric around this mean, and whose support is every integer from its minimum value to its maximum, then add (or subtract) the roll of a standard fair die. The resulting sum (or difference) $X_2$ has a mean that is an integer multiple of $\dfrac12,$ its probability distribution is symmetric around this mean, and its support is every integer from its minimum to maximum value.

The only thing that is changed by the decision to subtract a die roll rather than to add it is that the mean is less. Subtracting the roll of a standard fair $d$-sided die is the same as adding the roll of a standard fair $d$-sided die and then subtracting $d + 1.$

(Even more generally, the sum of two symmetric distributions has a symmetric distribution and the difference of two symmetric distributions has a symmetric distribution.)

By induction, if we take any finite sequence of $n \geq 0$ standard fair dice, each of which can have any predetermined number of sides $d_i,$ and we take the sum of the first $m \leq n$ dice and then subtract the sum of the other $n - m$ dice, we will obtain a random variable $Z$ whose mean is an integer multiple of $\dfrac12,$ whose probability distribution is symmetric about that mean, and whose support is every integer from the minimum value to the maximum value.

We now have two cases.

Case $1$. Suppose $\mathbb E(Z)$ is an integer. Then $\mathbb E(Z)$ is part of the support of $Z,$ that is, $\mathbb P(Z = \mathbb E(Z)) > 0.$ Since the distribution is symmetric, $\mathbb P(Z < \mathbb E(Z)) = \mathbb P(Z > \mathbb E(Z)).$ It follows that $$ \mathbb P(Z < \mathbb E(Z)) = \mathbb P(Z > \mathbb E(Z)) = \frac12\left(1 - \mathbb P(Z = \mathbb E(Z))\right) < \frac12. $$

It follows that for any integer $k,$ if $k \geq \mathbb E(Z)$ then $\mathbb P(Z > k) < \dfrac12.$ Also, if $k < \mathbb E(Z)$ then $\mathbb P(Z > k) > \dfrac12.$ It is not possible to have $\mathbb P(Z > k) = \dfrac12$ in this case.

Case $1$. Suppose $\mathbb E(Z)$ is not an integer. Then $\mathbb P(Z = \mathbb E(Z)) = 0.$ It follows (again from the symmetry of the distribution) that $$ \mathbb P(Z < \mathbb E(Z)) = \mathbb P(Z > \mathbb E(Z)) = \frac12. $$

So if $\mathbb E(Z) = \dfrac12$ then $\mathbb P(Z > 0) = \mathbb P(Z > \mathbb E(Z)) = \dfrac12.$ Otherwise $\mathbb P(Z > 0) \neq \dfrac12.$

Combining the results of both cases, we find that $\mathbb P(Z > 0) = \dfrac12$ if and only if $\mathbb E(Z) = \dfrac12.$


So if you have random variables $X$ which is the sum of a set of standard fair dice and $Y$ which is the sum of a set of standard fair dice, $$ \mathbb P(X > Y) = \mathbb P(X - Y = 0) $$ and we know from the previous conclusion that $\mathbb P(X > Y) = \dfrac12$ if and only if $\mathbb E(X - Y) = \dfrac12,$ that is, if and only if

$$ \mathbb E(X) = \mathbb E(Y) + \frac12. $$

Since you found $\mathbb E(X) = 25$ and $\mathbb E(Y) = 24.5$ in your particular configuration of dice, $\mathbb P(X > Y) = \dfrac12.$

David K
  • 108,155
  • Thanks for this generalization! So I guess the expectations are of some use when characterizing the problem. – Michael Feb 19 '25 at 10:16
  • They are indeed. Just a little differently than they would be if these were continuous distributions. – David K Feb 19 '25 at 14:18