Monday, August 24, 2020

Explain XKCD: Boat Puzzle

We haven't visited the ever-so-earnest people at Explain XKCD in a while and here's a good introduction for new readers:
First, Randall Munroe draws/writes the cartoon, in this case it's #2348 in the series, published a few days ago:

https://imgs.xkcd.com/comics/boat_puzzle.png

Being that it is a puzzle we are going to need more than just the explanatory powers of E-XKCD, we're also going to need them to solve the puzzle because I haven't a clue.

From Explain XKCD:  
Transcript
[Cueball and Ponytail are standing on the bank of a river. There is a boat in the river. A goat and wolf are also on the riverbank, and Ponytail is holding a cabbage.]
Ponytail: I need to cross the river. I have a wolf, a goat, and a cabbage.
Cueball: Hmm.
[White Hat appears, accompanied by two wolves and pulling a wagon full of cabbages.]
Cueball: OK, here's what-
White Hat: Hi, I also need to cross. I have two wolves and 100 cabbages.
[Black Hat arrives, surrounded by a cloud of flying creatures and carrying a jar of bugs under his arm. Beret Guy follows with another wolf and goat on leashes.]
Black Hat: I have 50 cabbage moths and 2,000 boat-destroying termites.
Beret Guy: I have a wolf that can operate a boat, and a goat that eats wolves.
[The fourth panel is a zoomed-out shot, where everything but the sky appears black.]
[A trolley speeds in, leaving a trail of dust in its wake. A person is standing on the front, and many ears are barely visible above the seats.]
Cueball: Hang on, I need to make a spreadsheet.
Trolley operator: Look out!
Trolley operator: My wolf-filled trolley is out of control and can only be stopped by a cushion of cabbages!
Explanation
This comic is a twist on an old riddle. In the original riddle, a person has to cross a river in a boat that can only hold them and one other object. They have a wolf, a goat, and a cabbage that they need to bring across with them, similar to the first panel. If the wolf is left alone with the goat, however, the wolf will eat the goat; and if the goat and cabbage are alone, the goat will eat the cabbage. (The problem can be solved in seven trips.)

However, the comic quickly devolves into surrealism in the later panels as new characters show up, bringing deviations of the original "cabbage", "goat", and "wolf" that add extra layers of complexity to the riddle. White Hat brings extra wolves and cabbages. Black Hat, in his traditional classhole style, brings cabbage moths which will infest unsupervised cabbages with destructive larvae, and boat-destroying termites. How he intends to bring them across the river (or even if he wants to) is unknown, but it brings to mind the parable of The Scorpion and the Frog. Beret Guy arrives with a wolf who can operate a boat, who could perhaps serve as a second pilot to expedite the crossing, so long as he is not asked to ferry a goat, and also a goat who eats wolves (which does not alter the problem constraints but is unusual, as one would expect from Beret Guy's associate).

The last panel is a reference to the Trolley Problem, a moral test that asks the participant whether they would passively let people in the way of an uncontrollable trolley die or actively divert the trolley to kill a single person standing on a branch of the tracks. The comic gives a twist here too: according to the title text, the characters must choose between stopping the trolley full of wolves with a cushion of cabbages (in which Black Hat's cabbage moths have laid eggs, which he implicitly argues are morally equivalent to "innocent children") or letting it crash into the river (at which point the wolf who can operate a boat will steal the boat to rescue the wolves from the trolley, which will delay the other characters from crossing the river).

The River Crossing puzzle was also mentioned in 1134: Logic Boat and referenced in 589: Designated Drivers.
The Trolley Problem was also mentioned in 1455: Trolley Problem and referenced in 1938: Meltdown and Spectre.

Solving The Problem
Unlike typical Logic Boat problems the presence of multiple humans makes finding a solution almost trivial, however trying to determine the solution with the least number of trips could still make the somewhat challenging. Because the set of constraints are both ambiguous and incomplete, it requires the reader to make assumptions that, in turn, will lead to different solutions.

Reasonable Assumptions
The following assumptions can be made based on the setup of the problem or are necessary to avoid an unsolvable puzzle.
  • Cueball is an observer. He is set up as an observer there to solve the problem, not pilot the boat or "watch" the cargo.
  • The boat can only hold two items. This is standard in logic boat problems. Groups of insects count as one item.
  • Black Hat and Beret Guy both want to cross the river with their cargo. Neither states that they wish to cross the river like Ponytail and White Hat, but it can be inferred from the setup of the scenario.
  • The termites will destroy the boat after crossing. Otherwise the problem is unsolvable. This is similar to the Poncelet–Steiner theorem, which shows that any compass-and-straightedge construction can be completed with a "rusty compass", so long as the compass works at least once.....
....MORE