Solution

Three Numbers, One the Sum

Show the problem again

Alice, Bob and Carol are perfect logicians. Each has a positive integer written on their forehead; each sees the other two numbers but not their own. It is common knowledge that one of the three numbers equals the sum of the other two. A referee asks them in the order Alice, Bob, Carol, Alice, Bob, Carol, ... "Do you know your own number?" Every answer is heard by all. You can see that Bob wears 5 and Carol wears 7, but not Alice's number. You observe that the first six answers are all "no", and that the seventh answer, Alice's second, is "yes". What number is on Alice's forehead?

Worked solution

The answer is 12. Alice sees 5 and 7, so her own number is either 12 (the sum) or 2 (the difference). The question is which of the worlds (12, 5, 7) and (2, 5, 7) produces six silent answers followed by a "yes" from Alice. In every world one number, the largest, is the sum of the other two, and it is strictly largest. A player who sees p and q has two candidates, p + q and |p − q|, the second excluded when p = q. Key lemma: a player who does not hold the largest number never knows their number. Such a player's alternative world replaces their number by the sum of the other two, making them the largest. Compare the actual world w with that alternative w'. At any earlier question asked to this same player, their view is identical in w and w', so they gave the same answer in both. Any other player is not the largest in w', so by induction on the question number they would have said "no" in w' as well. Hence w' is never eliminated, and the player stays ignorant forever. This argument needs no bound on the numbers. So only the holder of the largest number can ever say "yes". If the other two numbers are equal, that player knows at once (the difference would be 0). Otherwise their alternative world replaces the largest number by the difference of the other two; in that smaller world only its own largest-holder can speak up, so the alternative is eliminated exactly at its own first "yes", and the largest-holder of the original world answers "yes" at their first turn after that. This gives a Euclid-like recursion that always terminates, because the numbers shrink. Questions go Alice (1), Bob (2), Carol (3), Alice (4), and so on. Start at the bottom: (2, 1, 1) resolves at question 1 (Alice sees two equal numbers). (2, 1, 3) then resolves at Carol's next turn, question 3. (2, 5, 3) resolves at Bob's next turn, question 5. (2, 5, 7) resolves at Carol's next turn, question 6. Finally (12, 5, 7), whose alternative is (2, 5, 7), resolves at Alice's next turn, question 7. So if Alice wore 2, Carol would have said "yes" at question 6; six "no" answers rule that out, and Alice, who wears 12, says "yes" at question 7. (Confirmed by a program implementing the recursion and, independently, by simulating all announcements over all worlds with numbers up to 160, treating larger candidate worlds as never eliminated.)

Source: Classic three-foreheads sum puzzle in wide circulation; no traceable original source. Statement written for AxiomIQ.