You have four switches that could be on or off that are configured in a 2x2 grid. You are given an initial configuration that is random and you are blindfolded.
(a) Can you possibly find the configuration where they are all on? (trivial, consider the 16 possible combinations)
(b) The switches are now in a 2x2 grid still. Each turn you are allowed to hit any number of the switches on/off, but at the end of each turn the switches rotate a random number of positions. Now is it possible to find the configuration where they are all on?
Pretend that a light goes on when all switches are on or all switches are off.
Let's attribute these $2$ states to group N, and split the remaining $14$ states to groups ABCD:
The purpose is to find a sequence of operations that will bring any state in groups ABCD to a state in group N:
Let's define these operations, from which we will perform one at each turn:
Let's define the order of operations, at the end of which the light will be on:
So by performing the sequence of operations XYXZXYX, you are guaranteed to reach one of the two designated states at some point during the sequence, regardless of the initial state of the grid.