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?
Key: west-(<< or >>)boat with direction-east
(-=beach/shoreline)
start mmmccc--
mmcc->mc>- m drops off c
mmcc-<m<-c then returns to pick up new c
mmc->mc>c c picked up/to east side
mmc-<m<-cc then returns to pick up an m
mc->mm>-cc
mc-<mc<-mc dorps off m/picks up c
cc->mm>-mc m^2 go east
cc-<m<-mmc
c->mc>-mmc
c-<m<-mmcc
->mc>-mmcc
--mmmccc
This solution only works assuming that the shore (or side) and the boat(at said shore) are considered as seperate locations. Also, shore to boat transfers are instantaneous.