Solved

puzzle questions

Posted on 2008-09-29
9
563 Views
Last Modified: 2012-05-05
A man (M), wolf (W), goat (G) and cabbage (C) are on the left bank of a river. There is a boat large enough to carry
the man and only one of the other three. The man wishes to ferry everyone to the right river bank, and the man can
ferry each across, one at a time.
However, if the man leaves the wolf and goat unattended on either shore, the goat is history. Similarly the goat and
cabbage cannot be left unattended by the man.

How can the man bring all those animals to the other river bank safely using the shortest way possible?
0
Comment
Question by:kuntilanak
9 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22602566
Hello kuntilanak,

man take goat
comes back
takes wolf
brings goat back
take cabbage
comes back
takes goat

Regards,

sunnycoder
0
 

Author Comment

by:kuntilanak
ID: 22602587
hey it's you again, thanks for helping since you're quite familiar with dfa/nfa.. I want to practice and put this into a transition diagram.

The start state is labeled MWGC | 0

0 = empty set

and input set will be soemthing like:

g (rows across with the goat), c (rows accross with the cabbage)

example when given an input gm

MWGC|0 -> WC|MG -> MWC|G

Any hints?

0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 22602600
>example when given an input gm
>MWGC|0 -> WC|MG -> MWC|G
>Any hints?
You drew first three states correctly ... translate rest of the steps into your state diagram
0
 
LVL 84

Expert Comment

by:ozo
ID: 22602609
MWGC|0 -> WC|MG -> MWC|G -> W|MCG -> MW|MGC -> 0|MWCG
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 45

Accepted Solution

by:
sunnycoder earned 500 total points
ID: 22602633
>MW|MGC
Thats does not look correct ... man cant be in two places at one time

MWGC|0 -> WC|MG -> MWC|G -> C|MWG -> MGC|W -> G|MWC -> MG|WC -> 0|MWGC
0
 

Author Comment

by:kuntilanak
ID: 22602638
so there's 6 states in this problem, and I just draw 6 circles with arrows connecting to each (input) other?
0
 

Author Comment

by:kuntilanak
ID: 22602642
oh and I just realized that ozo's solution has a shorter path :)
0
 
LVL 19

Expert Comment

by:Rob Hutchinson
ID: 22606239
Actually, there is an easier solution. Just use a tranquilizer gun on both the goat and the wolf, then take them over one at a time...faster too.
0
 

Author Comment

by:kuntilanak
ID: 22606281
haha..yea, that's a killers solution.. oh and if I were asked to draw a transition diagram of this situation.. what would it be like?
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A Guide to the PMT, FV, IPMT and PPMT Functions In MS Excel we have the PMT, FV, IPMT and PPMT functions, which do a fantastic job for interest rate calculations.  But what if you don't have Excel ? This article is for programmers looking to re…
Lithium-ion batteries area cornerstone of today's portable electronic devices, and even though they are relied upon heavily, their chemistry and origin are not of common knowledge. This article is about a device on which every smartphone, laptop, an…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now