Stochastic Processes – Expected Number of Trips Until the Professor Gets Wet

markov chainsstochastic-processes

Many people have asked this umbrella question, but I can't seem to find an answer to my particular question. It is based on question 5 on this pdf.

I start with 4 umbrellas at home. I keep moving
between home and office. I take an umbrella with me only if it rains.
If it does not rain I leave the umbrella behind (at home or in the
office). It may happen that all umbrellas are in one place, I am at
the other, it starts raining and must leave, so I get wet.

Suppose the probability of rain is $p$. What is the expected number of trips until I get wet?

First, I follow the Markov approach and create states $S_i$, where $S_i$ means that I'm in a place with $i$ umbrellas. Then $i$ goes from $0$ to $4$. The Markov matrix is given by

$$ P = \begin{bmatrix}
0 & 0 & 0 & 0 & 1 \\
0 & 0 & 0 & 1-p & p \\
0 & 0 & 1-p & p & 0 \\
0 & 1-p & p & 0 & 0 \\
1-p & p & 0 & 0 & 0 \\
\end{bmatrix} $$

I then use this matrix to compute the expected number of trips to go from $S_4$ to $S_0$. I can work out the algebra, but it takes a very long time. I wonder if there's a shortcut?

Even then, I can't answer the question on the expected number of trips to get wet. Can I get a hint?

Furthermore, is there a way to generalize this to $N$ umbrellas?

Best Answer

Suppose that you have $N>0$ umbrellas, $0<p<1$ and for each nonnegative integer $i\le N$ let $E_i$ be the expected number of trips until you get wet when there are $i$ umbrellas at the place where you are. Then $$E_0=p+(1-p)(E_N+1)$$ and $$E_i=1+p E_{N-i+1}+(1-p) E_{N-i}$$ for each natural $i\le N$. This is a system of $N+1$ linear equations for $N+1$ variables, and I hope it has a unique solution. Maybe there is a general expression for it, but for $N=4$ the system should be easily solvable. Anyway, when we sum all equations and cancel the same terms, we obtain $pE_0=N+1$, so $E_0=\frac{N+1}{p}$, and thus $E_N=\frac{N+1-p}{p(1-p)}$.