Can Bob beat 50%?

Yes. Bob can use a random threshold to get a strictly better-than-50% success probability for any two distinct numbers Alice chooses in (0,1).

Bob's strategy:
Generate a random threshold T ~ Uniform(0,1) before looking at the chosen number. If the observed number is greater than T, guess larger. Otherwise, guess smaller.

Alice may choose any two distinct values.

Exact success probability
70.0%
P(correct) = 1/2 + (0.70 - 0.30)/2 = 0.70

The farther apart the numbers are, the larger Bob's advantage.

Why the threshold helps
0 1 T = 0.50 a = 0.30 b = 0.70

T lies between the two numbers → Bob is guaranteed correct.

T < a

Both numbers are above the threshold. Bob always guesses “larger,” so he is correct only if he happened to see the larger number.

success = 1/2
a < T < b

The threshold separates the two values. Seeing a makes Bob guess “smaller”; seeing b makes him guess “larger.”

success = 1
T > b

Both numbers are below the threshold. Bob always guesses “smaller,” so he is correct only if he happened to see the smaller number.

success = 1/2
Let Alice's values be a < b. Since T is uniform on (0,1), P(a < T < b) = b - a. Therefore:
P(correct) = 1/2 · (1 - (b-a)) + 1 · (b-a) = 1/2 + (b-a)/2 > 1/2.

So Bob can always do strictly better than random guessing for any two distinct numbers. If the two numbers are extremely close, his advantage may be tiny, but it is still positive.