### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,158)
- misc (2)
- project euler (2)
- puzzle (40)
- site news (44)
- tantalizer (42)
- teaser (3)

### Site Stats

- 178,002 hits

Advertisements

Programming Enigma Puzzles

17 July 2013

Posted by on **From New Scientist #2926, 20th July 2013** [link]

Our local park is rectangular, with each of its sides a whole number of metres in length, the longer sides exceeding the shorter ones by 25 metres. The boundaries run north-south and east-west. There are two straight paths of equal length. One runs from the gate at the south-west corner of the park to a point on the northern boundary. The second is at right angles to the first and runs from a point on the first path to the gate at the south-east corner of the park. Each path is a whole number of metres long.

How long are the paths?

[enigma1758]

Advertisements

%d bloggers like this:

If we suppose the dimensions of the park are

xandy=x+ 25 and the paths have lengtha, as shown in the diagram.Then we can see from the similar triangles that:

hence:

(You can also see this by moving the triangles to make a square park with sides

a).And in order for the paths to meet inside the park we require:

The following simple Python program finds the first integer

xthat satisfies the conditions. It runs in 31ms.Solution:The paths are each 156 metres long.To solve a more general problem where the dimensions of the park are

xandx + nyou can use an approach suggested by Brian in this post [ http://www.newenigma.com/enigma/view_enigma.php?id=1758#response7871 (registration required) ] by considering the factors ofn².This Python program lets you specify

non the command line (default is 25, as in the original Enigma puzzle), and returns all possible solutions (there may be none, e.g. whenn=20, or there may be more than one, e.g. whenn=45).