A random walk variant

42 Views Asked by At

There are $n$ lights. Initially, all of them are off. Every second, a random light will be switched (on to off, off to on). When the lights are all off again, the process ends. What is the expected end time of this process?

Let $F(n, k)$ denotes the expected end time of a game with $n$ lights, $m$ of them are initially on. We have:

$$ \begin{cases} F(n, 0) = 0 \\ F(n, n) = F(n, n-1) + 1 \\ F(n, m) = \frac{m}{n} F(n, m-1) + \frac{n-m}{n} F(n, m + 1) + 1 \end{cases} $$

Solving this linear system gives $F(n, 1) = 2^n - 1$. Therefore, the answer is $F(n, 1) + 1 = 2^n$.

The result looks surprisingly simple. However, I don't know how it comes out, nor can I prove it. (I just calculated $F(1, 1)$ to $F(30, 1)$ and found out the pattern)