Three Wives & Their Jealous Husbands
Three jealous husbands with their wives, having to cross a river, find a boat without a boatman. But the boat is so small that it can contain no more than two of them at a time.
How can these six persons cross the river so that none of the women shall be left in the company of any of the men unless her husband is present?
(Women to row when absolutely necessary to prevent a violation of the above conditions).
Let the three husbands be A,B and C and their wives a,b and c respectively. The following moves are typical of a minimum solution with men rowing where possible.
Left Bank | Crossing | Right Bank |
ABCabc | – | – |
ACac | Bb ® | – |
ACac | ¬ B | b |
ABC | ac ® | b |
ABC | ¬ a | bc |
Aa | BC ® | bc |
Aa | ¬ Bb | Cc |
ab | AB ® | Cc |
ab | ¬ c | ABC |
b | ac ® | ABC |
b | ¬ B | ACac |
– | Bb® | ACac |
– | – | ABCabc |
Note that only a, B, and c need be able to row.
The missionaries and cannibals problem, and the closely related jealous husbands problem, are classic river-crossing problems
The missionaries and cannibals problem is a well-known toy problem in artificial intelligence
Source of solution – WIKIPEDIA
Solving-
Amarel devised a system for solving the Missionaries and Cannibals problem whereby the current state is represented by a simple vector <a,b,c>. The vector’s elements represent the number of missionaries on the wrong side, the number of cannibals on the wrong side, and the number of boats on the wrong side, respectively. Since the boat and all of the missionaries and cannibals start on the wrong side, the vector is initialized to <3,3,1>. Actions are represented using vector subtraction/addition to manipulate the state vector. For instance, if a lone cannibal crossed the river, the vector <0,1,1> would be subtracted from the state to yield <3,2,0>. The state would reflect that there are still three missionaries and two cannibals on the wrong side, and that the boat is now on the opposite bank. To fully solve the problem, a simple tree is formed with the initial state as the root. The five possible actions (<1,0,1>, <2,0,1>, <0,1,1>, <0,2,1>, and <1,1,1>) are then subtracted from the initial state, with the result forming children nodes of the root. Any node that has more cannibals than missionaries on either bank is in an invalid state, and is therefore removed from further consideration. The valid children nodes generated would be <3,2,0>, <3,1,0>, and <2,2,0>. For each of these remaining nodes, children nodes are generated by adding each of the possible action vectors. The algorithm continues alternating subtraction and addition for each level of the tree until a node is generated with the vector <0,0,0> as its value. This is the goal state, and the path from the root of the tree to this node represents a sequence of actions that solves the problem.
SOLUTION–
The earliest solution known to the jealous husbands problem, using 11 one-way trips, is as follows. The married couples are represented as (male) and a (female),
and b, and
and c.
Trip number | Starting bank | Travel | Ending bank |
---|---|---|---|
(start) | ![]() ![]() ![]() |
||
1 | ![]() ![]() |
![]() |
|
2 | ![]() ![]() |
←![]() |
a |
3 | ![]() ![]() ![]() |
bc → | a |
4 | ![]() ![]() ![]() |
← a | b c |
5 | ![]() |
![]() ![]() |
b c |
6 | ![]() |
← ![]() |
![]() |
7 | a b | ![]() ![]() |
![]() |
8 | a b | ← c | ![]() ![]() ![]() |
9 | b | a c → | ![]() ![]() ![]() |
10 | b | ← ![]() |
![]() ![]() |
11 | ![]() |
![]() ![]() |
|
(finish) | ![]() ![]() ![]() |
This is a shortest solution to the problem, but is not the only shortest solution
If however, only one man can get out of the boat at a time and husbands must be on the shore to count as with his wife as opposed to just being in the boat at the shore: move 5 to 6 is impossible, for as soon as has stepped out b on the shore won’t be with her husband, despite him being just in the boat.
As mentioned previously, this solution to the jealous husbands problem will become a solution to the missionaries and cannibals problem upon replacing men by missionaries and women by cannibals. In this case we may neglect the individual identities of the missionaries and cannibals. The solution just given is still shortest, and is one of four shortest solutions.
If a woman in the boat at the shore (but not on the shore) counts as being by herself (i.e. not in the presence of any men on the shore), then this puzzle can be solved in 9 one-way trips:
Trip number | Starting bank | Travel | Ending bank |
---|---|---|---|
(start) | ![]() ![]() ![]() |
||
1 | ![]() ![]() |
![]() |
|
2 | ![]() ![]() |
← a | ![]() |
3 | ![]() ![]() |
ab → | ![]() |
4 | ![]() ![]() |
← b | ![]() |
5 | ![]() |
![]() |
![]() |
6 | ![]() |
← b | ![]() ![]() |
7 | ![]() |
bc → | ![]() ![]() |
8 | ![]() |
← c | ![]() ![]() |
9 | ![]() |
![]() ![]() |
|
(finish) | ![]() ![]() ![]() |
Your Answer
More puzzles to try-
Funny vibration
What is at least 6 inches long, goes in your mouth, and is more fun if it vibrates?Read More »What Comes Next in Letters?
What are the next 3 letters in the following sequence? J, F, M, A, M, J, J, A, __, __, ...Read More »What animal should he sell?
A farmer has a ton of strange animals, but he has to sell one of them. He has a pig ...Read More »Find the initial amount
Nine persons in a party, A, B, C, D, E, F, G, H, K, did as follows: First A gave each ...Read More »Poisoned wine
You have 240 barrels of wine, one of which has been poisoned. After drinking the poisoned wine, one dies within ...Read More »Who Reach The Destination First
John and Jacob are planning on a vacation. John says, “It will be better if we take the train to ...Read More »Grandson about as many days as son is weeks riddle
My grandson is about as many days as my son is weeks, and my grandson is as many months as ...Read More »Doctor without Doctor
There was a minor accident with a doctor’s son but the doctor noticed no major injury. After the treatment, the ...Read More »Which is the Top View Puzzle
Find out which of the given views in the picture is the top view of the given pyramid.Read More »Long hand of clock
How many times does the long hand of the clock pass the short hand between midnight one day and midnight ...Read More »Calculate the time
We all know that the hour hand and the minute hand on a clock travel at different speeds. However there ...Read More »smell when coloured
If I am coloured, I smell, if I am burned, I smell, orange and yellow will melt me. What am ...Read More »Two men are facing each other and clock on the wall puzzle
Two men are facing each other alone in a large room. There is a clock on the wall. One man, ...Read More »What number is X?
What number is X? 16 06 68 88 X 98Read More »What is Jennie’s Age
Gracie went for a morning walk and met her old friend Suzie and her daughter Jennie after a long time. ...Read More »NDA Exam-II 2013 – Which number fits at the question mark?
Which number fits at the question mark?Read More »What is seen in the picture which made husband KILL her beautiful wife?
What is seen by the husband in the picture that made him MURDER his wife?Read More »Find the age
John has three sons and his friend Jacob wants to know their ages. John gives him three hints as Jacob ...Read More »Spot the Difference
By focusing closely on the smallest details—shapes, colours, and textures-could you spot the 3 differences between these Car Manufacturing images?Read More »The Bicycle
Why did the bicycle fall over?Read More »