The BOSS optics lab has been testing a rather clever way of helping a machine work out exactly where it is looking.
A circular calibration drum is to be covered with coloured markers. Each marker can be red, amber or green, and a camera can see exactly three consecutive markers at a time.
The engineers would like the three colours visible through the camera to identify the drum’s position uniquely.
That means every possible ordered sequence of three colours must appear once and only once as you travel around the drum.
The puzzle
There are three choices for the first marker, three for the second and three for the third, giving 27 possible three-colour sequences.
Can you arrange just 27 coloured markers in a circle so that every one of those 27 possible ordered triples appears exactly once?
Remember that the drum is circular, so groups of three are allowed to run across the join between the end of your written sequence and its beginning.
Hint 1
Do not try to build 27 separate groups of three. Consecutive groups can overlap. If one view is RED–AMBER–GREEN, then the next view begins AMBER–GREEN–…
Hint 2
Think of each pair of consecutive colours as a place you can arrive at or leave from. From any pair there are exactly three possible next colours.
Extra challenge: why can no drum with fewer than 27 markers possibly work?