# Sunday Times Teaser 2782 – Spiders

*by Graham Smithers*

#### Published: 17 January 2016 (link)

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?

5 Comments
Leave one →

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

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.pylibrary).It turns out that (h, w, l) = (k, 2k, 3k) for integers k, which leads to a simplified version of the program.

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?

Welcome to the site! The other routes go up a wall across the ceiling and down another wall to the final destination. You can see these routes if you think of the room as an upturned cardboard box and then ‘flatten’ it. This shows a number of ‘straight’ line paths between the two end points (I have now added a diagram above to show this).

Looking at Brian’s diagram above, and looking at the red and blue line which meet at the top right corner, by inspection of the geometry, they can only be the same length if (b = a + c). Then eliminating a leads to a quadratic equation where (b = 0) (impossible) or (3c)

If (d) is the nearest integer to the diagonal distance, then it turns out that (d) and (c) are the base solution of the Pell equation (d^2 – 14c^2 = 1).