# Two players rolling a $20$-sided die; player B can re-roll; how to decide when to reroll

This is somewhat related to my earlier question What is the probability that player A rolls a larger number if player B is allowed to re-roll (20-sided die)? and somewhat related to 30 sided die and 20 sided die.

I made up this question as a follow-up to the previous one. Let's consider a game where player $$A$$ and $$B$$ tosses a 20-sided die. Player $$B$$ is allowed to re-toss and plays optimally. Player $$B$$ can observe his first toss before deciding whether to re-toss again, but he is not allowed to observe player $$A$$'s toss before deciding whether to re-toss. Player $$A$$'s toss is compared to player $$B$$'s LAST toss (we're NOT taking the maximum of 2 tosses by player $$B$$).

How does $$B$$ decide the threshhold at which he should re-toss for each of the following:

(1) If player $$A$$ tosses a strictly larger number, then player $$B$$ pays \$1 to player $$A$$. Otherwise, player $$A$$ pays player $$B$$ \$1.

(2) If player $$A$$ tosses a strictly larger number, then player $$B$$ pays \$X to player $$A$$, where $$X$$ is the value player $$B$$ tossed. Otherwise, player $$A$$ pays player $$B$$ \$Y, where $$Y$$ is the value player $$B$$ tossed.

For both parts, assume player $$B$$ plays optimally and that he wants to maximize his profit, i.e., minimize player A's profit.

For part (1), the problem of deciding whether to re-toss or not is equivalent to minimizing the probability of $$A$$ winning, and we find that player $$B$$ will re-toss if the first toss is $$\leq 10$$ (this was proven in my previous post, and I confirmed it via monte carlo).

At first, I thought the threshhold at which player $$B$$ decides to re-toss is the same for both. But it seems to not be, but it is not intuitive to me why this is not the case. I did not solve part (2) analytically yet, but Monte Carlo is telling me that $$\leq 11$$ is the threshhold at which player $$B$$ should re-toss.

I may solve this analytically tomorrow (I think perhaps the approach would be to use conditional expectation to solve this rather than only using probabilities as in part (1)), but before I do that, I was wondering if someone can give me an intuitive explanation of why (2) isn't equivalent to minimizing the probability of $$A$$ winning or maximizing the probability of $$B$$ winning?

• I assume if B has the higher number then A pays B, not the other way around? Commented Aug 7, 2020 at 9:43
• @EspeciallyLime right Sorry. I just fixed it. I’ll check back tomorrow.
– 24n8
Commented Aug 7, 2020 at 9:57

The easiest way to do this is to work out B's expected profit if B sticks on a value $$r$$, call this $$p(r)$$. Since A's roll is independent of what B does, we can do this. Then if B rerolls he gets a random number with distribution $$U$$ which is uniform on $$1,\ldots,20$$, and his expected profit is therefore $$E(p(U))$$. We should reroll if and only if $$p(r).

There seem to be some typos, but I assume that the loser pays the winner the amount the loser rolled.

Now $$p(r)=-r\times \frac{20-r}{20}+\sum_{s\leq r}\frac{s}{20}$$. Calculating these (I hope correctly) in python gives:

1   -0.9
2   -1.65
3   -2.25
4   -2.7
5   -3.0
6   -3.15
7   -3.15
8   -3.0
9   -2.7
10  -2.25
11  -1.65
12  -0.9
13  0
14  1.05
15  2.25
16  3.6
17  5.1
18  6.75
19  8.55
20  10.5


The average of these values is $$0.525$$, so you should reroll if and only if the actual value is higher, i.e if and only if you get less than $$14$$.

If the payment is always what B rolled, then the function is simpler: $$p(r)=r\times\frac{r}{20}-r\times\frac{20-r}{20}=\frac{10r-r^2}{10}$$. The average works out to be $$3.85$$, which is between the values for $$r=12$$ and $$r=13$$, so reroll if you get less than $$13$$.