### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,367)
- misc (4)
- project euler (2)
- puzzle (90)
- puzzle# (48)
- site news (58)
- tantalizer (94)
- teaser (7)

### Site Stats

- 233,129 hits

Programming Enigma Puzzles

16 September 2019

Posted by on **From New Scientist #1669, 17th June 1989** [link]

Out there, somewhere in the night, is Elk Elloy, gunning for me. My only hope is to stay in the dark.

Stretching ahead of me is the Boulevard, all 3686.3 yards of it. If I can make the other end of it then I’ll be safe. But the whole length of the Boulevard is covered with neon strip lights. One hundred and ninety-three of them, each 19.1 yards long, set out end-to-end. They flash on and off steadily through the night. There go the 1st, 3rd, 5th, 7th, …, 193rd. They’re on for just an instant. Now there is a 12-second pause and then on come the 2nd, 4th, 6th, …, 192nd, for just an instant. Then another 12-second pause and we begin all over again with the odd numbered strips.

Fortunately, each strip only lights the ground directly below it, so there is a chance I can walk along the Boulevard and avoid ever being under a strip when it comes on.

There are just two catches. First, I must walk at a constant speed which is a whole number of yards per minute, otherwise I will arouse the suspicion of Patrolman Nulty who covers the Boulevard. Secondly, I cannot walk at more than 170 yards per minute.

What speed should I walk at, in yards per minute?

[enigma517]

%d bloggers like this:

Let’s suppose the clock ticks modulo 24 (so it goes: 0, 1, 2, …, 22, 23, 0, 1, 2 …).

Then there are 193 zones (we will number them from 0 to 192), we want to avoid being in the even numbered zones at t=0 and the odd numbered zones at t=12.

So, if we were in the middle of an even zone at t=12 we would be safe, and if we could get to the middle of the next odd zone by t = 0 we would be safe in that zone.

That requires travelling 19.1 yards every 12 seconds. Which is 95.5 yards/minute, which is not a permitted speed.

But it is in the right range of available speeds, so we can look at travelling 95 yards/minute or 96 yards/minute and see if they work.

If we can get from the middle of zone 96 at t=12 to the end of the final zone without being caught, then, by symmetry, we would be able to get to the middle of zone 96 without getting caught.

In the following Python program I express distances in “centiyards” (i.e. 1/100 of a yard). It runs in 107ms.

Run:[ @repl.it ]Solution:You should travel at 96 yards/minute.To pass exactly through the centre of zone 96 at t=12 the required start time is t=12 + 1/32 seconds (= 12.03125s).

And 96 yards/minute is the only permissible whole number speed in the allowed range that permits an unobserved passage: