This week's book giveaway is in the Testing forum.We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line!See this thread for details.
Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!

# River Crossing: Bear, Goat, Cabbage, and You

Mark Herschberg
Sheriff
Posts: 6037
This is an easy question.
You are traveling with your pet bear, pet goat, and pet cabbage (they make great pets--no mess!). You come to a river with a row boat. Only you can row the boat, and the boat is only big enough for one other item: the (small) bear, regular sized goat, and oversized cabbage. How do you get everything across the river?
The catch (there's always a catch) is that if you're not around (e.g. on the other side of the river) the goat will eat the cabbage. Likewise, if you leave the bear and goat unattended, the bear will eat the goat (studies show bears eat goats when stranded on riverbanks). How do you get them all across?
--Mark

Greg Harris
Ranch Hand
Posts: 1012
1. take goat
2. take cabbage, bring goat back
3. leave goat, take bear
4. take goat (again)

Vivek Kumar
Greenhorn
Posts: 9

Jenn Jenn
Greenhorn
Posts: 1
This is alot like the problem i had to do in a math class a few years back, only it was with a fox, goose, and bucket of grain and the guy could only take 3 trips.It went like this, take the fox, go back, get the grain, go back and let the goose swim. But with this one it would probably be take the bear, the cabbage, then the goat.

Sonny Pondrom
Ranch Hand
Posts: 128
I think you forgot something. When you take the fox, the goose eats all the grain.

You have to start with the middle creature, in this case the goose.
[ January 07, 2005: Message edited by: Sonny Pondrom ]