### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

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

### Site Stats

- 175,242 hits

Advertisements

Programming Enigma Puzzles

11 February 2013

Posted by on **From New Scientist #1199, 20th March 1980** [link]

Sam Sorebottom has just spent his weekend cycling around part of the Fens. He arrived at one of the 16 towns by rail and thereafter cycled madly from town to town, until worn out.

The towns have names starting, conveniently, with the letters

AtoPand he visited each exactly twice (counting his train arrival atAas his first visit toA). His final destination wasMand he used only the roads you see on the map.He told a friend today that he did the towns in this precise order:

A J N H K G B M I E P F C L D O C G N H O K D L P E I F B J A M.“That cannot be quite right,” said the friend, after a little thought. “No,” Sam replied, having reconsidered, “I see that I have carelessly transposed two successive towns at exactly one point in the order.”

Even without knowing which town is where on the map, can you name the transposed towns?

[enigma56]

Advertisements

%d bloggers like this:

Note that the map is topologically identical to a 3×3 grid with the towns at the corners of the squares. Which means in any single journey an individual town can only appear in either all odd positions or all even positions in the journey. This gives us the quick way to find the transposed towns in the journey itinerary.

This Python program then goes on to fix up the journey itinerary, and compute the map of the towns. It runs in 46ms.

Solution:The transposed towns are K and O.Here’s the correct map, laid out as a grid.