A farmer needs to cross a river with a fox, a chicken, and a bag of grain.
The boat can only hold the farmer and one item at a time.
If left alone, the fox will eat the chicken, and the chicken will eat the grain.
How does the farmer get everything across safely?
Solution:
-
The farmer takes the chicken across the river first.
- Now the fox and the grain are left on the starting side.
-
The farmer goes back alone to the starting side.
-
The farmer takes the fox across the river next.
- The farmer does not leave the fox with the chicken on the far side. Instead, he brings the chicken back to the starting side.
-
The farmer leaves the chicken on the starting side and takes the grain across the river.
- Now the fox and the grain are on the far side, and the chicken is on the starting side.
-
The farmer goes back alone to the starting side.
-
The farmer takes the chicken across the river one last time.
- Now the chicken, the fox, and the grain are all safely across the river.