One number is visible and another remains hidden. You may ask for no further information, but the value you have seen may already reveal more than it seems.

The Other Number

Strategist
Master plays

Riddle statement

Two real numbers are generated independently, each chosen uniformly from the interval \([0,1]\).

One of the two numbers is then selected at random and shown to you. The other remains hidden.

After seeing the visible number, you must make one of two claims:

  • “The hidden number is greater.”
  • “The hidden number is smaller.”

You may ask no additional questions.

Can you succeed with probability greater than \(1/2\)?

Find the optimal strategy and prove the greatest possible probability of success.

The two numbers are equal with probability zero, so ties need not be considered.

Show solution

Solution

Answer: the optimal probability of success is

$ \boxed{\frac34}. $

The strategy is to compare the visible number with \(1/2\).

1. What the visible number tells us

Let \(V\) be the visible number and \(H\) the hidden one.

The original numbers are generated independently and uniformly on \([0,1]\). Randomly selecting which one is shown preserves this property: \(V\) and \(H\) are still independent and uniform.

Suppose that we observe:

$ V=x. $

Because \(H\) is uniform and independent of \(V\), the probability that it lies below \(x\) equals the length of \([0,x)\):

$ \Pr(H<x\mid V=x)=x. $

Similarly:

$ \Pr(H>x\mid V=x)=1-x. $

2. The best decision for each observed value

For every \(x\), choose the claim with the greater conditional probability.

If:

$ x<\frac12, $

then:

$ 1-x>x, $

so the best claim is that the hidden number is greater.

If:

$ x>\frac12, $

then:

$ x>1-x, $

so the best claim is that the hidden number is smaller.

At \(x=1/2\), both claims succeed with probability \(1/2\). This exact value occurs with probability zero, so either choice is acceptable.

The strategy is therefore:

  • if \(x<1/2\), say “greater”;
  • if \(x>1/2\), say “smaller.”

3. Overall probability of success

The optimal conditional probability at the observed value \(x\) is:

$ \max\{x,1-x\}. $

Since \(V\) is uniform on \([0,1]\), average this quantity:

$ \Pr(\text{success}) = \int_0^1 \max\{x,1-x\}\,dx. $

Split the integral at \(1/2\):

$ \Pr(\text{success}) = \int_0^{1/2}(1-x)\,dx + \int_{1/2}^1x\,dx. $

The first term is:

$ \int_0^{1/2}(1-x)\,dx = \left[ x-\frac{x^2}{2} \right]_0^{1/2} = \frac38. $

The second is also:

$ \int_{1/2}^1x\,dx = \left[ \frac{x^2}{2} \right]_{1/2}^1 = \frac38. $

Thus:

$ \Pr(\text{success}) = \frac38+\frac38 = \boxed{\frac34}. $

4. Why no other strategy can do better

Optimality does not depend on restricting ourselves to threshold strategies.

After observing a particular value \(x\), there are only two decisions:

  • say “greater,” which succeeds with probability \(1-x\);
  • say “smaller,” which succeeds with probability \(x\).

No strategy can achieve, at that same value of \(x\), a probability greater than:

$ \max\{x,1-x\}. $

Randomization cannot help either: mixing the two decisions produces only a weighted average of \(x\) and \(1-x\), which never exceeds their maximum.

Our strategy attains that maximum for every observed value. It therefore also attains the greatest possible average success probability.

5. The optimal threshold in another form

Suppose an arbitrary threshold \(t\) is used:

  • say “greater” when \(x<t\);
  • say “smaller” when \(x>t\).

The probability of success is:

$ P(t) = \int_0^t(1-x)\,dx + \int_t^1x\,dx. $

Calculating gives:

$ P(t) = \frac12+t-t^2. $

Completing the square:

$ P(t) = \frac34- \left(t-\frac12\right)^2. $

This is maximized uniquely at:

$ t=\frac12, $

with maximum value:

$ P\left(\frac12\right)=\frac34. $

Key idea: the visible number does not reveal the hidden one, but it changes which comparison is more likely. The optimal strategy uses exactly that information and cannot be improved point by point.