discrete puzzles
medium | discrete |
In a circle are light bulbs numbered 1 through n, all initially on. At time t, you examine bulb number t, and if it’s on, you change the state of bulb t + 1 (modulo n); i.e., you turn it off if it’s on, and on if it’s off. If bulb t is off, you do nothing. Prove that if you continue around and around the ring in this manner, eventually all the bulbs will again be on.
It doesn't matter what the rules are, only thing that matters is that all bulbs should not go off!
Suppose every orientation of light bulbs & position of current pointer (t modulo n) forms a different state. Since all bulbs don’t go off, we must repeat a state after finite number of steps. Also notice that every state has a unique pre-state. Suppose the two states are at time T1 & T2. Notice that at time 0 all bulbs are on. Thus moving backwards from both states, we arrive at T2-T1, where all bulbs are on again.