You are a farmer trying to take your chicken, your fox, and your bag of grain across the river. You have a boat that will carry the farmer and one of the other three things. Basically, you can only take yourself and one other thing at a time. But, if you leave the grain with the chicken, the chicken will eat the grain. If you leave the fox with the chicken, the fox will eat it. How do you get everything safely to the other side?
Oooo___MMM MMM _(a bad drawing of the farmer and the river)
Take the chicken, go back and take the grain, bring the grain to the other side while taking the chicken back, put the chicken down and bring the fox back, go back and bring the chicken. There.
1. Take chicken across river to Side 2. 2. Come back and take the grain across the river to Side 2, then get the chicken from Side 2. 3. Bring chicken back to Side 1 and take the fox across to Side 2. 4. Go back to Side 1, get chicken, bring chicken back to Side 2. Orr..... 1. Shell out and stop being such a cheapskate. Buy a ferry instead of a little skiff.
Easy, feed the fox to the chicken. The chicken will be full and cannot eat the grain, and the fox cannot eat the chicken because the chicken ate the fox! Problem solved.
Take the chicken across first, the go back and take the wolf, substitue the wolf on the other side for the chicken, the bring the chicken back, and substitute that for the grain, then bring the grain to the wolf's side, then go back for the chicken.
The real question is, wouldn't the wolf eat the chicken, who ate the grain once you get them all to the other side?