A man is traveling with a fox and two chickens. If he leaves the fox alone with the chickens, the fox will eat the chickens. He comes to a river and needs to cross it. He finds a small boat that can carry only him and one animal. How does he get himself, the fox and two chickens across the river safely?
Answer
Take the fox over, return with nothing. Go over with one chicken, return with the fox. Go over with the second chicken, return with nothing. Finally, take the fox over.
Or let:
Man = M
Fox = F
Chicken1 = C1
Chicken2 = C2
This is how they cross the river:
- M,F →
- ← M
- M,C1 →
- ← M,F
- M,C2 →
- ← M
- M,F →