Problem 5
Let and be positive integers with and an even number. Let lamps labelled be given, each of which can be either on or off. Initially all the lamps are off. We consider sequences of steps: at each step one of the lamps is switched (from on to off or from off to on). Let be the number of such sequences consisting of steps and resulting in the state where lamps through are all on, and lamps through are all off. Let be the number of such sequences consisting of steps, resulting in the state where lamps through are all on, and lamps through are all off, but where none of the lamps through is ever switched on. Determine .
Step 1 of 3: Characterize N-sequences and M-sequences by switch-count parities
In plain words
Starting from all lamps off, a lamp ends on if and only if it is switched an odd number of times, and off if and only if it is switched an even number of times.
Detailed analysis
Write a -step sequence as where and . The set (of size ) consists of sequences in which every appears an odd number of times and every appears an even number of times; the subset (of size ) consists of sequences in which every appears an odd number of times and no element of appears at all (with since and is even).