Qm

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

Sign in to join the discussion · reading is open to everyone

💡 Discussion rules

  1. No full solutions here. Hints and approaches only.
  2. Complexity, edge cases and intuition are the point.
  3. Interview experiences are welcome. Respect your NDAs.

Loading discussion…

Learn the concepts

The theory behind this question.

Related questions

A sentence nobody on the island can sayAt least one of us is a knaveThe islander who called them both liarsExactly one of us is a knightFour islanders argue over the knight count
All questions →