MathLabs

Problem 5

Let nn and kk be positive integers with k≥nk \ge n and k−nk - n an even number. Let 2n2n lamps labelled 1,2,…,2n1, 2, \ldots, 2n 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 NN be the number of such sequences consisting of kk steps and resulting in the state where lamps 11 through nn are all on, and lamps n+1n+1 through 2n2n are all off. Let MM be the number of such sequences consisting of kk steps, resulting in the state where lamps 11 through nn are all on, and lamps n+1n+1 through 2n2n are all off, but where none of the lamps n+1n+1 through 2n2n is ever switched on. Determine NM\dfrac{N}{M}.
Step 3 of 3: Count the preimages of each M-sequence and conclude N/M = 2^(k-n)
In plain words

For each y∈My \in \mathcal{M} in which lamp ii is switched li≥1l_i \ge 1 times, choosing any even-sized subset of those lil_i switches to lift to n+in+i gives 2li−12^{l_i-1} choices for each ii, and multiplying over i=1,…,ni=1,\ldots,n gives 2k−n2^{k-n}.

∣f−1(y)∣=∏i=1n((li0)+(li2)+⋯ )=∏i=1n2li−1=2∑i=1nli−n=2k−n  ⟹  NM=2k−n|f^{-1}(y)| = \prod_{i=1}^n \left(\binom{l_i}{0}+\binom{l_i}{2}+\cdots\right) = \prod_{i=1}^n 2^{l_i-1} = 2^{\sum_{i=1}^n l_i - n} = 2^{k-n} \implies \frac{N}{M} = 2^{k-n}
Detailed analysis

Fix y∈My \in \mathcal{M} where each i∈Ai \in A appears li≥1l_i \ge 1 times (with ∑i=1nli=k\sum_{i=1}^n l_i = k). A sequence x∈Nx \in \mathcal{N} satisfies f(x)=yf(x) = y if and only if, for each i∈Ai \in A, xx is obtained by replacing an even number of the lil_i occurrences of ii in yy by n+in+i. Since a set of size li≥1l_i \ge 1 has (li0)+(li2)+⋯=2li−1\binom{l_i}{0}+\binom{l_i}{2}+\cdots = 2^{l_i-1} subsets of even size, and the choices for i=1,…,ni = 1,\ldots,n are independent, ∣f−1(y)∣=∏i=1n2li−1=2∑i=1nli−n=2k−n|f^{-1}(y)| = \prod_{i=1}^n 2^{l_i-1} = 2^{\sum_{i=1}^n l_i - n} = 2^{k-n}. Summing over all y∈My \in \mathcal{M} gives N=2k−nMN = 2^{k-n} M, so NM=2k−n\dfrac{N}{M} = 2^{k-n}.