00:03
We are given an old puzzle.
00:06
You may even be familiar with this puzzle.
00:09
The puzzle is that a farmer needs to carry a wolf, a goat, and a cabbage across a river.
00:18
We're told that the farmer only has a small boat which can carry the farmer and only one object, either an animal or a vegetable.
00:27
He can cross the river repeatedly.
00:29
However, if the farmer is on the other shore, the wolf will eat the goat, and similarly, the goat will eat the cabbage.
00:39
We're told that we can describe each state by listing what is on each shore.
00:44
So, for example, we could use the pair fgwc for the state where the farmer and goat are on the first shore, and the wolf and cabbage are on the other shore.
00:56
Of course, you can use the null set to symbolize when nothing is on a shore.
01:02
For example, the initial state is fwgc, null set.
01:07
In part a, we're at the end of the state.
01:08
To find all allowable states of the puzzle where neither the wolf and the goat nor the goat and the cabbage are left on the same shore without the farmer.
01:28
Well, we have these three items, the wolf, the goat, and the cabbage of course.
01:33
Farmers are a small boat.
01:34
They can carry one animal or vegetable.
01:37
We're told that the wolf will eat the goat when the farmer's on the other shore and the goat will eat the cabbage when the farmers on the other shore.
01:46
So we already have the nomenclature f is farmer w is wolf g is goat and c is cabbage therefore all allowable states are described by the following rules we know that w and g cannot be on the same shore without f and g the goat and c the cabbage cannot be on the same shore without the farmer f as well.
02:42
See these are two rules defining the states.
02:47
So the set of all allowable states are, well we have, we could have in one shore, the farmer, the wolf, the goat, and the cabbage altogether, and a null set on the other shore.
03:02
We could have the farmer and the wolf and the goat, but then the cabbage on the other shore.
03:09
We could have the farmer, the wolf, the goat, but then the cabbage on the other shore.
03:14
And the cabbage on one shore and the goat on the other.
03:19
We could have the farmer, the goat and the cabbage in one shore, and the wolf on the other.
03:31
Or we could have the farmer and the goat on one shore and the wolf and the cabbage on the other shore.
03:40
The wolf will not eat the cabbage.
03:44
Of course, by symmetry, we could have the same results with the shores switched, so we could also have nothing on the first shore and then everything on the second shore.
03:58
We could have cabbage on the first shore and then farmer wolf and goat on second.
04:04
Goat on first, farmer wolf cabbage on second.
04:10
The wolf on first and the farmer goat cabbage on the second.
04:18
And finally, the wolf and cabbage on first and the farmer and goat on second.
04:28
So this gives us a total of 10 states.
04:39
So that's our answer for part a.
04:45
Then for part b, pressed to construct a graph such that each vertex of this graph represents an allowable state, and the vertices representing two allowable states are connected by an edge if it is possible to move from one state to the other using one trip of the boat.
05:08
Okay, so as i said before, we have 10 states, therefore there are 10 vertices, and these will be the states found in part.
05:20
A.
05:25
So i'm just going to give these states a labeling.
05:48
So i'll call this state, state one.
05:52
I'll call this state.
05:57
And you'll see why i use this labeling in just a second.
06:05
State two.
06:12
Then this is state three.
06:28
This will be state four.
06:37
This will be state five.
06:44
This will be state six.
06:57
This will be state seven.
07:11
This will be state eight.
07:18
9, and finally 10.
07:23
You'll see why i chose this labeling.
07:27
So we start out.
07:28
Let's start with state 1.
07:36
Now we know that edges occur between two vertices if it is possible to move from one state to the other.
07:42
So the farmer has to switch shores or the farmer has to switch shores with an animal.
07:47
So we're starting out with farmer, wolf, goat, and cabbage all on one shore.
07:55
The next state will move to.
07:57
The only possible state that we can move to is state two.
08:02
Because if the farmer tries to leave by himself, this won't work out.
08:05
The wolf will eat the goat, so the goat will eat the cabbage.
08:10
And if the farmer tries to leave with the wolf, then the goat and cabbage will be left in the same shore, which is not allowed.
08:21
If the farmer tries to leave with the cabbage, then the wolf and goat will be left on the same shore, which is not allowed.
08:27
So the only possibility is that the farmer moves from this shore, with the goat.
08:35
The wolf will not eat the cabbage.
08:37
Then, from this point, the only possibility is that the farmer goes back to the first shore by himself.
08:45
So we have state three, which is fwcg.
08:51
If the farmer tried to bring the goat back with him, we would simply go back to state one, which we already have.
08:58
Now from state three, there are two different possibilities.
09:02
We have either the farmer could bring the goat back, to the other shore with himself.
09:12
So we would have the arrangement c fwg, sorry, the wolf back with himself, so c fwg.
09:22
Another possibility is the farmer could bring the cabbage back with him, so we would have w fgc, state 6.
09:32
These are the only two possible states.
09:35
If the farmer were to go back by himself, we would just go back to state 2.
09:41
Now looking at state 4, what can the farmer do? well, the farmer clearly can't just leave...