[Math] Probability question with interarrival times

probability

(Why did the chicken cross the road?) A chicken wants to cross a single-lane
road where the cars arrive according to a Poisson process with rate $\lambda$. She needs at least $k$ minutes to cross the road safely, so she will have to wait until she sees a gap of at least $k$ between the oncoming cars. If the gap between the car that just arrived and the next one is at least $k$ then she starts crossing the road immediately. Let $T$ denote the random time she needs to wait by the road.

Find the expected time needed to cross the road.

Best Answer

The chicken waits between the passages of car $i-1$ and car $i$ without crossing the road if and only if no gap between car $n-1$ and car $n$ is greater than $k$, for any $n\leqslant i$. Thus, $$ T=\sum_{i=1}^{+\infty}D_i\cdot[D_1\leqslant k,\ldots,D_i\leqslant k], $$ where $(D_i)_{i\geqslant 1}$ is i.i.d. with exponential distribution of parameter $\lambda$. By independence, $$ \mathrm E(D_i;D_1\leqslant k,\ldots,D_i\leqslant k)=a^{i-1}b,\quad a=\mathrm P(D\leqslant k),\quad b=\mathrm E(D;D\leqslant k), $$ hence $\mathrm E(T)=b/(1-a)$. One knows that $1-a=\mathrm P(D\gt k)=\mathrm e^{-\lambda k}$, and $$ b=\int_0^kx\cdot\lambda\mathrm e^{-\lambda x}\cdot\mathrm dx=\frac{1-(1+\lambda k)\mathrm e^{-\lambda k}}\lambda. $$ Finally, $$ \mathrm E(T)=\frac{\mathrm e^{\lambda k}-1-\lambda k}\lambda. $$

Related Question