# Probability optimal solution dice problem

Problem:

Satvik proposes a game of dice to Agnishom.

He says, "There are $2$ standard six-sided dice and the aim is to have the highest total of two dice. First you will throw $2$ dice. If you are happy with your total, that's great!

If you aren't happy with the total you have thrown, you can roll both dice again. However if you roll a second time, then whatever total you get, you must keep.

Now I will roll both dice. I have to accept the total I throw the first time, however if we both have rolled the same total then I win."

Given optimal strategy by Agnishom, what is the probability for Agnishom winning this game?

Approach:

There are a total of 36 outcomes of rolling two dice. The probabilities for the rolls are

2, 12 = 1/36

3,11 -- 2/36

4, 10 -- 3/36

5, 10 -- 4/36

6, 8 -- 5/36

7 --- 6/36

Formulating Optimal Strategy - - -

If Agnishom rolls a 6 and keeps it, he can win only if Satvik rolls a 2, 3, 4, 5 with a 10/36 = 0.27 chance. Remember Satvik also wins if he rolls a 6. Thus its obvious that any roll 6 and below, Agnishom must reroll.

If Agnishom rolls a 8, he wins if Satvik rolls a 2, 3, 4, 5, 6, 7 with 21/36 = 0.58 chance. Thus its obvious that any roll of 8 or higher Agnishom must keep.

Now lets see what is optimal strategy if Agnishom rolls a 7. Agnishom wins if Satvik rolls a 2, 3, 4, 5, 6 with 15/36 = 0.4166 chance. Can we improve that by re-rolling ?

If you roll a second time, then you have to take the sum of the probabilities of each roll multiplied by the probability of winning with that roll. This gives --

2 : 1/36 * 0 = 0

3 : 2/36 * 1/36 = 2/1296

4: 3/36 * 3/36 = 9/1296

5: 4/36 * 6/36 = 24/1296

6: 5/36 * 10/36 = 50/1296

7: 6/36 * 15/36 = 90/1296

8: 5/36 * 21/36 = 105/1296

9: 4/36 * 26/36 = 104/1296

10: 3/36 * 30/36 = 90/1296

11: 2/36 * 33/36 = 66/1296

12: 1/36 * 35/36 = 35/1296

We add all these probabilities to get 575/1296 = 0.443 chance which has improved our chances of winning if we re-roll. So now our strategy is clear.

Any roll 7 or below, Agnishom must re-roll. And keep any roll 8 and above.

Take the probability for each roll for the first throw of the dice multiplied by the probability of winning after that first roll. Any number 8 or higher has the same probabilities calculated above.

That's 105 + 104 + 90 + 66 +35 = 400/1296 = 0. 3086 chance of winning with the first roll.

Any number 7 or lower will be re-rolled, and from above we know that the probability of winning on the second roll is 575/1296. The probability of rolling 7 or lower is 21/36. This gives a probability for 2-7 roll when you re-roll at 21/36 * 575/1296 = 12075/46656 = 0.2588.

Total probability of winning on first and second roll is 0.3086 + 0.2588 = 0.567.

Is there any better way to solve it.Also I would like to ask if my solution is correct or not

Let $A_1, A_2$ denote the result of Agishom's first and second roll, respectively. I assume that the optimal is strategy among the following ones:

Agishom rolls twice if $A_1<x$ where $x=2,3,\dots, 12$.

With this, let's add one more outcome to Agishom's second roll: $A_2=0\text{ if } A_1\geq x.$

If $A^x$ denotes Agishom's result then $$A^x=\begin{cases}A_1&\text{ if }&A_1\geq x,\\A_2&\text{ if }&A_1<x.\end{cases}$$ Finally, let $S$ denote Satvik's result.

Now, let's calculate the $x$-dependent probability that Agishom wins: $P(A^x>S)$ for the meaningful $x's$.

For $x=2$

$$P(A^2>S)=P(A_1>S\ \cap \ A_1 \geq 2)+P(A_2>S\ \cap \ A_1<2)=$$ $$=\sum_{i=2}^{i=12}P(A_1>i\ \cap \ A_1 \geq 2\ \cap \ S=i)=$$ $$=\sum_{i=2}^{i=12}P(A_1>i\ \cap \ S=i)=\sum_{i=2}^{i=12}P(A_1>i)P(S=i).$$

In general

$$P(A^x>S)=P(A_1>S\ \cap \ A_1 \geq x)+P(A_2>S\ \cap \ A_1<x)=$$ $$=\sum_{i=2}^{i=12}P(A_1>i\ \cap \ A_1 \geq x\ \cap \ S=i)+\sum_{i=2}^{i=12}P(A_2>i\ \cap \ A_1<x\ \cap \ S=i)=$$ $$=P(A_1\geq x)\sum_{i=2}^{x-1}P(S=i)+\sum_{i=x}^{i=12}P(A_1>i)P(S=i)+P(A_1<x)\sum_{i=2}^{i=12}P(A_2>i)P(S=i).$$

Based on the $P(A_1=i)=P(A_2=i)=P(S=i)$ table the probabilities above can be calculated. The answer is the maximum in $x$.

The results of the calculation is shown below. Here the probability that Agishom wins is depicted as a function of $x$:

Tha maximum takes place at $x=8$. So, if Agishom rolls the second time if $A_1<8$ then the probability that she wins is $\approx 0.57.$-

The strategy is correct, but in the computation where you retain your first roll of $\ge 8$,
the sample space is only $15\times 36 = 540,\; thus\; \frac{400}{540}$

As for simplifying computations, you could isolate the cases where both roll the same number, viz.$(2,2,),(3,3)...(12,12)$; you could then use the symmetry of the remaining results.