Two players play a game. Player 1 goes first, and chooses a number between 1 and 30 (inclusive). Player 2 chooses second; he can't choose Player 1's number. A fair 30-sided die is rolled. The player that chose the number closest to the value of the roll takes that value (say, in dollars) from the other player. Would you rather be Player 1 (choose first) or Player 2 (choose second)? Also, what integer should that player choose?

After doing some trial-and-error calculation, I now know the correct player and the integer he should choose, but what is a faster way to determine which player to be, and which number he should choose?


2 Answers 2


Let $x_1$ and $x_2$ be the player's choices. To maximize his chances of winning, player 2 will select a number a close as possible to player 1's but must choose whether to select a number above or below $x_1$. The expected payoff for choosing above $x_1$ is greater if:


Computation provides:


Thus, if player 1 chooses 21 or less, 2 chooses $x_1+1$. If player 1 chooses 22 or more, player 2 chooses $x_1-1$.

Given this behavior of player 2, choosing 21 gives player 1 an expected payoff of $\frac{77}{10}$ while choosing 22 gives player 1 an expected payoff of $\frac{78}{10}$. Thus, player 1 chooses 22 and player 2 chooses 21 (other choices give player 1 a lower payoff).

Player 1 with expected payoff $\frac{78}{10}$ does slightly better than player 2 with expected payoff $\frac{77}{10}$. Note that the sum of these expected values is $\frac{155}{10}=\frac{30*29}{2*30}$ which is the expected value of a dice roll.

  • $\begingroup$ Great answer, but when computing the payoffs, why don't you include the losses? If your number happens to be farther, you must pay the other player the amount indicated by the dice, or at least that's what's in the original statement. $\endgroup$
    – user_12345
    Aug 28, 2023 at 20:52

Here is some Python code that simulates this game using Monte Carlo and then uses CommonerG's method to solve for the optimal strategy for any n-sided die. Note that the Monte Carlo strategy sometimes converges to a local maximum, but with enough iterations it is usually correct.


  • $\begingroup$ page not found... $\endgroup$
    – Idonknow
    Jan 11, 2020 at 2:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .