TOPICS
Search

Number Guessing


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 n from an audience member.

1. Ask the person to compute n^'=3n (i.e., three times the secret number n) and announce if the result is even or odd.

2. If you were told that n^' is even, ask the person to compute the number n^('') which is half of n^'. If you were told that n^' is odd, ask the person to compute the number n^('') which is half of n^'+1.

3. Ask the person to compute n^(''')=3n^('').

4. Ask the person to divide n^(''') by 9 and to reveal the quotient k, discarding any remainder.

The original number n is then given by 2k if n^' was even, or 2k+1 if n^' was odd. For n=2m even, n^'=6m, n^('')=3m, n^(''')=9m, k=m, so 2k=2m=n. For n=2m+1 odd, n^'=6m+3, n^('')=3m+2, n^(''')=9m+6, k=m, so 2k+1=2m+1=n.

Another method asks:

1. Multiply the number n 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 n^'.

The original number is then given by n=(n^'-165)/100, since the above steps give n^'=5(4(5n+6)+9)=100n+165.

A different guessing problem fixes two distinct real numbers a<b on separate cards. One card is revealed, each with probability 1/2, and the guesser must decide whether its value is the larger (Cover 1987, p. 152; Numberphile 2015). Choose a threshold T 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 T. If the revealed value z exceeds T, guess that it is the larger value, and otherwise guess that it is the smaller. Writing F(t)=P(T<=t) for the distribution function, the probability of a correct guess is

 P_(correct)=1/2(1-F(a))+1/2F(b)=1/2+(F(b)-F(a))/2>1/2.

The two terms in the first expression correspond to revealing a and b, respectively. This gives an advantage for every fixed pair. Since F is continuous, the advantage tends to 0 as b decreases to a, so no fixed positive improvement over 1/2 is guaranteed across all pairs.


See also

Number Picking

Explore with Wolfram|Alpha

References

Bachet, C. G. Problèmes plaisans et délectables, 2nd ed. 1624.Ball, W. W. R. and Coxeter, H. S. M. Mathematical Recreations and Essays, 13th ed. New York: Dover, pp. 5-20, 1987.Chandrasekaran, K. R. "Think of a Number from 1 to 27." https://web.archive.org/web/20091027100702/http://geocities.com/krcgee/games/ntrick27.html.Cover, T. M. "Pick the Largest Number." In Open Problems in Communication and Computation (Ed. T. M. Cover and B. Gopinath). New York: Springer-Verlag, p. 152, 1987. https://doi.org/10.1007/978-1-4612-4808-8_43.Flannery, S. and Flannery, D. In Code: A Mathematical Journey. London, England: Profile Books, p. 66, 2000.Kraitchik, M. "To Guess a Selected Number." §3.3 in Mathematical Recreations. New York: W. W. Norton, pp. 58-66, 1942.Numberphile. "How to Win a Guessing Game." May 21, 2015. https://www.youtube.com/watch?v=ud_frfkt1t0.

Referenced on Wolfram|Alpha

Number Guessing

Cite this as:

Weisstein, Eric W. "Number Guessing." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/NumberGuessing.html

Subject classifications