Number guessing uses limited information to identify an unknown number or compare unknown numbers.
By asking a small number of innocent-sounding questions about an unknown number, it is possible to reconstruct the number with absolute certainty (assuming that the questions are answered correctly). Ball and Coxeter (1987) give a number of sets of questions which can be used.
One of the simplest algorithms uses only three queries that can be used to determine an unknown number from an audience member.
1. Ask the person to compute (i.e., three times the secret number
) and announce if the result is even
or odd.
2. If you were told that is even, ask the person to
compute the number
which is half of
. If you were told that
is odd, ask the person to
compute the number
which is half of
.
3. Ask the person to compute .
4. Ask the person to divide by 9 and to reveal the quotient
, discarding any remainder.
The original number is then given by
if
was even, or
if
was odd. For
even,
,
,
,
, so
. For
odd,
,
,
,
, so
.
Another method asks:
1. Multiply the number by 5.
2. Add 6 to the product.
3. Multiply the sum by 4.
4. Add 9 to the product.
5. Multiply the sum by 5 and reveal the result .
The original number is then given by , since the above steps give
.
A different guessing problem fixes two distinct real numbers on separate cards. One card is
revealed, each with probability
, and the guesser must decide whether its value is the larger
(Cover 1987, p. 152; Numberphile 2015). Choose a threshold
whose probability
density function is positive on the entire real line.
The threshold and the revealed-card index are independent
random variables. A standard normal
distribution is one possible choice for
. If the revealed value
exceeds
, guess that it is the larger value, and otherwise guess that
it is the smaller. Writing
for the distribution
function, the probability of a correct guess
is
The two terms in the first expression correspond to revealing and
, respectively. This gives an advantage for every fixed pair.
Since
is continuous, the advantage tends to 0 as
decreases to
, so no fixed positive improvement over
is guaranteed across all pairs.