### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,183)
- misc (2)
- project euler (2)
- puzzle (46)
- site news (46)
- tantalizer (49)
- teaser (3)

### Site Stats

- 184,818 hits

Advertisements

Programming Enigma Puzzles

11 August 2017

Posted by on **From New Scientist #1559, 7th May 1987** [link]

There are six footpaths through our extensive local woods, one linking each pair of four large oaks. I decided to go on a long walk starting at one of the oaks, keeping to the footpaths, ending back where I started, covering each of the footpaths exactly twice, and never turning around part-way along a path.

Whenever I was at an oak my watch showed an exact number of minutes, and in the previous 30 seconds up to and including arriving at the oak or in the 30 seconds after leaving the oak the hour and minute hands of the watch were coincident.

I set out sometime after 6am and I was back home before midnight on the same day. I walked at a steady pace from start to finish.

What time was I at the oak at the start of my round walk, and what time did I get back there at the end of the day?

[enigma409]

Advertisements

%d bloggers like this:

Another puzzle about coincident clock hands (See:

Enigma 1761).At first I thought there must be multiple solutions to this problem.

We can find the times to the nearest minute when the hour and minute hands of the watch are coincident in the required time period. There are 16 of them:

And the walk has 12 legs, so if each leg takes about the same time and we don’t stop anywhere along the way (no stops are mentioned), we could have any of the following start and finish times:

It’s also possible that one path could take about twice as long to traverse as the other paths, which would mean we could have the following possible start and finish times:

One way to reduce the number of possible answers is to assume that the time taken to traverse a path must be

exactlythe same both times it is traversed, even if it is traversed in the opposite direction.Using this interpretation of the text I was able to write a program to try all possible routes and determine that there was, indeed, a unique start and end time that satisfied the puzzle.

This Python 3 program determines the times (to the nearest minute) when the hands are coincident, and then uses the differences between these times to find routes where paths are always traversed in the same time. It runs in 94 ms.

Solution:The walk started from the first oak at 6:33am, and returned to it (for the final time), completing the walk, at 9:49pm.One possible itinerary is:

I was close to marking this puzzle as

flawed, and I still think it could have been worded better.I too must have found multiple solutions: when I added this one to my own archive a few years ago I modified the wording to “I set out after 7 and got home in the evening” — which is somewhat more probable for a full day’s outing, not even stopping for lunch.

Definitely flawed!

I had assumed the layout of paths to be a bit like a four-leafed clover, the four outer arcs each the same length as a diagonal. That’s not very likely, so I’d like to suggest the following modification to the wording:

[diagram showing a rhombus with shorter diagonal equal in length to each of the sides]

>>

At each corner of the forest is a magnificent oak tree. There are six footpaths, one linking each pair of oaks. At the weekend I went on a long hike, starting at an oak and finishing at the same oak, keeping to the paths and going along each one exactly twice (in one direction or the other). Each time I was on the long diagonal I stopped for a while to eat part of my picnic lunch, so that the distance AC (in either direction) took me twice as long as each of the other paths, including BD. Otherwise I kept up a steady pace all day. I always went straight across at the central crossing point.

Whenever I was at an oak I noticed that the minute hand of my watch coincided with the hour hand. I set out soon after 6 in the morning and got home by 22:15.

To the nearest minute, what were my starting and finishing times (at the oaks, I mean)?

<<

So in my version it's AC that takes 131 minutes.

And by the way in English we say turn round, not "around".

For me the confusion arose because I don’t think it is sufficient to say the paths were “walked at a steady pace”, if we require the time taken to traverse a path to be

exactlythe same (to the second) in both directions. Especially if the path is uphill in one direction. I think it would be quite consistent to walk from A to B in 66 minutes, and back from B to A in 65 minutes and still be walking at “a steady pace”.Instead I would phrase the question using an object being transported at a steady pace by a conveyance that ensures journey times between stations are always exactly the same. Here is a rephrasing on the puzzle:

This has a unique answer that is the same as the published answer for the original puzzle, and doesn’t require any adjustment of the possible time windows involved.

Here is a recursive Python 3 program that finds the solution in 150ms. It’s a bit neater than my original program in that it doesn’t require any analysis or special cases to account for the fact that one of the journeys between stations may take (roughly) twice as long as the others.

I like the rewording with the toys. The final shift must end before midnight, (or the factory workers turn into pumpkins). I agree that Brian is right that there are multiple solutions. Given the times that the clock hands are coincident and hence the arrival times at each oak / workstation (node) have already been calculated, then there are 8 possible legs of length 65 minutes and 7 possible legs of length 66 minutes. Each leg must be traversed twice, so that there must be an even number of traverses of each leg length. The solution with 6 x 66 minutes and 6 x 65 minutes can be eliminated since the sequence then must contain two adjacent legs of 66 minutes. This leaves a solution with 6 x 65 minutes, 4 x 66 minutes and 2 x 131 minutes. This can only be achieved beginning at 6:33 and ending at 21:49. The solution is correct if one path can be traced.

In the case of the python programme the algorithm has solved the problem and on top of that, calculated a multiple of paths.