Sunday Times Teaser 2782 – Spiders

by Graham Smithers

Spiders Beth and Sam wake up in the bottom corner of a cuboidal barn (all of whose sides are whole numbers of metres). They want to reach the opposite bottom corner without actually walking across the floor. Beth decides to walk on one of five possible shortest routes, two of them being around the edge of the floor and the other three being over the walls and ceiling. Sam decides instead to spin a web directly to the point on the ceiling diagonally opposite the starting point and then to drop down into the corner. The total length of his journey is within five centimetres of a whole number of metres.

How high is the barn?

1. The shortest routes across the walls and ceilings can be seen by ‘flattening’ out the room as shown here: The squares of the lengths of the different (equal) shortest paths in this puzzle are:[(a+b)^2] [(a+c)^2 + (b+c)^2] [b^2 + (a+2c)^2] [a^2+(b+2c)^2] The first two of these apply to two paths each, while the last two are different unless the room is square. If we equate the first three paths in pairs, we can show that [b(a-c)=c(a+c)] [b=a+c] [ab=2c(a+c)] And these in turn give (a=2c) and (b=3c) so the space diagonal becomes (sqrt(14)c). This shows that the length of the space diagonal is very close to (~374c) cm, from which the answer of 4 metres is quickly found

2. This Python program produces a series of solutions. (The number of solutions required can be specified on the command line). The smallest solution is the only barn with reasonable dimensions.

(The program uses routines from the enigma.py library).

It turns out that (h, w, l) = (k, 2k, 3k) for integers k, which leads to a simplified version of the program.

3. For the height of four metres, the room dimensions are 4, 8 and 12, then two shortest routes along edges of floor are 20. I cannot see how any other route with diagonals can also result in an exact length of 20.
What am I missing?

• 4. 