# Player A rolls a fair dice 6 times. Player B rolls a fair dice 4 times. What's the probability the sum of rolls A > B?

Player A rolls a fair (6 sided dice) dice 6 times. Player B rolls a fair dice (6 sided dice) 4 times. What is the probability the sum of Player A's rolls are greater than Player B's?

• What have you tried ? – Aryadeva Jun 21 at 11:50
• Cool question. Welcome to MSE. Please read the guidelines on asking questions (also shown to you when you asked this question). For me, personally, i'm wondering if there's a solution other than brute-force, too. – Benjamin Wang Jun 21 at 11:57
• @Aryadeva I don’t know how to even approach the problem :( – dicequestion2 Jun 21 at 11:58
• You could use the normal approximation to each distribution, though of course that won't be exact. – lulu Jun 21 at 12:00
• Try this command: 'output 6d6 > 4d6' on the website anydice.com. – Raskolnikov Jun 21 at 12:03

For an exact result we need the exact probabilities to realize in $$r$$ throws any given sum $$n\in{\mathbb Z}$$. We denote the number of (equiprobable) ways to realize in $$r$$ throws the sum $$n$$ by $$a_r(n)$$. Then $$\sum_n a_r(n)=6^r$$, and the probability to realize $$n$$ is $$p_r(n)={a_r(n)\over 6^r}\ .\tag{1}$$We have a_1(n)=\left\{\eqalign{1\quad&(n\in)\cr 0\quad&{\rm (else)}\cr}\right. We then compute (this convolution is the essential step!) $$a_2(n)=\sum_{k\in{\mathbb Z}}a_1(k)\>a_1(n-k)=\sum_{k=1}^6a_1(k)\>a_1(n-k)$$and obtain $$\bigl(a_2(n)\bigr)_{2\leq n\leq12}=(1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1)\ .$$ All other $$a_2(n)$$ are zero. Similarly $$a_4(n)=\sum_{k\in{\mathbb Z}}a_2(k)\>a_2(n-k)=\sum_{k=2}^{12}a_2(k)\>a_2(n-k)$$ leads to \eqalign{\bigl(a_4(n)\bigr)_{4\leq n\leq24}=(1, 4, 10, 20, &35, 56, 80, 104, 125, 140, 146,\cr & 140, 125, 104, 80, 56, \ 35, 20, 10, 4, 1)\ ,\cr} and proceeding once more we obtain the corresponding sequence $$\bigl(a_6(n)\bigr)_{6\leq n\leq36}=\bigl(\ldots\bigr)\ ,$$ which I don't present here. For the probability that $$B$$ obtains in $$4$$ throws more than $$A$$ in 6 throws we now have to consider $$(1)$$. This leads us to compute $$N:=\sum_{j=7}^{24}a_4(j)\sum_{k=6}^{j-1}a_6(k)=5\,044\,260\ ,$$ and the probability $$P_{B>A}$$ is given by $$P_{B>A}={N\over 6^{10}}={420355\over5038848}=0.0834228\ .$$ For the desired $$A>B$$ we need $$N':=\sum_{j=4}^{24}a_4(j)\sum_{k=j+1}^{36}a_6(k)=53\,449\,286\ ,$$ so that $$P_{A>B}={N'\over 6^{10}}={26724643\over30233088}=0.883953\ .$$ The following I can leave to you: $$P_{A=B}=0.0326237\ .$$

• Thank you very much for the answer! – dicequestion2 Jun 21 at 20:02

I prefer probabilistic approach.

To simplify further computation, let us model a roll of a fair die by a random variable $$X_1$$ that takes $$7$$ values, $$\{0,1,2,3,4,5,6\}$$, the value $$0$$ with probability $$0$$. We are asked about the probability $$P(X_6>X_4)$$ Using conditioning $$P(X_6>X_4)=\sum_{i=0}^{25}P(X_6>X_4|X_4=i)P(X_4=i)$$ Since $$X_6$$ and $$X_4$$ are independent, this is equal to $$P(X_6>X_4)=\sum_{i=0}^{25}P(X_6>i)P(X_4=i)$$ or using CDF notation $$P(X_6>X_4)=\sum_{i=0}^{25}(1-F_{X_6}(i))P(X_4=i)$$

Now let us make our hands dirty and launch Python to obtain numeric answer:

>>> import numpy as np
>>> p=np.full(7,1/6)
>>> p=0
>>> p
array([0.        , 0.16666667, 0.16666667, 0.16666667, 0.16666667,
0.16666667, 0.16666667])
>>> p2=np.convolve(p,p)
>>> p4=np.convolve(p2,p2)
>>> p6=np.convolve(p4,p2)
>>> c6=np.empty(len(p6))
>>> s=0
>>> for i in range(len(p6)):
...   s = s + p6[i]
...   c6[i] = s
...
>>> s=0
>>> for i in range(len(p4)):
...  s = s + (1-c6[i])*p4[i]
...
>>> s
0.8839534684647495

• Thank you very much for this approach as well – dicequestion2 Jun 21 at 20:05

The following solution uses a generating function. A noteworthy aspect of the approach is that not much computation is required. (The final summation only has four terms, each the product of two binomial coefficients.) Readers unfamiliar with generating functions can find many resources in the answers to this question: How can I learn about generating functions?

It turns out to be advantageous to consider the complementary problem: What is the probability that the sum of A's rolls is not greater than B's?

There are $$6^{10}$$ possible outcomes of rolling ten dice, all of which we assume are equally likely. We want to count the number of outcomes in which the sum of A's rolls does not exceed B's, i.e. the number of solutions in integers to $$a_1 + \dots + a_6 \le b_1 + \dots + b_4$$ where $$1 \le a_i, b_i \le 6$$ for all $$i$$. If we make the substitution $$c_i = 6-b_i$$, then an equivalent inequality is $$a_1 + \dots + a_6 + c_1 + \dots + c_4 \le 24$$ where $$0 \le c_i \le 5$$. Introducing a new variable $$y \ge 0$$, an equality with the same number of solutions is $$a_1 + \dots + a_6 + c_1 + \dots + c_4 + y = 24$$ More generally, we are interested in the number of solutions to $$a_1 + \dots a_6 + c_1 + \dots + c_4 + y = r$$ where $$r$$ is a non-negative integer. A generating function for the number of solutions is \begin{align} f(x) &= (x + x^2 + \dots + x^6)^6 \, (1 + x + \dots + x^5)^4 \, (1 + x + x^2 + \dots) \\ &= x^6 \, (1 + x + \dots + x^5)^{10} \, (1 + x + x^2 + \dots) \\ &= x^6 \left( \frac{1-x^6}{1-x} \right)^{10} \frac{1}{1-x} \\ &= x^6 \, (1-x^6)^{10} \; (1-x)^{-11} \end{align} Applying the Binomial Theorem, $$f(x) = x^6 \cdot \sum_{i=0}^{10} (-1)^i \binom{10}{i} x^{6i} \cdot \sum_{j=0}^{\infty} \binom{11+j-1}{j} x^j$$ We are specifically interested in the coefficient of $$x^{24}$$ in f(x), written $$[x^{24}]f(x)$$. $$[x^{24}]f(x) = \sum_{i=0}^3 (-1)^i \binom{10}{i} \binom{11+18-6i-1}{18-6i} = 7,016,890$$ so the probability that the sum of A's rolls is not greater than B's is $$\frac{7,016,890}{6^{10}}$$ and the answer to the original problem, the probability that A's sum is bigger than B's, is $$1- \frac{7,016,890}{6^{10}} \approx 0.883953$$