Let $ n$ and $ k$ be positive integers with $ k \geq n$ and $ k \minus{} n$ an even number. Let $ 2n$ lamps labelled $ 1$, $ 2$, ..., $ 2n$ be given, each of which can be either [i]on[/i] or [i]off[/i]. 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 $ N$ be the number of such sequences consisting of $ k$ steps and resulting in the state where lamps $ 1$ through $ n$ are all on, and lamps $ n \plus{} 1$ through $ 2n$ are all off.

Let $ M$ be number of such sequences consisting of $ k$ steps, resulting in the state where lamps $ 1$ through $ n$ are all on, and lamps $ n \plus{} 1$ through $ 2n$ are all off, but where none of the lamps $ n \plus{} 1$ through $ 2n$ is ever switched on.

Determine $ \frac {N}{M}$.


[i]Author: Bruno Le Floch and Ilia Smilga, France[/i]
1. **Define the sets \( S_N \) and \( S_M \):**
   - \( S_N \) is the set of sequences of \( k \) steps that result in lamps \( 1 \) through \( n \) being on and lamps \( n+1 \) through \( 2n \) being off.
   - \( S_M \) is the subset of \( S_N \) where none of the lamps \( n+1 \) through \( 2n \) is ever switched on.

2. **Count the sequences in \( S_M \):**
   - In \( S_M \), only lamps \( 1 \) through \( n \) are switched. Each of these lamps must be switched an odd number of times to end up on.
   - Since \( k \) is the total number of steps and \( k \geq n \), we need to distribute \( k \) steps among \( n \) lamps such that each lamp is switched an odd number of times.
   - Let \( 2m_i + 1 \) be the number of times lamp \( i \) is switched, where \( m_i \) is a non-negative integer. Then, the total number of steps is:
     \[
     \sum_{i=1}^n (2m_i + 1) = k
     \]
     Simplifying, we get:
     \[
     2 \sum_{i=1}^n m_i + n = k \implies \sum_{i=1}^n m_i = \frac{k - n}{2}
     \]
   - The number of ways to distribute \( \frac{k - n}{2} \) among \( n \) lamps is given by the binomial coefficient:
     \[
     \binom{\frac{k - n}{2} + n - 1}{n - 1}
     \]

3. **Count the sequences in \( S_N \):**
   - For each sequence in \( S_M \), we can replace any even number of occurrences of a lamp \( i \) with the corresponding lamp \( n+i \) to get a sequence in \( S_N \).
   - If lamp \( i \) is switched \( 2m_i + 1 \) times, there are:
     \[
     \sum_{j=0}^{m_i} \binom{2m_i + 1}{2j} = 2^{2m_i}
     \]
     ways to choose which occurrences to replace with \( n+i \).
   - The total number of ways to do this for all \( n \) lamps is:
     \[
     \prod_{i=1}^n 2^{2m_i} = 2^{2 \sum_{i=1}^n m_i} = 2^{k - n}
     \]

4. **Establish the ratio \( \frac{N}{M} \):**
   - Since each sequence in \( S_M \) corresponds to \( 2^{k - n} \) sequences in \( S_N \), we have:
     \[
     \frac{N}{M} = 2^{k - n}
     \]

The final answer is \( \boxed{2^{k - n}} \).