Sep 6, 2012

Missionaries and cannibals. Solution explained.


Despite the common advice that the name of a blog should explicitly reveal what the blog is about (i.e. if it’s a blog for puzzles, its title should include the word “puzzle”), I chose to name mine “Monks and Cannibals” for several reasons. Most importantly, it is named after the puzzle that initially got me interested in the field. The puzzle is originally called “Missionaries and Cannibals,” but I changed the first word for aesthetic and marketing purposes. The shorter the prettier and easier to remember. 


So here’s the setup. Pretend that the lime circles are the missionaries and the orange ones are the cannibals. They are all standing on one side of the river and are trying to cross to the other side. On the river floats a boat with a maximum capacity of two people. It’s about lunchtime and the cannibals are getting hungry, but they can eat the missionaries only when there are fewer missionaries than cannibals on the side of the river where they are standing. Your task is to transport all six of them across the river without letting the cannibals eat any of the missionaries. The only means of transportation is the boat—no one can swim or walk on the water. Lastly, the boat cannot move on its own. Someone has to bring it back and forth.

In fact, my first encounter with this puzzle was through a flash game. You can check out the game here. The missionary in the middle is my favorite.

The process of solving this puzzle is extremely simple and logical, which is why I like it so much. You only need to keep one thing in mind—in every step, think about all possible options and eliminate the ones that turn out to be impossible. In each step, there is usually only one possible next step. Let’s take a look at the initial setup again.

From now on, the invisible boat will be represented as brackets. [Missionary], [Cannibal], [Missionary, Missionary], [Missionary, Cannibal], and [Cannibal, Cannibal] are the only possible combinations of people who can board the boat. We will find out which ones of these options will lead to gory outcomes and exclude them from our list.
 
[Missionary]: If just one missionary crosses the river, there will be two missionaries and three cannibals left on the right side. Sounds like nom nom time.

[Cannibal]: This option doesn’t lead to deaths, but it’s meaningless. After the cannibal crosses the river alone, s/he will have to come back to where s/he was (someone would have to bring back the boat). Why waste a step?

[Missionary, Missionary]: One missionary and three cannibals on the right side. It’s gonna be a bloodbath.

[Missionary, Cannibal]: So far, this is the only safe choice.

[Cannibal, Cannibal]: This one is okay, too.

We have two choices: [Missionary, Cannibal] and [Cannibal, Cannibal]. Let’s consider both in that order.

Option 1: [Missionary, Cannibal]


 
We will repeat the same process to see what we can do at this stage. Here, the people who can board the boat are [Missionary], [Cannibal], and [Missionary, Cannibal].

[Missionary]: This works.

[Cannibal]: Adding an additional cannibal to the right side of the river would mean the deaths of the two missionaries who are already there. So no.

[Missionary, Cannibal]: Safe but meaningless. No reason to go back to the original setup.

One missionary it is. Move the lime circle to the right side of the river and we have:


 

Option 2: [Cannibal, Cannibal]

Not much thinking is needed at this stage. It’s inefficient to move both cannibals back to the other side of the river, because that would bring us back to the previous step. The only choice that makes sense is to take one of the cannibals back.


 
As you may have noticed, regardless of whether you pick Option 1 or Option 2, you end up with the same result. So what now? The potential passengers who can cross to the left include and are restricted to: [Missionary], [Cannibal], [Missionary, Missionary], [Missionary, Cannibal], and [Cannibal, Cannibal].

[Missionary]: This would just bring us back to the situation in Option 1 above. No need to repeat the step.

[Cannibal]: This one would bring us back to the situation in Option 2.

[Missionary, Missionary]: No. The only missionary left on the right side would be lonely. And will probably die.

[Missionary, Cannibal]: No. Once that missionary crosses the river, s/he would have to face two hungry cannibals.

[Cannibal, Cannibal]: This one looks good.


Here, the only rational thing we can do is move back one of the cannibals. Moving two cannibals would mean reversing the step, which is pointless.


 
[Missionary], [Cannibal], [Missionary, Missionary], [Missionary, Cannibal]. Which one of these could work?

[Missionary]: No. S/he would be eaten as soon as s/he crosses the river. Two cannibals are waiting on the other side.

[Cannibal]: We just moved the cannibal from the left side of the river. It would be pointless to take him/her back.

[Missionary, Missionary]: This works.

[Missionary, Cannibal]: No. That missionary would die.

So far there has been only one possible choice for each step, except when there were two. This will be the case throughout the rest of the solution, at least for the most part.


Same old procedure. Who can cross? [Missionary], [Cannibal], [Missionary, Missionary], [Missionary, Cannibal], [Cannibal, Cannibal].

[Missionary]: The missionary on the left side dies.

[Cannibal]: The missionary on the right side dies.

[Missionary, Missionary]: Step reversal is always pointless.

[Missionary, Cannibal]: Works.

[Cannibal, Cannibal]: The missionary on the right dies.



Is it just me, or are the circles starting to look like cooked and uncooked peas?

[Missionary]: The one on the right would get eaten.

[Cannibal]: The one on the left would get eaten.

[Missionary, Missionary]: Works.

[Missionary, Cannibal]: Repetitive and pointless.

[Cannibal, Cannibal]: The one on the left would get eaten.

[Missionary]: And send him/her off to death, all alone? That’s the most cruel way to lose this game.

[Cannibal]: Works.

[Missionary, Missionary]: Repetitive and pointless.

[Missionary, Cannibal]: Again, this is just cruel.


 Finally a clean division! The only thing we can do at this point is move two cannibals to the left.


Although the rest of the explanation should be obvious now, as someone who enjoys writing unnecessarily lengthy posts, I will continue with what we have been doing so far. But since writing can sometimes be as tiring as reading, the descriptions will get noticeably shorter.

[Missionary]: This works.

[Cannibal]: Works as well.

[Missionary, Missionary]: The one that’s left on the left side would die.

[Missionary, Cannibal]: Don’t be so evil.

[Cannibal, Cannibal]: Pointless.

There are two things we can do: move one of the missionaries, or move one of the cannibals.

Option 1: [Missionary]



Technically there are more than one thing we can do, but why don’t we just finish the game. Transport the two people on the right side of the river, and that’s how it all ends.


Option 2: [Cannibal]


Again, just transport whoever is on the right side of the river to the left.

 
The end. Look how happy they are now!

No comments:

Post a Comment