Jewel Thieves and a Stolen Gem
The Moonstone has been stolen. Police have three suspects under surveillance—three of the city’s most notorious jewel thieves—but no evidence to arrest any of them. Each thief, denying involvement, has publicly wondered: who took it this time?
The surveillance team observes the three dining together. During the meal, each thief leaves the table to visit the lavatory. Whilst one is away, the two remaining thieves flip a fair coin, hiding the result from both the absent thief and the watching police. After the third thief returns, all three wink at each other and disperse silently.
From what they observed, the surveillance team concludes that all three thieves now know whether one of them stole the Moonstone, but if one did steal it, the other two don’t know which one. The police still don’t know whether any of them is guilty.
How did the thieves communicate this information using only coin flips and winks?
Hint
Each pair of thieves saw exactly one coin flip together. What information does each thief have after all three coins have been flipped?
Hint
Consider what happens if each thief computes a simple function of the two coin results they saw, then winks based on that computation.
Hint
If all three thieves are innocent and follow the same protocol, how many winks would you expect to see in total? What property ensures this number is consistent?
Hint
How could a guilty thief alter their behaviour to signal their guilt whilst still preventing the other two from identifying them?
Solution
Answer: There are multiple solutions, but here’s a possible strategy they could be using: each thief winks if both coin flips they see are different. A guilty thief does the opposite, winking if both coin flips are the same.
Let’s label the thieves X, Y, and Z. Three coins are flipped:
- CXY: seen by X and Y (whilst Z was away)
- CXZ: seen by X and Z (whilst Y was away)
- CYZ: seen by Y and Z (whilst X was away)
Represent heads as 1 and tails as 0.
Each thief computes the XOR of the two coins they saw:
- X computes: CXY⊕CXZ
- Y computes: CXY⊕CYZ
- Z computes: CXZ⊕CYZ
The protocol: if the result is 1 (i.e. the coins are different), wink. If the result is 0 (i.e. the coins are the same), don’t wink.
Notice that the total number of winks has a fixed parity. Computing the XOR of all three values:
X⊕Y⊕Z=(CXY⊕CXZ)⊕(CXY⊕CYZ)⊕(CXZ⊕CYZ)=(CXY⊕CXY)⊕(CXZ⊕CXZ)⊕(CYZ⊕CYZ)=0⊕0⊕0=0Each coin appears exactly twice in this expression. Since a⊕a=0 for any bit a, all terms cancel out. Thus, the total XOR is always 0.
This means the total number of winks is always even: either 0 winks (if all three XOR results are 0) or 2 winks (if exactly two XOR results are 1). We can never have 1 or 3 winks if all thieves follow the protocol honestly.
Now suppose one thief is guilty. That thief inverts their behaviour: they wink if their XOR is 0, and don’t wink if their XOR is 1. This adds 1 to the total XOR.
Without loss of generality, let’s assume the thief is X.
X⊕Y⊕Z=(CXY⊕CXZ⊕1)⊕(CXY⊕CYZ)⊕(CXZ⊕CYZ)=(CXY⊕CXY)⊕(CXZ⊕CXZ)⊕(CYZ⊕CYZ)⊕1=0⊕0⊕0⊕1=1The total number of winks becomes odd: either 1 or 3.
The protocol reveals:
- Even number of winks (0 or 2): None of them stole the Moonstone
- Odd number of winks (1 or 3): One of them is guilty
The other two thieves can’t determine which one inverted their behaviour—they only know someone did.
However, this is only one such possible protocol. If the thieves instead decided that they should wink if both coins flips are the same, then an even number of winks would indicate that one of them is guilty. As such, the police learns nothing from this surveillance.
Try These Next
Planting Trees 3
The mathematics professor has become your most loyal client. After solving her first two challenges, she calls you back with what she claims is her hardest...
Chomp 1
You are playing a dangerous game with a friend. He pulls out a chocolate bar comprising 6 squares arranged in a 3 by 2 arrangement. The bottom-left square is...
Equal Shape Cutting 4
With 1 cut, divide the zigzag shape into 2 equal shapes of itself. The cut does not have to be straight, but has to be a connected line. The shapes can be...