Let $n$ and $k$ be positive integers such that $k \geq n$ and $k-n$ is an even number. Given $2n$ lamps, numbered from 1 to $2n$, each of which can be in an on or off state. Initially, all lamps are off. We consider a sequence of steps: a step consists of changing the state of one lamp (from on to off or from off to on).

Let $N$ be the number of sequences of $k$ steps that result in the lamps numbered from 1 to $n$ being on, and the lamps numbered from $(n+1)$ to $2n$ being off.

Let $M$ be the number of sequences of $k$ steps that result in the lamps numbered from 1 to $n$ being on, and the lamps numbered from $(n+1)$ to $2n$ being off, and in which none of the lamps numbered from $(n+1)$ to $2n$ are turned on at any point in the sequence.

Determine the value of the ratio $N / M$.
Eisenberger András's solution. $N / M=2^{k-n}$.

Let's establish a correspondence such that every sequence in $M$ corresponds to $2^{k-n}$ sequences in $N$ in such a way that every sequence in $N$ is obtained exactly once.

Take a sequence $m$ from $M$. (In this sequence, every lamp from 1 to $n$ is toggled an odd number of times.) Start following the steps of the sequence. When we would toggle a lamp (let it be the $i$-th lamp) that is also toggled later in $m$, we can proceed in two ways: toggle the $i$-th lamp or the $(n+i)$-th lamp, then continue to the next step. If the step is not of this type, i.e., we do not toggle this lamp again in $m$, we check how many times we have toggled the $i$-th lamp so far. If it has been toggled an even number of times, we toggle the $i$-th lamp now; if it has been toggled an odd number of times, we toggle the $(n+i)$-th lamp (here we have no choice). With this method, by the end, the $i$-th lamp will definitely be on, and the $(n+i)$-th lamp will definitely be off, since the $i$-th lamp appeared an odd number of times in the original sequence and also in this one, so we have toggled the $(n+i)$-th lamp an even number of times. At the same time, we have performed $k$ steps, just like in the original sequence, so the resulting sequence is an element of $N$.

During the creation of the sequence, we toggled the first $n$ lamps at least once, so there were $n$ steps where we toggled one of them for the last time, and the remaining $(k-n)$ steps were of the type where we had a choice. Thus, we have assigned $2^{k-n}$ elements of $N$ to each element of $M$. We only need to show that every element of $N$ is obtained exactly once. This is true because if we take a sequence from $N$ and replace every toggle of the $(n+i)$-th lamp with a toggle of the $i$-th lamp, we get the one and only sequence in $M$ from which this $N$-sequence can be obtained. And it is also clear how to decide at each choice point to obtain this sequence.