A farmer is standing on one bank of a river, with a fox, a chicken, and a bag of grain.
He needs to get to the other side of the river, taking the fox, the chicken, and the grain with him.
However, the boat used to cross the river is only large enough to carry the farmer and one of the things he needs to take with him, so he will need to make several trips in order to get everything across.
In addition, he cannot leave the fox unattended with the chicken, or else the fox will eat the chicken; and he cannot leave the chicken unattended with the grain, or else the chicken will eat the grain.
The fox is not particularly partial to grain and may be left alone with it.
How can the farmer get everything across the river without anything being eaten?
1. The farmer takes the chicken across first, leaving the fox and grain together on the other side.
2. He returns and gets the fox, but when he deposits the fox on the other side, he takes the chicken back across, so that the fox and chicken are not left alone together.
3.He drops the chicken off, picks up the grain, and takes it across to deposit with the fox.
4. Finally, he returns to retrieve the chicken and takes it to the other side. At no time are the fox and chicken left alone together, nor are the chicken and grain. 🙂