Let the box be oriented with its largest (5-by-12) rectangular surface
on the floor, with one corner of that surface being the bug's starting
point, labeled P. Then the finishing point, labeled Q, is the corner of
the box that sits 3 inches over the corner R opposite P on the base surface.
The obvious answer to the problem is that the bug crawls straight
along the diagonal of the base to R, a distance of
(52 + 122)1/2 = 13 inches, and then
crawls the remaining 3 inches along the edge joining R to Q, giving a
total travel distance of 16 inches. This analysis is wrong
(and why the puzzle is so devilishly clever).
The actual path the bug should take may
be more easily seen by mentally cutting along the vertical edges of
the box, and then folding the sides down onto the same plane as the base.
When this is done, the point P is unchanged, but the point Q has "split"
into a point Q1 on one of the short (3-by-5) sides and a point
Q2 on one of the long (3-by-12) sides. In this unfolded
configuration,
the line segments joining P to Q1 and to Q2 both
lie on the surface of the original box, and both give rise to a broken-line
path from
P to Q after the box is folded back up. The distance along the path to
Q1 is
(52 + (12+3)2)1/2 = 2501/2
≈ 15.8 inches, definitely an improvement over the obvious solution.
However, the distance along the path to Q2 is
((5+3)2 + 122)1/2 = 2081/2
≈ 14.4 inches. So, to minimize distance traveled, the bug should crawl
along the base to a point on the long side closest to Q, rather than to
a point on the short side closest to Q.
Here is a variation on this puzzle that has an even