# Intuition for minimising expected time in Poisson Process

Trains arrive at a station according to some Poisson process with rate $\lambda$.
If we take the train from that station then it takes a time $r$ to get home, measured from the time at which you enter the train to arrive home. If you walk from the train station to home then it takes a time $w$ to arrive home. Suppose we have a policy that when arriving at the train station, we wait a time $s$ and if the train has not arrived, then we walk home.
What is the intuition where we need only consider the cases $s=0$ and $s=\infty$ when minimising the expected wait time? I know that we can take cases $w>\frac{1}{\lambda} - r$ and $w<\frac{1}{\lambda} - r$
I computed the expected wait time $\mathbb{E}(T)$ where $T$ is the total time to be $$\mathbb{E}(T) = r + \frac{1}{\lambda} + e^{-\lambda s}(w-\frac{1}{\lambda}-r).$$

Let $S_1$ be the arrival time of the first train, then $S_1\sim\mathsf{Exp}(\lambda)$. Assuming $r<w$, we have $$T = (S_1+r)\cdot\mathsf1_{\{S_1<s\}} +(s+w)\cdot\mathsf 1_{\{S_1\geqslant s\}}.$$ For $0<t<s+r$ we have $$\mathbb P(T\leqslant t) = \mathbb P(S_1+r\leqslant t) = \mathbb P(S_1\leqslant t-r) = 1-e^{-\lambda(t-r)},$$ and $$\mathbb P(T=s+w) = \mathbb P(S_1>s) = e^{-\lambda s}.$$ It follows that the distribution of $T$ is $$F_T(t) = \left(1 - e^{-\lambda(t-r)}\right)\cdot\mathsf 1_{[0,s+r)}(t) + \left(1- e^{-\lambda s}\right)\cdot \mathsf 1_{[s+r),s+w)}(t) + \mathsf 1_{[s+w,\infty)}(t),$$ and hence \begin{align} E[T] &= \int_0^\infty (1-F_T(t))\ \mathsf dt\\ &= \int_0^{s+r} e^{-\lambda(t-r)}\ \mathsf dt + \int_{s+r}^{s+w}e^{-\lambda s}\ \mathsf dt + \\ &= \frac1\lambda(e^{r\lambda} - e^{-s\lambda}) + (w-r) e^{-s\lambda}. \end{align}
• Why do you consider the case when $t<s+r$? I considered the integral by splitting it up into the intervals $t<s$ and $t\geq s$. – Mr. Bromwich I May 10 '18 at 9:14
• Also another part of the question asked what happens to $E(T)$ when $w>r+\frac{1}{\lambda}$ or when $w < r+\frac{1}{\lambda}$ so I'm not sure how it'd apply to your answer – Mr. Bromwich I May 10 '18 at 9:20
• @Mr.BromwichI I think it is safe to assume that $r<w$ since surely one cannot walk faster than a train - and if one could, why bother waiting for the train? – Math1000 May 10 '18 at 9:39