Today’s puzzle is a classic interview question for jobs in programming. I hope it flicks your switches.

The loopy labyrinth

You are trapped in a dark underground tunnel. You know it curves endlessly in a circular path, but you do not know how long it is. Along the tunnel’s walls, placed uniformly and at regular intervals, are switches that can be toggled between two positions: up or down. Apart from that there are no other objects in the tunnel, and when you walk along it you can deduce nothing about the rate of curvature of the circular path. You do have a pencil and paper and a reading light, however, so you can jot numbers down.

How do you count the number of switches in the tunnel?

Clarification: you are not allowed to drop any of your clothing or possessions on the floor.

I’ll be back at 5pm UK with a solution. PLEASE NO SPOILERS. Instead, discuss your favourite software engineers.

Thanks to Brian Rabern, Reader in Philosophy at the University of Edinburgh, for suggesting this puzzle, which he uses in his class “Puzzles and Paradoxes.”

Finally, hard core puzzlers may be interested in the Royal Statistical Society’s Christmas Quiz (30th anniversary edition), which runs till Monday 29 January. This year’s prizes include a total of £900 in charity donations – if you can score more than 30%, a slice of the pot will be go to your nominated good cause.

I’ve been setting a puzzle here on alternate Mondays since 2015. I’m always on the look-out for great puzzles. If you would like to suggest one, email me.

End

To Get The Latest News Update

Sign up to Our Subscription.

We don’t spam! Read our privacy policy for more info.

To Get The Latest News Update

Sign up to Our Subscription.

We don’t spam! Read our privacy policy for more info.