# 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) | a b c | ||

1 | b c | a → | |

2 | b c | ← | a |

3 | bc → | a | |

4 | ← a | b c | |

5 | a | → | b c |

6 | a | ← b | c |

7 | a b | → | c |

8 | a b | ← c | |

9 | b | a c → | |

10 | b | ← | a c |

11 | b → | a c | |

(finish) | a b c |

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) | a b c | ||

1 | b c | a → | |

2 | b c | ← a | |

3 | c | ab → | |

4 | c | ← b | a |

5 | c | b → | a |

6 | c | ← b | a |

7 | bc → | a | |

8 | ← c | a b | |

9 | c → | a b | |

(finish) | a b c |

### Your Answer

## More puzzles to try-

### Three Lives

He has three lives, Gentle, enough to soothe the skin, Light, enough to care the sky, Hard enough to crack ...Read More »### How much higher would the nail be?

When James was nine years old he hammered a nail into a tree to mark his height. Ten years later, ...Read More »### 98 dollar riddle

A man phoned his son to buy a few things he needed for a trip. He told him he would ...Read More »### What color was the bear?

I left my campsite and hiked south for 3 miles. Turned east and hiked for 3 miles. Then turned north ...Read More »### Add 5 to 9 and get 2?

I add 5 to 9 and get 2. The answer is correct, so what am I?Read More »### Fariha’s Game

Fariha invented a game! In that game, Fariha kept 5 plates on a circular dining table! The plates were marked ...Read More »### In a fair

As I was going to the fair, I saw a man with golden hair. He had 3 sons each with ...Read More »### Magic Algebra Fun

You are given with the following sum. Each of the letters can be decoded as a digit. If we tell ...Read More »### Remove or fill

I am white, and used for cutting and grinding. When I am damaged, humans usually remove me or fill me. ...Read More »### How did he get out?

If a man is trapped in a room. There are no doors no windows how did he get out?Read More »### Triangles in a Triangle Puzzle

Can you count the number of triangles inside a triangle?Read More »### Man in car riddle

A man is in his car. He sees three doors; a golden one, a diamond one and a silver one. ...Read More »### Can’t Buy or Sell

What is greater than gold but cannot be bought. it can never be sold and can earn if its sought. ...Read More »### Fall to the ground

There is a grandad, a dad and 2 sons. They all go hunting and they all shoot a bird each ...Read More »### Unwlcome guest riddle

Without being called, we came out at night. Without being stolen, we get lost in the day. Who are we?Read More »### Find 4 hidden words in the picture Puzzle

Find 4 hidden words in the picture PuzzleRead More »### Complete the name

A mother had five boys Monarch, Tushar, Webnar and Thomson. What would be the fifth boys name out of below ...Read More »### Have to keep

Even if you give this to someone else, you still get to keep it. What is it?Read More »### Count the Triangles

How many triangles can you find in this given picture?Read More »### NDA Exam-II 2012- Which number replaces the question mark in the square?