Quant Memo
Core

Counting Information to Bound the Answer

Every question you're allowed to ask, or every switch you're allowed to flip, can distinguish at most a limited number of outcomes. Count the outcomes you must distinguish and you get a hard floor on how many questions you need.

Prerequisites: How to Attack a Brainteaser

Puzzles about weighings, yes/no questions, or guesses often ask for the minimum number needed in the worst case. Rather than trying strategies until you can't find a better one, you can often prove a floor directly: count how many distinct final outcomes the puzzle needs to tell apart, and note that each question can only cut that count down by a bounded factor. If the count doesn't fit, no strategy — however clever — can do it in fewer questions.

Worked example: the counterfeit coin, lower bound only

You have 12 coins, identical in appearance. Exactly one is counterfeit and weighs differently from the rest (you don't know if it's heavier or lighter). You have a balance scale. What is the minimum number of weighings needed, in the worst case, to find the counterfeit and say whether it's heavy or light — and why can't fewer weighings possibly work?

Count the outcomes you must distinguish. The counterfeit could be any of the 12 coins, and it could be either heavy or light — that's 12×2=2412 \times 2 = 24 possible final answers, and your strategy has to correctly announce which of the 24 it is.

Count what one weighing can tell you. A balance scale has exactly three possible readings each time you use it: left side heavier, right side heavier, or balanced. So kk weighings, in sequence, can produce at most 3k3^k distinct sequences of readings.

Set up the inequality. To have any hope of always identifying the right one of 24 outcomes, the number of distinguishable reading-sequences must be at least the number of outcomes: 3k243^k \geq 24.

Solve it. 32=93^2 = 9, too small. 33=27243^3 = 27 \geq 24. So k3k \geq 3: at least 3 weighings are required, and this bound alone rules out any 2-weighing strategy before you've tried to design one. (A matching 3-weighing strategy exists, which shows the bound is tight — but that construction is a separate puzzle.)

outcomes to distinguish: 24 (12 coins x heavy/light) 1 weighing: 3 2 weighings: 9 3 weighings: 27 need >= 24 outcomes distinguishable 9 < 24 — fails still 9 < 24 — fails 27 >= 24 — possible
Only the outcome count matters for the lower bound: $3^2=9$ is too small to cover 24 cases, so 2 weighings can never suffice, no matter how cleverly they're chosen.

Count the number of distinct final outcomes a puzzle must distinguish, and count the maximum number of outcomes one "question" can split apart. If (questions)-to-the-power splits fall short of the outcome count, that number of questions is impossible — a lower bound that requires no strategy at all.

The same counting proves that guessing a number between 1 and NN with yes/no questions needs at least log2N\lceil \log_2 N \rceil questions (each question halves the outcomes at best), and that identifying one fake coin among nn using a balance needs at least log3n\lceil \log_3 n \rceil weighings when you already know the direction of the fake.

Before designing a strategy, ask "how many things could I possibly need to tell apart, and how many ways can one step of my strategy come out?" Divide, round up, and you have a floor before you've built anything.

This is the same reasoning behind coding-theory bounds on compression and hashing: you cannot losslessly compress every one of NN distinct messages into fewer than log2N\log_2 N bits, because a shorter code simply doesn't have enough distinct patterns to go around.

Related concepts

Practice in interviews

Further reading

  • Engel, Problem-Solving Strategies (ch. 3)
ShareTwitterLinkedIn