One of my daughter’s favorite toys is this puzzle set that forms a track:
At only six months she’s not old enough to set up the track, but she loves to watch the mechanical seal that travels whatever path is laid out for it.
As the seal passes certain points, it makes predetermined sounds that go with the picture. For example, passing by the dolphins causes dolphin sounds to occur.
What’s interesting mathematically is how the track manages to “code” the different sounds. Notice there are raised ridges on the track. There are four ridge positions matching with four switches on the back on the seal.
If “raised” is a 1 and “lowered” is a 0, then the dolphin picture shows the code 1010.
Hence each sound is linked to a certain combination of switches. What’s particularly interesting is that the track has to work in both directions (it’s not preset which way the seal is facing) so that the switch combinations have to either be palindromes (like 0110 backwards is still 0110) or indicate the same sound when interpreted backwards (so 0101 will give the same sounds as 1010).
Hence, the maximum number of sounds possible on the track given four switch positions is nine: 1001, 0100, 0110, 1000, 1100, 1010, 1110, 1101 and 1111. (Any of the codes may be reversed.)
The actual track uses five: 1001 (crab), 0110 (seal), 1010 (dolphins), 0100 (scuba diver), and 1100 (tugboat). I believe the codes involving three and four 1s are omitted due to the device being slightly imprecise (as is once in a while it gives the wrong sound) and it being hard to hit 3 or 4 switches consistently.
All this leads to the following question, which is reasonable for a high school level: Given a track system with n switches, how many possible sounds can it make?