Solved

puzzle questions

Posted on 2008-09-29
9
568 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 84

Expert Comment

by:ozo
ID: 22602609
MWGC|0 -> WC|MG -> MWC|G -> W|MCG -> MW|MGC -> 0|MWCG
0
 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Probability Distribution 5 49
HP Deskjet 2132 3 156
Graph 5 75
Calculating bins of different widths using a summery plot in a Nspire CX Cas 2 15
Have you ever thought of installing a power system that generates solar electricity to power your house? Some may say yes, while others may tell me no. But have you noticed that people around you are now considering installing such systems in their …
This article seeks to propel the full implementation of geothermal power plants in Mexico as a renewable energy source.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 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