9. Consider the following, called the jealous husband problem: Three married couples find themselves on one bank
Question:
9. Consider the following, called the jealous husband problem:
Three married couples find themselves on one bank of a river wanting to get to the other side using a boat that can only hold two people at a time.
However, each husband insists on being with his wife whenever there are other men present.
The shortest solution involves eleven boat crossings, too many to solve comfortably using the reachable predicate. Use reachable_uniq from exercise 8 to solve it. (Not to take this example too seriously or anything, but we might prefer a solution where the jealous husbands all end up on one side of the river without a boat, and the women have all gone off to find better husbands!)
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Question Posted: