Question title
Three people and three ghosts go outing together, through a river, there is only a small wooden boat on the river, the wooden boat has only two positions, each time can only carry two people or ghosts, if the number of people on both sides of the river is less than the number of ghosts, people will be mercilessly eaten by ghosts. Ask how to cross the river safely?
Problem resolution
Let’s start with a few key takeaways:
First, the ship has two positions, which translates to one person and one ghost, two people and two ghosts.
Second, if the ship goes to the other side to come back, it needs to be piloted by someone or a ghost. The ship will certainly not come back by itself, which is a hidden message.
Third, and most obvious, the number of people on either side of the ship at any one time must be greater than or equal to the number of ghosts.
Our strategy must begin with these three points.
All right, you guys must be itching to try it.
Let’s Go!
Across the river way
The first round
There were three ghosts on the other side of the river, but no one on the other side, because there was only one at a time.
As there is now an equal number of ghosts and men on this side of the river, it is necessary to ensure that one ghost is sent to the other boat, and the result is the same whether it is a ghost or a man. People or ghosts row back, leaving one ghost on the other side, then enter the state (3 people, 2 ghost -0 people, 1 ghost).
The second round
Is this round for the other side, or the ghost? We actually have five choices to cross each round: one person, one ghost, one person, one ghost, two people, two ghosts. Let’s think about it in this order:
If the ghost left by the first round comes back, the people on the other side of the river will be cold (2 ghosts, 3 ghosts -1 ghost, 0 ghosts), so people have to come back the same way, which is meaningless.
2. If a ghost goes to the other side and doesn’t come back by the same way, it can only bring the ghost with it. In this way, it is back to the starting point (3 people, 3 ghosts -0 people, 0 ghosts), which is meaningless.
3. One person a ghost to the other side, the other side of the people will be ghost poison (2 people 1 ghost -1 person 2 ghost), da baa ❌!
4. If two people crossed the river together, the brother left on this side of the river would have been killed.
5. When two ghosts go to the other side, one ghost must come back and enter the state of (3 ghosts, 1 ghost -0 ghosts, 2 ghosts).
So it looks like we have a lot of options, but in fact there is only one way to go: two ghosts to go, one ghost to come back, enter (3 people, 1 ghost -0 people, 2 ghosts) state.
In the third round
This time, let’s follow our 5 ways:
1. A man row to the opposite bank, pawn.
2. As in the second round, if one ghost goes past, if it doesn’t come back by itself, two ghosts can only come back together, which will be back to the state we ended in the first round, which is of no substance.
3. If one person and one ghost go past, those on the other side will get cold.
4. Two ghosts to the other side of the river, this round there is only one ghost, ghost is not enough
5. Two people to the other side, at this time (1 person, 1 ghost -2 people, 2 ghosts), have to row back, because this is a balance state, if not the original return, can only be one person and one ghost back, into (2 people, 2 ghosts -1 person, 1 ghost) state.
The fourth round of
In this case, the choice is pretty obvious, but let’s go with the same idea:
1. A person rowing past, that left on the side of the river friends cool.
2. If a ghost passes by, the other side will get cold.
3. A ghost past, at this time (1 person 1 person -2 people 2 ghosts), in the third round of the fifth point has appeared, a dead cycle.
4. When the two ghosts reached the other side, their friend on the other side got cold again.
5. Two people go to the opposite bank, at this time (0 people 2 ghost -3 people 1 ghost), at this time, only one ghost can punt back alone. So it’s going to be (0 ghosts 3 ghosts -3 ghosts 0).
The fifth round
Now look, steady ah! Two ghosts row to the other side, and then one ghost (0 ghosts, 2 ghosts -3 ghosts, 1 ghost). Finally, the two ghosts cross the river together.
Three people three ghosts, all successfully cross the river, and did not happen any bloody incident, the picture is very harmonious!
Train of thought to sort out
As you can see, in our thinking process, we intuitively follow a path to the end based on what is possible. If you find that you’ve gone all the way back to where you were before, or if it’s just a dead end, take a different path.
In fact, this deduction process is the logic of search. Three people, three ghosts, and we can go back to where we were, by memory, whereas if there were five people and five ghosts, it would be hard to go back by memory.
A clearer path is to draw a tree from the very beginning. The tree will guide us in the right direction!
The topic was obtained from the wechat public number niuniumaite. This article is excerpted and deleted for my personal interest.