Probability – Brain Teaser with Infinite Loop

markov chainsprobabilitypuzzle

I found this problem and I've been stuck on how to solve it.

A miner is trapped in a mine containing 3 doors. The first door leads to a tunnel that will take him to safety after 3 hours of travel. The second door leads to a tunnel that will return him to the mine after 5 hours of travel. The third door leads to a tunnel that will return him to the mine after 7 hours. If we assume that the miner is at all times equally likely to choose any one of doors, what is the expected length of time until he reaches safety?

The fact that the miner could be stuck in an infinite loop has confused me.
Any help is greatly appreciated.

Best Answer

Let $T$ be the time spent in the mine. Conditioning on the first door the miner chooses, we get $$ \mathbb{E}[T]=\frac{1}{3}\cdot3+\frac{1}{3}(5+\mathbb{E}[T])+\frac{1}{3}(7+\mathbb{E}[T])$$ so $$ \mathbb{E}[T]=5+\frac{2}{3}\mathbb{E}[T].$$ If $\mathbb{E}[T]$ is finite, then we can conclude that $\mathbb{E}[T]=15$.

To see that $\mathbb{E}[T]$ is finite, let $X$ be the number of times the miner chooses a door. Then $ \mathbb{P}(X\geq n)=(\frac{2}{3})^{n-1}$ for $n=1,2,3,\dots$, hence $$ \mathbb{E}[X]=\sum_{n=1}^{\infty}\mathbb{P}(X\geq n)=\sum_{n=1}^{\infty}\Big(\frac{2}{3}\Big)^{n-1}<\infty$$ And since $T\leq 7(X-1)+3$, we see that $\mathbb{E}[T]<\infty$ as well.