# Sunday Times Brain Teaser 777 – Feeler Gauges

*by L Poulter*

I have half-a-dozen feeler gauges on a ring like keys on a key ring. They are attached in a certain order and by selecting a single gauge or combinations of adjacent gauges it is possible to measure from 1 to 31 thousandths of an inch (thou) inclusive in steps of 1 thou. If I remove two adjacent gauges, replace them with a single gauge and rearrange the five on the ring I can now measure from 1 to 21 thou inclusive in steps of 1 thou with these five gauges by again selecting a single gauge or combinations of adjacent gauges.

What are the thicknesses of the gauges and the order of arrangement on the ring in each case? (start with gauge of unit thickness and then its thinner neighbour for the sets).

which gives:

There are a lot of ways of speeding this up with a little effort. Since there is only one solution for the five gauges puzzle, we could solve this one and then modify it by taking out one gauge and adding in two. This would be a lot faster as the bulk of the time is in finding the six gauge solutions. Secondly, we could assume that all the gauges are of different widths (which reduces the time for a solution by a factor of four). This works because the solutions do not involve duplicate width gauges but it is not obvious (to me) that this has to be the case. But since it takes less than half a second to run anyway, we really don’t need to make this assumption.

There is some interesting maths behind this puzzle, Perfect Difference Sets, which can be constructed using Galois Fields (finite fields).

I have put together a blog entry that describes the maths, and includes a Python program to construct Perfect Difference Sets of various lengths using Galois Fields. The program also solves the teaser.

It’s rather a sledgehammer to crack a nut to solve the teaser in this way, but the code also solves a related problem invloving Evariste Galois and 18 soldiers (you will have to read the blog entry to find out more).