Qm

Three guards, three prisoners, one two-seat boat

Three guards and three prisoners must cross a river. The boat holds at most two people, and someone must row it each way; both guards and prisoners can row. If, on either bank (or in the boat), the prisoners ever outnumber the guards present, the prisoners overpower them. A bank with prisoners and no guards is fine.

What is the fewest number of one-way crossings needed to get everyone across safely? Give the sequence.

(This is the old missionaries-and-cannibals puzzle in a different costume.)

Show a hint

Count crossings, not round trips, and remember the boat must come back with at least one person in it. Start by sending two prisoners over.

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

Three jealous couples and a two-seat boatWolf, goat, and cabbage river crossingFour jealous couples cannot cross with a two-seat boatSplit eight litres in half with a 5 and a 3The airplane on a treadmill
All questions →