Below is an overview of the classic “Farmer–Wolf–Goat–Cabbage” puzzle together with a couple of ways people have “up‐sized” the challenge. In each case the puzzle has the same flavor: a set of items (or characters) have dangerous “predator–prey” relationships such that if left alone (unsupervised by the farmer) certain items will “eat” or “destroy” another. (In some tellings the “cabbage” is called “salad” or “beans.”) We start with the simplest well known version and then describe two variants that add extra twists. (Note that many variations have been invented over the years; the ones shown below are just examples that illustrate how one might increase the difficulty and then use careful state‐analysis to “solve” them.)
Variant 1: The Classic Farmer–Wolf–Goat–Cabbage Puzzle
Rules
- Characters: Farmer, Wolf, Goat, Cabbage.
- Boat Capacity: The boat can carry only the farmer plus one item at a time.
- Dangerous Combinations (when the farmer isn’t present):
- The Wolf will eat the Goat.
- The Goat will eat the Cabbage.
The Standard Solution
A well‑known solution is as follows:
- Take the Goat across.
• Left Bank: Wolf, Cabbage
• Right Bank: Goat
(Wolf and Cabbage can safely remain together.)
- Farmer returns alone.
• Left Bank: Farmer, Wolf, Cabbage
• Right Bank: Goat
- Take the Wolf across.
• Left Bank: Cabbage
• Right Bank: Farmer, Wolf, Goat
- Bring the Goat back. (If left, the Wolf would eat it.)
• Left Bank: Goat, Cabbage
• Right Bank: Wolf
- Take the Cabbage across.
• Left Bank: Goat
• Right Bank: Farmer, Wolf, Cabbage
- Farmer returns alone.
• Left Bank: Farmer, Goat
• Right Bank: Wolf, Cabbage
- Take the Goat across again.
• Left Bank: –
• Right Bank: Farmer, Wolf, Goat, Cabbage
At the end, everyone is safely on the other side, and at no point are any two incompatible characters left alone together.
Variant 2: Four Items with an Increased Boat Capacity
One way to “complexify” the problem is to add an extra item (with its own pairwise constraint) and also to allow the boat to carry two items at a time (in addition to the farmer). For example, consider a variant with:
Characters and Rules
- Characters: Wolf, Goat, Cabbage, and a Mouse.
- Boat Capacity: Farmer plus up to two items.
- Dangerous Combinations When Farmer Is Absent:
- The Wolf will eat the Goat.
- The Goat will eat the Cabbage.
- The Mouse will nibble the Cabbage.
(We assume that other pairs—Wolf with Cabbage, Wolf with Mouse, or Goat with Mouse—are safe.)
A Possible Solution
A solution using the larger boat might be achieved in just two trips:
- Trip 1 – Take Goat and Mouse across.
- Left Bank: Wolf, Cabbage
(Wolf and Cabbage have no conflict.)
- Right Bank: Goat, Mouse
(This pair is safe.)
- Return Trip – Farmer goes back alone.
- Trip 2 – Take Wolf and Cabbage across.
- Right Bank after landing: Wolf, Cabbage, Goat, Mouse with Farmer present
(All are together, and with the farmer present there’s no danger; once the farmer completes the crossing the puzzle is solved.)
Because the boat can carry two items at a time, the extra item (Mouse) is “bundled” in a way that avoids leaving a dangerous pair behind. (Note that with the original one‑item boat capacity this four‑item, three‑dangerous‐pair puzzle is unsolvable. Changing the boat’s capacity is what makes the new puzzle “work.”)
Variant 3: Multiple Predators and Prey (Increasing the Number of Items)
Another way to increase the complexity is to add more characters that form a longer “food‐chain” or that have nontransitive conflicts. One famous expanded version is sometimes presented in the form of “two foxes, two chickens, and a bag of grain” (a double version of the classic “fox, goose, and bag of beans” puzzle). For example:
Characters and Hypothetical Rules
- Characters: 2 Foxes, 2 Chickens, and 1 Bag of Grain.
- Boat Capacity: Often kept at Farmer plus one item at a time (which forces a long sequence of moves).
- Dangerous Combinations (when unsupervised):
- A Fox will eat a Chicken if left together (even if there are two foxes or two chickens, the risk exists if at least one fox is with a chicken).
- The Chickens will peck at (or eat) the Grain if left alone with it.
(Usually the foxes are not a danger to one another and the chickens are safe with one another; only the mixed pairings are dangerous.)
How to Think About the Solution
While there is a solution to this “double” puzzle, the sequence of moves is quite a bit longer than in the classic puzzle. In fact, many authors recommend using a state–space search method:
- Step 1: List all items (all on the starting bank) and identify the “unsafe” combinations.
- Step 2: Represent each state by which bank each item is on.
- Step 3: Enumerate every possible move (taking one item at a time with the farmer) and discard moves that would leave an unsafe pairing on either bank.
- Step 4: Search (by hand or computer) for a sequence of moves that safely transfers all items.
A sample outline of the solution may involve moves such as:
- Transporting a chicken first,
- Bringing one back (so as to “control” the dangerous combinations on the starting bank),
- Alternating which item is brought over or returned,
- Eventually shifting the foxes and then carefully moving the remaining chicken and finally the grain.
Because every move must be checked for safety on both banks, the solution easily runs to 13– or 15–step sequences (or more). (Exact sequences vary by the precise wording of the “danger” rules and the boat–capacity restrictions.) Many enthusiasts have written computer programs that “solve” such puzzles, proving that even these apparently innocent puzzles can be NP‐hard when scaled up!
General Strategies for Solving Such Puzzles
- List the Dangerous Pairs: Write down every pair (or set) of items that cannot be left alone together.
- Model the “State”: Think of the situation as a state (e.g.
{L: [items on left bank], R: [items on right bank]} along with the farmer’s position).
- Examine Moves: Only allow moves that keep both banks safe.
- Use Backtracking if Necessary: In more complex puzzles (like Variant 3), several moves will be “undone” as you try to find a safe complete path.
- Search Systematically: For very complicated versions, it can help to use a computer–assisted search (such as a breadth–first search) to guarantee that no unsafe state will occur.
In Summary
- The classic puzzle (farmer, wolf, goat, cabbage) has a neat 7–step solution.
- Slight modifications (adding a fourth character such as a Mouse but also increasing boat capacity) can actually make the puzzle easier (fewer moves) once the extra capacity allows “bundling” safe pairs.
- Larger puzzles (e.g. two foxes, two chickens, and grain) illustrate how subtle changes in capacity or the introduction of more predator–prey relationships can make the puzzle very challenging and require a systematic search of legal states.
Each of these variations provides not only a fun “brain teaser” but also a wonderful lesson in modeling constraints and using search strategies to solve problems under restrictions.
Happy puzzling!