Did you enjoy last week’s puzzle, A Bug in the System? The idea goes back more than a century. The great English puzzle-maker Henry Dudeney published his famous Spider and the Fly problem in 1903. His spider and fly occupied a differently proportioned room, and his surprising solution caused considerable public discussion.
Problems of the same general kind now turn up in geometry, computer graphics, robotics and route planning.
Solution
A very natural first idea is for Spider to crawl:
- 1 metre up to the ceiling,
- 20 metres along the ceiling,
- then 7 metres down the opposite wall.
That gives .
Going down to the floor first gives the same answer.
But S.P.I.D.E.R. can do better: the trick is to unfold the room.
Suppose Spider travels from its starting wall onto one of the side walls, then across the floor, and finally onto the wall containing the faulty sensor.
Cut those four faces apart from the rest of the room and lay them flat. S.P.I.D.E.R. ‘s bent route across the room has now become an ordinary route across a flat sheet, and on a flat sheet, the shortest route between two points is a straight line.
In this particular unfolding, the two points are separated by in one direction and by in the other in the other. Why 24? S.P.I.D.E.R. begins 3 metres from the chosen side wall, the data hall is 20 metres long, and the sensor is 1 metre above the floor and 3+20+1 = . And why 10? S.P.I.D.E.R. is 7 metres above the floor, while the sensor—being in the middle of a 6-metre-wide wall—is 3 metres from the chosen side:
So S.P.I.D.E.R. ‘s route is the hypotenuse of a right-angled triangle with sides 24 and 10 and by Pythagoras the length of the hypotenuse is the square root of the sum of the squares of the other two sides! If we let denote the unknown length we get , so . S.P.I.D.E.R. can therefore reach the sensor in 26 metres.
That is two whole metres shorter than the apparently obvious route over the ceiling.
BUT and it is a big BUT, how do we know that 26 metres is really the shortest possible route distance?
Unfolding one route proves that Spider can travel 26 metres. It does not, by itself, prove that another clever unfolding could not give an even shorter route.
Fortunately we can check.
For any shortest route across a cuboid, unfold the faces it crosses. The route becomes a straight line. Mirror-image choices of the left and right walls give the same lengths, so there are only a small number of essentially different cases to examine.
Their straight-line distances have squares 676, 680, 712, 784, 916 and 1352. The smallest is 676, giving our answer.
