Quant Memo
Core

Twenty Questions and the Entropy Bound

The game of twenty questions works because each well-chosen yes/no question can at best cut the remaining possibilities in half — which sets a hard floor, log base 2 of the number of possibilities, on how many questions any guessing strategy needs.

Prerequisites: Counting Information to Bound the Answer

In twenty questions, one player thinks of something and the other must identify it using only yes/no questions, answered truthfully. With a good strategy, twenty questions is enough to pin down roughly a million distinct things. That number isn't a coincidence or folk wisdom — it falls directly out of counting how much a single yes/no answer can possibly narrow things down, and it's the same bound that shows up in every "identify one thing out of many, using few discrete tests" interview puzzle.

The core idea: one bit halves the space, at best

A yes/no question has exactly two possible answers. If the answer perfectly splits the remaining candidates into two equal halves, you eliminate exactly half of them regardless of which way it goes — that's the best any single question can do, because if the split is uneven, the unlucky branch (the larger half) leaves you with more work than an even split would have. After qq perfectly-balanced questions, the number of surviving candidates has been halved qq times, so it started at no more than 2q2^q. Turning this around: to guarantee identifying one item out of NN possibilities, you need at least qq questions where 2qN2^q \ge N, i.e. qlog2Nq \ge \log_2 N. This is the entropy bound: log2N\log_2 N bits (questions) are necessary, and — if you can always find a perfectly balanced question — sufficient.

Worked example: why twenty questions covers about a million things

220=1,048,5762^{20} = 1{,}048{,}576. So twenty perfectly-chosen yes/no questions can in principle distinguish just over a million distinct possibilities — which is why the game plausibly covers "any person, place, or thing" a casual player might think of, without needing more questions than a party game allows. Concretely: question 1 ("is it a living thing?") ideally splits the roughly-a-million-candidate mental space into two halves of about half a million each. Question 2 splits whichever half survived into quarters of the original. By question 20, in the best case, exactly one candidate remains — but only if every question actually achieves close to a 50/50 split of whatever's currently left, which is why skilled players ask broad, discriminating questions early rather than narrow, guess-like ones ("is it a cat?") that mostly waste a question's worth of potential information on a near-certain "no."

Worked example 2: applying the bound to a familiar puzzle

The 12-coin balance-scale puzzle (find one odd coin among 12, unknown direction, in 3 weighings) has 12×2=2412 \times 2 = 24 possibilities to distinguish. A weighing has 3 outcomes rather than 2, so the analogous bound is 3w243^w \ge 24, giving wlog3242.89w \ge \log_3 24 \approx 2.89, so w=3w=3 weighings is the minimum integer satisfying the bound — matching the puzzle's known answer exactly, and confirming that 3 weighings is not just achievable but provably necessary, since 2 weighings only offer 32=9<243^2 = 9 < 24 distinguishable outcomes.

~1,000,000 ~500,000 each balanced question halves whatever remains; 20 halvings from ~10^6 reaches 1
A balanced yes/no question always halves the surviving candidate set; the entropy bound log2(N) is just counting how many halvings it takes to shrink N down to 1.

The minimum number of yes/no questions needed to guarantee identifying one of NN possibilities is log2N\lceil \log_2 N \rceil, achieved only if every question splits the currently-remaining candidates as close to evenly as possible. The same logic generalizes to any test with kk outcomes, replacing log2\log_2 with logk\log_k.

What this means in practice

The entropy bound is the go-to sanity check for "is this proposed test/question/weighing plan even theoretically sufficient" before working out the details of how — compute the possibility count NN, compute log2N\log_2 N (or logkN\log_k N for a kk-outcome test), and compare it to the number of tests allowed. This same reasoning underlies why binary search is optimal for sorted lookups, why balanced decision trees classify efficiently, and why a well-designed due-diligence checklist asks broad discriminating questions before narrow confirmatory ones.

The bound log2N\log_2 N is a lower limit assuming perfectly balanced splits every time — it's easy to mistake it for a guarantee that any strategy achieving that many questions will work. A poorly chosen sequence of lopsided questions (like guessing specific items one at a time) can take up to N1N-1 questions in the worst case, even though the information-theoretic minimum is only log2N\log_2 N.

Related concepts

Practice in interviews

Further reading

  • Cover & Thomas, Elements of Information Theory, ch. 1
ShareTwitterLinkedIn