Tutorials, Free Online Tutorials,It Challengers provides tutorials and interview questions of all technology like java tutorial, android, java frameworks, javascript, core java, sql, php, c language etc. for beginners and professionals.

Breaking

6.The Wolf, the Goat and The Cabbage puzzle

Pervious                                                                   Next Page

The Wolf, the Goat, and the Cabbage


A man has a wolf, a goat, and a cabbage. He must cross a river with the two animals and the cabbage.
There is a small rowing boat, in which he can take only one thing with him at a time. If, however, the wolf and the goat are left alone, the wolf will eat the goat. If the goat and the cabbage are left alone, the goat will eat the cabbage.


The Question: How can the man get across the river with the two animals and the cabbage?


Solution:-
There are two solutions:

1.First, the man takes the goat across, leaving the wolf with the cabbage. Then he goes back. Next, he takes the wolf across. Then the man goes back, taking the goat with him. After this, he takes the cabbage across. Then he goes back again, leaving the wolf with the cabbage. Finally, he takes the goat across.

2.First, the man takes the goat across, leaving the wolf with the cabbage. Then he goes back. Next, he takes the cabbage across. Then the man goes back, taking the goat with him. After this, he takes the wolf across. Then he goes back again, leaving the wolf with the cabbage. Finally, he takes the goat across.

No comments:

Post a Comment