I found a fun problem on reddit some time ago:

A number is randomly selected between two bounds. Each player can make one guess, the closest to the selected number wins.

The author of this comment notes that they "always use a random number generator for [their] pick rather than guessing to avoid accidentally clustering with others". This relies on the idea illustrated by this reddit thread, that people tend to favour the same numbers when asked to make a random choice, thus generating non-uniform distributions that can create lumps. Picking a number from a uniform distribution might then increase the chances to pick it in a less preferred region, and thus, the chances to be the closest from the target.

But could we do better than that? What is the optimal strategy?

# Against unbiased opponents

We could start assuming that the opponents are unbiased and all pick numbers from the uniform distribution on the allowed range. Knowing that, where should we play?

First of all, we should decide on a couple of details on the lottery that we will be modelling: discrete (we can pick any integer from $1$ to $N$ included), or continuous (we can pick any real number between $0$ and $1$ ), and what should we do in case of tie. These rules lead to slightly different behaviours, but I suggest we study both the discrete and continuous cases. Ties will not happen in the continuous case, but in the discrete case, we could either

• give a whole prize to everyone tied first;
• make another lottery among only the people tied first, and repeatedly until only one person remains;
• split the prize equally between the people tied first;
• decide that everyone lost.

The second case is a bit more delicate to study because it would be reasonable to allow a change of strategy between the rounds, depending on the number of opponents, so I propose that we restrain ourselves to the simple cases where ties cause the prize to be either multiplied, split, or destroyed.

## Discrete case

We are searching for the winning expectancy $\mathbf{E}(N,K,C)$ against $K$ opponents, if we play at $C$ (between $1$ and $N$ ).

Assume the selected number is $S$ . Then we can count the number $N_=$ of numbers $X$ at the same distance from the target as we are: such that $|X-S| = |C-S|$ . This will be $1$ or $2$ . We can also count the number $N_\gt$ of numbers $X$ farther from the target than we are: such that $|X-S| \gt |C-S|$ . If $E$ of our opponents are at the same distance from the target as we are, and all the others are farther, then in case we split the prize, we win $\frac{1}{E+1}$ of the prize. This happens with probability $\binom{K}{E} \left(\frac{N_=}{N}\right)^E \left(\frac{N_\gt}{N}\right)^{K-E}$ for given $C$ and $S$ . The total winning expectancy is then Expectancy to win in the uniform discrete case if the prize is split between the exaequos, for N=10.

From this graph, we indeed win every time when we have no opponent, we win less often as the number of opponents increases, and picking the middle region seems in general to be a good choice.

But as the number of opponents goes up, the winning expectancy goes down and it becomes more difficult to distinguish the strategy. To make it appear more clearly, I will normalize each curve such that their integrals are equal (more precisely I divide them by the total winning expectancy for this number of opponents). Strategies for the uniform discrete case if the prize is split between the exaequos, for N=10.

What jumps to the eye is that for enough opponents, the best strategy is not to play in the middle any more. We can also note that the strategies against 1 or 2 opponents are identical. Finally, when the number of opponents becomes very large, the best strategy becomes to chose uniformly: indeed in this case all the numbers will probably have been chosen by several people, so that we only win if we pick exactly the selected number.

Similar reasoning allows to obtain formulas for the other rules:

## Continuous case

A closed-form formula is easier to find for the continuous case: following a similar reasoning, the winning expectancy if we play at $x\in[0,1]$ against $K$ opponents is

A small advantage seems to subsist in the continuous case, since we can make a guess as close to the border as we want. The positions of the two peaks of the strategy $p(K)$ and $1-p(K)$ are such that $p(K)\sim\frac{2}{2+K}$ when $K$ tends to infinity, and $(1+K)\\,\mathbf{E}(K,p(K)) = (1+K)\\,\mathbf{E}(K,1-p(K)) \to 1+\frac{1}{2\\,\mathrm{e}^2} \approx 1.068$ , the demonstration of these properties is left as an exercise to the reader.