He takes the goat first, leaves it on the other side, picks up the wolf, leaves the wolf on the other side but takes the goat back, goes back and swaps the goat with the cabbage, leaves the cabbage on the other side, goes back to pick up the goat, and finally brings the goat to the other side.
Work Step by Step
For the first trip, the farmer can only take the goat because if he takes the cabbage, the wolf will eat the goat, and if he takes the wolf, the goat will eat the cabbage. After he drops off the goat, he can pick either the wolf or the cabbage. The key to this exercise is that he leaves whatever he takes on the second trip on the other side, but he takes the goat back with him. Then, he goes back to whatever is left on the other side and leaves the goat there while taking it to the other side. (Again, the wolf and the cabbage are interchangeable, for both can be with each other and neither can spend time with the goat unsupervised.) Finally, after leaving the wolf and the cabbage on the other side, he goes back to pick up the goat, and then he finally takes it to the other side, at which point all 3 have crossed the stream safely.