Friday 16 August 2013

River crossing

Question: Three cannibals and three anthropologists have to cross a river. The boat they have is only big enough for two people. If at any point in time there are more cannibals on one side of the river than anthropologists, the cannibals will eat them. What plan can the anthropologists use for crossing the river so they don’t get eaten? (remember! the boat can’t cross the river by itself, someone has to be in it to row it across)
Note that if a boat with a cannibal and an anthropologist travels to a shore with one cannibal on it, then no. of cannibals > no. of anthropologists, even if you say the anthropologist immediately takes the boat back.
Answer:
Let
A = Anthropologist
C = Cannibal
B = the boat
W = the west shore (which they are all on)
and E = the east shore (where they want to go)Step 1 : A and C crosses
W [A, A, C, C]
E [A, C, B]Step 2 : A returns
W [A, A, A, C, C, B]
E [C]Step 3 : Two C crosses
W [A, A, A]
E [C, C, C, B]Step 4 : C returns
W [A, A, A, C, B]
E [C, C]Step 5 : Two A crosses
W [A, C]
E [A, A, C, C, B]Step 6 : A and C returns
W [A, A, C, C, B]
E [A, C]Step 7 : Two A crosses
W [C, C]
E [A, A, A, C, B]Step 8 : C returns
W [C, C, C, B]
E [A, A, A]Step 9 : Two C crosses
W [C]
E [A, A, A, C, C, B] 
Step 10 : C returns
W [C, C, B]
E [A, A, A, C]
Step 11 : Two C crosses
W [Empty]
E [A, A, A, C, C, C, B]

No comments:

Post a Comment