Three missionaries and three cannibals are on one side of the river, wanting to get across.
Unfortunately, the only boat available can hold a maximum of two people. The missionaries, wanting to stay safe, can never be on a side with more cannibals than missionaries (even for a moment!). The boat cannot travel under its own power, so there must be at least one person on board for it to cross.
How can the missionaries get safely across?
With // representing the river, one possible solution is:
mmmccc//
cc cross mmmc/cc/
c comes back mmmc/c/c
mmmcc//c
cc cross mmm/cc/c
c comes back mmm/c/cc
mmmc//cc
mm cross mc/mm/cc
mc come back mc/mc/mc
mmcc //mc
mm cross cc/mm/mc
c comes back cc/c/mmm
ccc//mmm
The cannibals may then cross in any order.
|
Posted by broll
on 2020-11-12 05:19:39 |