Maximizing score in number-guessing game.

294 Views Asked by At

This is inspired by a puzzle (related to the two-envelopes problem) that I've seen in several places, including unbounded generalizations. The basic premise is that Alice chooses two real numbers from $[0,1]$ uniformly at random, and writes them down on slips of paper. Bob chooses one slip of paper at random, reads the number, and may either keep that slip or switch for the other. Bob's score is the number he ends up with, and our task is to maximize his expected value. The standard solution is for Bob to choose his own real number uniformly at random, and switch if the number he picks is greater than what's on the slip he holds.

However, this is not the only solution. Bob has one piece of data, $x$, and the use of a random number generator. He can keep his initial slip with some probability $f(x)$ and swap with probability $1-f(x)$. Call this function $f(x)$ his strategy; the standard solution corresponds to strategy $f(x)=x$. We calculate his expected winnings as $$E=\iint_{[0,1]\times[0,1]} f(x)x+(1-f(x))y\, dx dy=\int_0^1f(x)(x-0.5)+0.5\,dx$$

Trying $f(x)=x$ gives $E=0.58\overline{3}$, while $f(x)=x^{1.4}$ gives $E\approx 0.585784$.

UPDATE: In the comments Calvin Lin suggests $f(x)=\begin{cases}0&x<0.5\\1&x>0.5\end{cases}$, with $E=0.6125$.

What's the highest $E$ Bob can achieve, and what is the corresponding $f$?

The maximum, if Bob knew what was on the others slip, is $2/3$, so the answer must be less than that.

1

There are 1 best solutions below

5
On BEST ANSWER

Consider the following strategy: If chosen slip is larger than $\frac{1}{2}$, keep it. Else choose second slip.

Then, the expected value is $\int_{\frac{1}{2}}^1 x\, dx + (\frac{1}{2}) \int_0^1 y \, dy = 0.625.$

Claim: This is the best possible strategy.

Suppose not, then one of the following must happen

  1. Bob picks a number that is larger than $\frac{1}{2}$, and decides to pick the second slip.
  2. Bob picks a number that is smaller than $\frac{1}{2}$ and decides to stick to it.

In either case, we can see that Bob increases his expected value by following the initial strategy. (In particular, this strategy is unique, up to a set of measure 0).