September 8, 2024


Today’s puzzle is a classic interview question for jobs in programming. I hope this 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 don’t know how long it is. Along the tunnel’s walls, placed uniformly and at regular intervals, are switches that can be switched between two positions: up or down. Other than that, there are no other objects in the tunnel, and if you walk along it you can’t infer anything about the rate of curvature of the circular path. However, you have a pencil and paper and a reading light, so you can write down numbers.

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

I’ll be back at 5pm UK with a solution. PLEASE NO SPOILERS. Book your favorite software engineers instead.

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

Finally, hard core puzzles may be interested in the Royal Statistical Society’s Christmas Quiz (30th Anniversary Edition), which runs until Monday 29 January. This year’s prizes include a total of £900 in charitable donations – if you can achieve more than 30%, part of the pot will go to your nominated charity.

I’ve been doing a puzzle here on alternate Mondays since 2015. I’m always on the lookout for great puzzles. If you want to suggest one, email me.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *