# Missionaries and cannibals problem

Missionaries and cannibals problem

The missionaries and cannibals problem, and the closely related jealous husbands problem, are classic river-crossing problems.[1] The missionaries and cannibals problem is a well-known toy problem in artificial intelligence, where it was used by Saul Amarel as an example of problem representation.[2][3]

## The problem

In the missionaries and cannibals problem, three missionaries and three cannibals must cross a river using a boat which can carry at most two people, under the constraint that, for both banks, if there are missionaries present on the bank, they cannot be outnumbered by cannibals (if they were, the cannibals would eat the missionaries.) The boat cannot cross the river by itself with no people on board.[1]

In the jealous husbands problem, the missionaries and cannibals become three married couples, with the constraint that no woman can be in the presence of another man unless her husband is also present. Under this constraint, there cannot be both women and men present on a bank with women outnumbering men, since if there were, some woman would be husbandless. Therefore, upon changing women to cannibals and men to missionaries, any solution to the jealous husbands problem will also become a solution to the missionaries and cannibals problem.[1]

## 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.[4], p. 291.

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.[4], p. 291.

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.[5]

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

## Variations

An obvious generalization is to vary the number of jealous couples (or missionaries and cannibals), the capacity of the boat, or both. If the boat holds 2 people, then 2 couples require 5 trips; with 4 or more couples, the problem has no solution.[6] If the boat can hold 3 people, then up to 5 couples can cross; if the boat can hold 4 people, any number of couples can cross.[4], p. 300.

If an island is added in the middle of the river, then any number of couples can cross using a two-person boat. If crossings from bank to bank are not allowed, then 8n−6 one-way trips are required to ferry n couples across the river;[1], p. 76 if they are allowed, then 4n+1 trips are required if n exceeds 4, although a minimal solution requires only 16 trips if n equals 4.[1], p. 79. If the jealous couples are replaced by missionaries and cannibals, the number of trips required does not change if crossings from bank to bank are not allowed; if they are however the number of trips decreases to 4n−1, assuming that n is at least 3.[1], p. 81.

## History

The first known appearance of the jealous husbands problem is in the medieval text Propositiones ad Acuendos Juvenes, usually attributed to Alcuin (died 804.) In Alcuin's formulation the couples are brothers and sisters, but the constraint is still the same—no woman can be in the company of another man unless her brother is present.[1], p. 74. From the 13th to the 15th century, the problem became known throughout Northern Europe, with the couples now being husbands and wives.[4], pp. 291–293. The problem was later put in the form of masters and valets; the formulation with missionaries and cannibals did not appear until the end of the 19th century.[1], p. 81 Varying the number of couples and the size of the boat was considered at the beginning of the 16th century.[4], p. 296. Cadet de Fontenay considered placing an island in the middle of the river in 1879; this variant of the problem, with a two-person boat, was completely solved by Ian Pressman and David Singmaster in 1989.[1]

## References

1. ^ a b c d e f g h i "The Jealous Husbands" and "The Missionaries and Cannibals", Ian Pressman and David Singmaster, The Mathematical Gazette, 73, #464 (June 1989), pp. 73–81.
2. ^ On representations of problems of reasoning about actions, Saul Amarel, pp. 131–171, Machine Intelligence 3, edited by Donald Michie, Amsterdam, London, New York: Elsevier/North-Holland, 1968.
3. ^ p. 9, Searching in a Maze, in Search of Knowledge: Issues in Early Artificial Intelligence, Roberto Cordeschi, pp. 1–23, Reasoning, Action andj Interaction in AI Theories and Systems: essays dedicated to Luigia Carlucci Aiello, edited by Oliviero Stock and Marco Schaerf, Lecture Notes in Computer Science #4155, Berlin/Heidelberg: Springer, 2006, ISBN 978-3-540-37901-0.
4. ^ a b c d e Jealous Husbands Crossing the River: A Problem from Alcuin to Tartaglia, Raffaella Franci, pp. 289–306, From China to Paris: 2000 Years Transmission of Mathematical Ideas, edited by Yvonne Dold-Samplonius, Joseph W. Dauben, Menso Folkerts, and Benno van Dalen, Stuttgart: Franz Steiner Verlag, 2002, ISBN 3515082239.
5. ^ Cannibals and missionaries, Ruby Lim, pp. 135–142, Conference proceedings: APL '92, the International Conference on APL, 6–10 July 1992, St. Petersburg, Russia, edited by Lynne C. Shaw, et al., New York: Association for Computing Machinery, 1992, ISBN 0-89791-477-5.
6. ^ Tricky Crossings, Ivars Peterson, Science News, 164, #24 (December 13, 2003); accessed on line February 7, 2008, URL update March 12, 2011

Wikimedia Foundation. 2010.

### Look at other dictionaries:

• Fox, goose and bag of beans puzzle — The fox, goose and bag of beans puzzle is a river crossing puzzle. It dates back to at least the 9th century, [p. 74, [http://links.jstor.org/sici?sici=0025 5572%28198906%292%3A73%3A464%3C73%3A%22JHA%22M%3E2.0.CO%3B2 S The Jealous Husbands and… …   Wikipedia

• Circumscription (logic) — Not to be confused with circumscribe. Circumscription is a non monotonic logic created by John McCarthy to formalize the common sense assumption that things are as expected unless otherwise specified. Circumscription was later used by McCarthy in …   Wikipedia

• River crossing puzzle — A river crossing puzzle is a type of transport puzzle in which the object is to carry items from one river bank to another. The difficulty of the puzzle may arise from restrictions on which or how many items can be transported at the same time,… …   Wikipedia

• God's algorithm — is a notion originating in discussions of ways to solve the Rubik s Cube puzzle, but which can also be applied to other combinatorial puzzles and mathematical games. It stands for any practical algorithm that produces a solution having the least… …   Wikipedia

• Characters from the Incarnations of Immortality — This article contains brief biographies for major characters from Piers Anthony s Incarnations of Immortality series. The protagonist of each book in the series, as well as some other major characters, are listed here.The IncarnationsZane On a… …   Wikipedia

• River IQ Test — The River IQ Test (aka River IQ Game) is a mental puzzle. The name originates as it supposedly is given as an IQ test to job applicants in China. The puzzle is in Chinese, but can be completed with ease once the rules have been translated. The… …   Wikipedia

• Acertijo del lobo, la cabra y la col — El acertijo del lobo, la cabra y la col es un popular juego de lógica. Se sabe que existe al menos desde el siglo IX[1] y que forma parte del folclore de un gran número de grupos étnicos.[2] Contenido 1 El acertijo …   Wikipedia Español

• Timeline of Christian missions — This timeline of Christian missions chronicles the global expansion of Christianity through a sampling of missionary outreach events. A more general timeline of Christianity and History of Christianity is also available. Apostolic Age Earliest… …   Wikipedia

• History of the Caribbean — The history of the Caribbean reveals the significant role the region played in the colonial struggles of the European powers since the fifteenth century. In the twentieth century the Caribbean was again important during World War II, in the… …   Wikipedia

• biblical literature — Introduction       four bodies of written works: the Old Testament writings according to the Hebrew canon; intertestamental works, including the Old Testament Apocrypha; the New Testament writings; and the New Testament Apocrypha.       The Old… …   Universalium