One question, one islander, and the buried treasure
You land on an island where everyone is a knight (always truthful) or a knave (always lying). You meet one islander and have no idea which type she is. You want to know whether there is treasure buried on the island, and you may ask her exactly one yes-or-no question.
What question do you ask, and why does it work regardless of her type? Give at least two different questions that work and explain the principle behind them.
Show a hint
You need a question whose answer is "yes" exactly when there is treasure, from a knight and from a knave. Try folding the islander's own type into the question so that a knave's lie cancels itself out.
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
💡 Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussion…
Learn the concepts
The theory behind this question.