Lambdia

A Bug Walks Root Five Across a Cubic Room

Unfolding two faces into a 2 by 1 rectangle turns the walk into a straight segment of length root five, crossing the shared edge at half height. The reflex answer of one plus root two is the same one-parameter family evaluated at the end of that edge instead of its middle, so the trap and the answer are two points on one curve.

A cubic room measures one unit each way. A bug starts in one corner and has to reach the corner diagonally opposite. It walks on the surfaces and never flies. What is the shortest possible walk?

Almost everyone builds the route the same way: cross one wall along its diagonal, then walk the last edge. That is 2+12.414\sqrt2 + 1 \approx 2.414, and it is a real walk of exactly that length. It is also not the shortest, and the reason it loses is more interesting than the number that beats it.

Flatten the room

Take the two faces the bug will use, one wall and the floor, and unfold them into the plane. On flat paper they form a 2×12 \times 1 rectangle with the start at one corner and the finish at the corner diagonally across, and on flat paper the shortest route between two points is the straight segment:

12+22=52.236\sqrt{1^2 + 2^2} = \sqrt5 \approx 2.236
(1)
Why the unfolding is allowed

Folding along a shared edge is an isometry on each face: distances measured inside a face are unchanged by it. A path that stays on those two faces therefore has the same length before and after the fold, so the flat problem and the curved one have the same answer. The step that needs care is the choice of which faces to flatten, not the flattening.

Fig. 1 — The same rectangle carries both routes. The reflex answer bends at the top of the fold, which costs it the corner.

Where the straight segment meets the fold matters, and it is exactly halfway up. That single fact is the whole difference between the two answers, because the reflex route crosses at the end of the shared edge instead of its middle.

The reflex answer and the real answer are one function

Fix the two faces and let s[0,1]s \in [0,1] be the height at which the walk crosses their shared edge. Every candidate route on those two faces is two straight legs, so

f(s)=1+s2+(1s)2+1f(s) = \sqrt{1 + s^2} + \sqrt{(1-s)^2 + 1}
(2)

and now evaluate it at three points. At the midpoint,

f ⁣(12)=254=5f\!\left(\tfrac12\right) = 2\sqrt{\tfrac54} = \sqrt5
(3)

which is (1) again, as it must be. At either end,

f(0)=f(1)=1+2f(0) = f(1) = 1 + \sqrt2
(4)

which is the reflex answer. So the wrong answer is not a different problem or a careless approximation. It is the same one-parameter family sampled at the boundary of its interval, where the walk squeezes into the corner instead of cutting the edge.

Fig. 2 — One function, two answers. Both ends of the curve are the reflex route, and the floor of the curve is the shortest walk.

The midpoint is a genuine stationary point rather than a lucky guess. Differentiating (2),

f(s)=s1+s21s(1s)2+1f'(s) = \frac{s}{\sqrt{1+s^2}} - \frac{1-s}{\sqrt{(1-s)^2+1}}
(5)

and at s=1/2s = 1/2 the two terms are equal, so f(1/2)=0f'(1/2) = 0. The curve in Fig. 2 is convex, so that stationary point is the minimum over the whole family.

The same result with no calculus at all

There is a cleaner argument, and it is the one I would give under time pressure. Reflect the target corner across the shared edge into the plane of the first face. A two-leg path from the start to a point on the edge and then to the target has the same length as the two-leg path from the start to that point and then to the reflected target, because reflection preserves distance. So minimising over crossing points is minimising the length of a path between two fixed points via a line, and the answer is the straight segment. Unfolding is that reflection, which is why the two arguments are the same argument in different clothes.

Read the first derivative condition (5) again with that in mind and it says something familiar: the incoming and outgoing legs make equal angles with the shared edge. Light does the same thing at a mirror, and for the same reason.

Nothing else on the cube beats it

Two faces is a choice, and a complete answer has to rule out the alternatives. On a cube the candidate routes are indexed by the sequence of faces they cross, and the length is a sum of Euclidean norms of affine functions of the crossing points, which makes the objective convex on each face sequence. So each sequence can be minimised exactly rather than sampled.

Running that over every simple face sequence gives six two-face sequences, twenty-four three-face and fifty-four four-face, and the global minimum over all of them is 5\sqrt5, attained by the six symmetric two-face routes. The longer families never go below it; their minima coincide with 5\sqrt5 only because pushing a crossing point to an endpoint collapses them onto a two-face route.

Six shortest paths, not one, and that is the cube being degenerate. Three pairs of faces connect the two corners, each pair can be crossed in two ways, and on a cube all three unfoldings give the same rectangle. Any other box breaks the tie.

A room that is not a cube

For a box a×b×ca \times b \times c, unfolding a pair of adjacent faces gives a rectangle of dimensions (a+b)×c(a+b) \times c or one of its two rearrangements, so the three candidate lengths are

(a+b)2+c2,(a+c)2+b2,(b+c)2+a2\sqrt{(a+b)^2 + c^2}, \quad \sqrt{(a+c)^2 + b^2}, \quad \sqrt{(b+c)^2 + a^2}
(6)

and choosing between them is a two-line comparison. Expanding the first two,

(a+b)2+c2[(a+c)2+b2]=2a(bc)(a+b)^2 + c^2 - \left[(a+c)^2 + b^2\right] = 2a(b - c)
(7)

so the first is smaller exactly when b<cb < c. Applying that twice: the winner is the unfolding that adds the two smallest dimensions and leaves the largest one alone. For a room 1×1×21 \times 1 \times 2 that gives (1+1)2+22=82.828\sqrt{(1+1)^2 + 2^2} = \sqrt8 \approx 2.828, against 103.162\sqrt{10} \approx 3.162 for either of the other two. And for the cube all three are 5\sqrt5, which is the tie again.

Scaling is immediate from (6): a cubic room of side aa answers a5a\sqrt5, since the unfolded rectangle is 2a2a by aa.

The forbidden route, and one thing that does not matter

The straight flight through the middle of the room is 31.732\sqrt3 \approx 1.732, which is shorter than the answer. That is not a rival that loses, it is a route the rules exclude, and the reason the problem says the bug walks is precisely to exclude it. Comparing 5\sqrt5 favourably against 3\sqrt3 would be a mistake in the other direction.

What genuinely does not matter is that the bug is inside the room rather than outside the cube. The inner surface is isometric to the outer one: same flat faces, same edges glued the same way, so the same distances. Walking around a solid block of the same size gives the identical 5\sqrt5.

One caution for the general version. Opposite corners of a box are the easy case, because the two-face unfoldings are the natural candidates. For a source and target that are not opposite corners, the shortest surface path can cross more faces than intuition suggests, which is exactly why the check above enumerated sequences of four faces rather than stopping at two.

Sources and further reading

Every number above was checked before publication in two ways: symbolically, for equations (1) through (7), and by an exhaustive search over every simple face sequence of the cube with the crossing points minimised exactly rather than on a grid. The earlier grid version of that search was thrown out, because minimising over a grid only bounds each sequence from above and proves nothing about minimality.

Comments · 0

Be the first to comment.