4

Suppose I roll two dice until the cumulative sum hits 1000 (inclusive). What's the most likely last roll? That is, suppose $X$ is the sum of the two dice during the first roll that makes the cumulative sum go over 1000. What's its mode?

I'm struggling to get the answer. I know the most likely sum from a roll of two dice is $7$. I also know how to compute the expected value of the last roll if I were rolling just one die. However, I'm stuck on computing the mode of rolling tow dice.

Can someone help?

user1691278
  • 1,361
  • 2
    How about pretending the two dice is a single die from 2 to 12 with non-uniform probabilities of hitting each number (which you can determine from the two dice rolls), and then using your method for solving the problem for one die? – Tony Mathew Aug 25 '23 at 02:00
  • 1
    Can you compute the chance of getting a specific number with successive rolls? For example, what is the chance of performing successive rolls and arrive exactly at $998$? – Daniel Cunha Aug 25 '23 at 02:00
  • I coded it, the numerical results suggest that the chance of any large number to be achieved converges to $\frac{1}{7} \approx 14.3%$. If my computations are right, the most likely last roll would be $7$. – Daniel Cunha Aug 25 '23 at 02:48
  • What I did was to recursively compute the chance of a given number to be achieved (it is the chance of $n-12$ to be achieved times the chance of a $12$ being rolled; added to the chance of $n-11$ to be achieved times the chance of $11$ being rolled; and so on). Then, the chance of $2$ to be the last roll is the chance of $998$ to be achieved the chance of $2$ being rolled; added to the chance of $999$ be achieved times the chance of $2$ being rolled. The same for all possible rolls from $3$ to $12$. This shows that $7$ is the most likely last roll. – Daniel Cunha Aug 25 '23 at 02:50
  • @DanielCunha Is there an analytical solution? – user1691278 Aug 25 '23 at 02:50
  • @TonyMathew I only know how to compute the mean but not the mode. – user1691278 Aug 25 '23 at 02:50
  • 1
    @user1691278 I believe it can be shown that the chance of large numbers to be achieved converge to $\frac{1}{7}$, and that $1000$ is large enough so that this probability can be adopted. This would turn the problem much easier to approach. – Daniel Cunha Aug 25 '23 at 02:53
  • Can you write it out? – user1691278 Aug 25 '23 at 05:01
  • Do you want to hit 1000 exactly or just get to 1000 or more? If you want exactly 1000 then what happens if you overshoot? Is it like a game of darts? – badjohn Aug 25 '23 at 22:48
  • @badjohn 1000 or above. Once you hit 1000 or above, the game terminates. – user1691278 Aug 25 '23 at 22:50

2 Answers2

4

The probability of each output from a two-dice roll is:

$$b(2) = \frac{1}{36} \;;\; b(3) = \frac{2}{36} \;;\; b(4) = \frac{3}{36} \;;\; b(5) = \frac{4}{36} \;;\;b(6) = \frac{5}{36}$$ $$b(7) = \frac{6}{36}$$ $$b(8) = \frac{5}{36} \;;\; b(9) = \frac{4}{36} \;;\; b(10) = \frac{3}{36} \;;\; b(11) = \frac{2}{36} \;;\; b(12) = \frac{1}{36}$$


The probability of an integer number $n\geq1$ to be achieved by adding successive two-dice rolls is given by:

$$p(n) = \sum_{i=2}^{12}\left[p(n-i)\,b(i)\right]$$

For $n<1$: $p(0) = 1 \;;\; n<0 \Rightarrow p(n) = 0$.

From this, we can recursively obtain the probability of any integer number to be achieved.


Now, the probability of $r \in \{2,3,4,5,6,7,8,9,10,11,12\}$ being the last roll such that a given value $N$ is achieved of surpassed should be:

$$q(r) = \sum_{j=1}^{r}\left[p(N-j)\,b(r)\right] = b(r)\,\sum_{j=1}^{r} p(N-j)$$


For a given $N$, all the $11$ probabilities $q(r)$ can be computed, which will show that $q(7)$ is the largest value for $N=1000$, so $7$ is the most probable last roll.


In the case that $N$ is large enough, all values from $p(N-12)$ to $p(N-1)$ will be nearly the same (let's call it $P$), so we would have:

$$\sum_{j=1}^{r} p(N-j) \approx r\,P$$

$$q(r) \approx b(r)\,r\,P = \frac{P}{36}\,r\left[6-|r-7|\right]$$

$$\sum_{i=2}^{12} q(i) = 1 \Rightarrow \boxed{P = \frac{1}{7}}$$

Under this assumption, it should be clear that $q(7)$ is the largest value.


I am not sure how to demonstrate that the probabilities converge to the same value, but it makes sense (after a very large number of rolls, how could a number be significantly more probable than any other?) and I have verified it numerically.

[EDIT] : I've just found these demonstrations on math.stackexchange and mathoverflow, so I believe the problem is closed:


In anyway, for the general case, we can see that $q(7) > q(6) > q(5) > q(4) > q(3) > q(2)$, since $b(7) > b(6) > b(5) > b(4) > b(3) > b(2)$ and $\sum\limits_{j=1}^{r+1}p(N-j) \geq \sum\limits_{j=1}^{r}p(N-j)$.

For the other values:

  • $q(8)$ could be greater than $q(7)$ only if $5\,p(N-8) > \sum\limits_{j=1}^{7}p(N-j)$
  • $q(9)$ could be greater than $q(8)$ only if $4\,p(N-9) > \sum\limits_{j=1}^{8}p(N-j)$
  • $q(10)$ could be greater than $q(9)$ only if $3\,p(N-10) > \sum\limits_{j=1}^{9}p(N-j)$
  • $q(11)$ could be greater than $q(10)$ only if $2\,p(N-11) > \sum\limits_{j=1}^{10}p(N-j)$
  • $q(12)$ could be greater than $q(11)$ only if $p(N-12) > \sum\limits_{j=1}^{11}p(N-j)$

We have to show that, using the definition of $p(n)$, these inequalities cannot hold true when $N$ is large. It is sufficient to show that, for a large $N$:

$$\boxed{5\,p(N-8) < \sum\limits_{j=1}^{7}p(N-j)}$$


I've got the solution through numerical implementation:

  • for $N=8$, the most probable last roll is $8$
  • for $N=9$, the most probable last roll is $9$
  • for $N=10$, the most probable last roll is $10$
  • for $N \in \{1,2,3,4,5,6,7,11,12,13,...\}$, the most probable last roll is $7$

For a sufficiently large $N$, the sorted values, from the least probable last roll to the most probable, are: $2 \;;\; 3 \;;\; 4|12 \;;\; 5 \;;\; 11 \;;\; 10|6 \;;\; 9 \;;\; 8 \;;\; 7$.

For $N=1000$, the respective probabilities are: $0.79\% ;\; 2.38\% ;\; 4.76\% ;\; 4.76\% ;\; 7.94\% ;\; 8.73\% ;\; 11.90\% ;\; 11.90\% ;\; 14.29\% ;\; 15.87\% ;\; 16.67\%$.

Daniel Cunha
  • 1,735
  • 1
    A lazy argument that each position has probability about $\frac{1}{7}$ of being hit is (a) each roll value is any of the integers from $2$ to $12$ so you get convergence towards a common value and (b) the average roll is $7$ so that common value has to be $\frac17$. How fast is the convergence? It seems that from position $101$ onwards, the probabilities are in the interval $\frac17 \pm \frac{1}{10^{10}}$ and this continues to narrow. Similarly with one die the probability would be almost exactly $\frac{1}{3.5}=\frac27$. – Henry Aug 25 '23 at 22:03
  • 1
    Distinguishing the order of last rolls of 4 vs 12 and of 10 vs 6 is going to be hard as the probabilities are almost exactly $\frac1{21}$ for the first pair and almost exactly $\frac5{42}$ for the second pair, but not absolutely exactly equal. – Henry Aug 25 '23 at 22:11
  • $4$ vs. $12$ and $10$ vs. $6$ should become equal for large values of $N$. This can be easily shown once we prove that $\lim\limits_{n\rightarrow \infty}p(n) = \frac{1}{7}$. – Daniel Cunha Aug 25 '23 at 22:20
  • Actually, we just have to prove that $\lim\limits_{n\rightarrow \infty} p(n)$ exists and everything else can be easily shown. – Daniel Cunha Aug 26 '23 at 14:28
  • Except the limit of $\frac 17$ is never exactly reached, just approached very closely from both sides. The denominator of $p(n)$ will always be a divisor of $36^n$ – Henry Aug 26 '23 at 14:30
  • Yes, but that is what a limit is, it is a value that can be approached as much as we desire, even if it is never exactly reached. – Daniel Cunha Aug 26 '23 at 14:41
  • @Henry I'm not sure how you used (b) the average is 7 to get probability 1/7. Can you explain more? – user1691278 Aug 26 '23 at 16:04
  • 2
    @user1691278 Handwaving: the expected step forward is $7$ (rolling two dice), so for example after $1000$ rolls your position will be near $7000$ ($\pm150$ish) so you will have stopped at about $\frac{1000}{7000}$ of the possible values on the way. More precisely, work out the probabilities and see the convergence as in my first comment. – Henry Aug 26 '23 at 23:37
2

You can work backwards to solve this.

Let's say you're at a cumulative sum of 999 or 998. Then, you know that any roll will get you to 1000, so the distribution of likelihoods is just the distribution for a single roll.

If you're at 997, then if you roll anything at least a 3, then this is your final roll with the same probability that you roll that number. However, if you roll a 2, then you're at 999 now, and you add 1/36 times the distribution of a single roll to your probabilities, so the distribution of the final roll conditioned on being at 997 is $1/36^2$ for rolling a 2, $2/36 + 1/36\cdot 2/36$ for rolling a 3, $3/36 + 1/36 \cdot 3/36$, so on and so forth. You can then work backwards similarly, so that if you're at a cumulative sum of $i$, then you can condition rolling a $j\in\{2, 3,\dots, 12\}$ and then sum up the distribution at the cumulative sum of $i + j$.

Python code below for doing this. It will give you 7, as you might expect.

import numpy as np

single_roll = np.asarray([1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1]) / 36 dp = [None for _ in range(1000)] dp[999] = single_roll dp[998] = single_roll

for i in range(997, -1, -1): dp[i] = np.zeros(11) for j in range(2, 13): if i + j >= 1000: dp[i][j-2] += single_roll[j-2] else: dp[i] += single_roll[j-2] * dp[i+j]

print(np.argmax(dp[0]) + 2)

Tai
  • 2,235