One one side of a river are three humans, one big monkey, two small monkeys, and one boat. Each of the humans and the big monkey are strong enough to row the boat. The boat can fit one or two bodies (regardless of size). If at any time at either side of the river the monkeys outnumber the humans the monkeys will eat the humans. How do you get everyone on the other side of the river alive?
Solution
让我们用 \(h: \text{human},\ b: \text{big monkey},\ s:\text{small monkey}\). 其中有一个限制条件就是:河的每边猴子数量不能超过人的数量
- Row b and s over ( hhhs / bs )
- Row b back ( hhhbs / s )
- Row b and s over ( hhh / bss )
- Row b back ( hhhb / ss )
- Row h and h over ( hb / hhss )
- Row h and s back ( hhbs / hs )
- Row h and b over ( hs / hhbs )
- Row h and s back ( hhss / hb )
- Row h and h over ( ss / hhhb )
- Row b back ( bss / hhh )
- Row b and s over ( s / hhhbs )
- Row b back ( bs / hhhs )
- Row b and s over ( / hhhbss )