Archive | Brain Teasers – Solution RSS feed for this section

Missionaries and Cannibals Puzzle — Solution

16 Jan

As I’ve mentioned in the problem statement, this problem is quite hard for humans and might be very easy for a machine to solve (with the right formalization of course). The reason is that this problem can contain infinitely many repeated states. If we don’t keep track of states we have been in, we could easily end up going in rounds with the same man in the boat for infinity. Thus, we have to keep track of states we have been in, and do not repeat them, since getting back to them, means that all the “progress” we made has put us back, and therefore was useless.

Another thing to pay attention is that it really doesn’t matter which one of the missionaries will we get into the boat first/second or third. This is also true regarding the cannibals. In fact this small note saves us a lot of states space, making this problem very simple indeed, when treated properly.

Therefore, if you still want to try solve it, try drawing all possible situations while not distinguishing any importance given to the order between different missionaries and cannibals, and keeping track of repeated states as well.

Solution:

MMMCCC  |   |

Missioner and a Cannibal go, Missioner comes back

MMMCC  |   |  MC      MMMCC  |   |  C

Two Cannibals go, one comes back

MMM  |   |  CCC    MMMC |   |  CC

Two missioners go, Missioner and a Cannibal come back

MC  |   |  CCMM     MMCC  |   |  CM

Two missioners go, the cannibal brings the boat back

CC  |   |  CMMM    CCC  |   |  MMM

Now all the cannibals can get to the other shore easily one by one: two go, one comes back.

Getting 1/3 probability by tossing coins — Solution

15 Jan

Problem:

How can we choose one out of 3 christmass presents with equal probabability?  Or in other words how to obtain 1/3 probability by using one unbiased coin ?

Solution:

1. The coin is UNbiased: toss the coin twice. Let TH, HT and HH correspond to each of the presents. In case of HH – repeat from the beginning.

2. The coin is biased, then we notice that TH and HT would occur with equal probability but this will only give us 2 possible outcomes with equal probability and we need 3.  Then we would have to use 4 tosses which will give us 16 possible combinations. The question is which ones we should choose to represent the presents (or outcomes). The only condition is that the number of H and T should be the same to ensure equal probability for each outcome and thus selecting each present with the same probability. One option would be to assign HTHT, THTH and HTTH to the three choices, with other  13 possible 4-toss outcomes being rejected.

Discussion:

So the obvious problem is that we need some way to extrapolate tosses of a single coin to (possibly) arbitrary number of outcomes with equal probability to obtain each outcome.  So obviously we will need several tosses to match the number of outcomes we need. However we need to pay careful attention to the fact that the toss sequences we are using have the same combined probability such as HHTT and HTHT