Weighing, searching and strategy puzzles
GAME · Chapter 516 min readAsked at Jane Street, SIG, Optiver, Citadel
Assumes Measuring and timing puzzles.
After this lesson you should be able to
- Bound a search with an information argument before designing the search.
- Balance a worst case rather than an average when the question says "guarantee".
- Recognise the puzzles whose answer is a structure — a cycle, a parity, a square.
The second family asks you to find something with as few attempts as possible. Counting the information available tells you the answer is at least some number; a construction tells you it is at most that number; and when the two meet you are finished. Interviewers score the bound more than the construction, because the bound is the part that generalises.
Proposition 5.16
Bound first, construct second
Each attempt has a fixed number of distinguishable outcomes. If there are possibilities and each attempt has outcomes, no strategy can do better than attempts. Write that down before you design anything: it tells you whether to look for a cleverer scheme or to stop.
Holds when
- A balance has three outcomes, so weighings separate at most cases.
- A yes/no question has two, so questions separate at most .
- The bound is only achievable if every attempt can be made equally informative.
Example 5.18
Twelve coins, one counterfeit
Twelve coins look identical. One is counterfeit and is either heavier or lighter — you do not know which. With a balance and three weighings, find it and say which way it differs.
Show the worked solutionHide the worked solution
Worked solution
- Formula
- Substitute
- SolveBalanced: the fake is among the other four, and two weighings separate eight cases.
- Move three from the heavy pan, three from the light pan and bring in known-good coins.
- Answer
Sanity check. Thirteen coins is cases, still under — but the first weighing cannot be made informative enough, so the bound is necessary and not sufficient. Saying that is worth more than the scheme.
Example 5.19
Two eggs and a hundred floors
You have two identical eggs and a hundred-storey building. An egg breaks above some floor and survives at or below it. Find that floor with as few drops as possible in the worst case.
Show the worked solutionHide the worked solution
Worked solution
- Formula
- Substitute
- SolveIf it breaks, the second egg walks floors 1 to 13: 14 drops total.
- Each gap shrinks by one, so the worst case stays at 14.
- Answer
Sanity check. Every path costs the same by construction. A strategy whose worst case varies between branches has not been balanced yet.
Why the gaps shrink by exactly one. After the first drop you have used one attempt, so whatever happens you have one fewer left. The next interval must therefore be one smaller, or its branch would cost more than the first one did. Balancing the worst case across every branch is the whole method, and it is the same argument that makes a fair market maker indifferent between being lifted and being hit.
The rest of this lesson is in Premium
You have read the opening. 12 more sections follow, including 5 worked examples and 3 quick checks.
Nothing is charged for 7 days, and you can cancel before then. Or read Arithmetic that survives a clock in full, free.