Poisson Process Exercise A flashlight needs two batteries to be operational. Consider such a flashlight along with a set of $n$ functional batteries — battery $1$, battery $2$, $\ldots$ , battery $n$. Initially, battery $1$ and $2$ are installed. Whenever a battery fails, it is immediately replaced by the lowest numbered functional battery that has not yet been put in use. Suppose that the lifetimes of the different batteries are independent exponential random variables each having rate $\mu$. At a random time, call it $T$, a battery will fail and our stockpile will be empty. At that moment exactly one of the batteries — which we call battery $X$ — will not have failed. 


*

*What is $\mathbb P(X=n)$?

*What is $\mathbb P(X=1)$?

*What is $\mathbb P(X=i)$?

*Find $\mathbb E[T]$.

*What is the distribution of $T$.

 A: For each $i$, take $X_i$ as the lifetime of battery $i$ and $t_i$ as the time battery $i$ is installed. Observe $t_1=t_2=0$.
Assume battery $n$ occupies the flashlight with battery $j$ for some $1\leq j \leq n-1$.
Knowing battery $j$ occupies the flashlight at the moment battery $n$ is installed tells us a critical piece of information: $X_j+t_j>t_n$.
Therefore,
$$\begin{eqnarray*}\mathbb{P}(X=n)&=&\mathbb{P}\left(X_n+t_n>X_j+t_j\Big|X_j+t_j>t_n\right)\end{eqnarray*}$$ The exponential distribution is memoryless which means $$X_j-(t_n-t_j)\big|\{X_j>t_n-t_j\} \sim \exp(\mu)$$ Because battery lives are independent among distinct batteries, the joint distribution of the random vector $\left(X_j-(t_n-t_j),X_n\right)|\{X_j>t_n-t_j\}$ namely $f_{X_j-(t_n-t_j),X_n|\{X_j>t_n-t_j\}}$ factors as $f_{X_j-(t_n-t_j)|\{X_j>t_n-t_j\}}\times f_{X_n}$. So, $$\begin{eqnarray*}\mathbb{P}(X=n)&=&\mathbb{P}\left(X_n>X_j-(t_n-t_j)\Big|X_j>t_n-t_j\right) \\ &=& \int_0^{\infty}\int_0^x\mu^2\exp\{-\mu(x+y)\}\mathrm{d}y\mathrm{d}x \\ &=& \frac{1}{2}\end{eqnarray*}$$
This is your answer to 1. For question 2, notice that $X=1$ is equivalent to battery $1$ outliving all other $n-1$ batteries whose combined lifetime is $X_2 + \dots + X_n$ which possess an $\text{Erlang}\left(n-1,\mu\right)$ distribution. Since $X_1$ and $X_2+\dots +X_n$ are independent, $$\begin{eqnarray*}\mathbb{P}\left(X=1\right)&=& \mathbb{P}\left(X_1>X_2+\dots + X_n\right) \\ &=& \int_0^{\infty}\int_0^x \mu e^{-\mu x}\cdot \frac{\mu^{n-1} y^{n-2}e^{-\mu y}}{(n-2)!}\mathrm{d}y\mathrm{d}x \\ &=& \left(\frac{1}{2}\right)^{n-1} \end{eqnarray*}$$
Question 3 requires us to evaluate $\mathbb{P}(X=i)$ for each $i$. We already handled the cases when $i=1,n$ and from symmetry $\mathbb{P}(X=2)=\mathbb{P}(X=1)=\left(\frac{1}{2}\right)^{n-1}$. Now assume $3\leq i \leq n-1$.
$X=i$ says battery $i$ outlives all subsequent $n-i$ batteries as well as the other battery that already occupies the flashlight at time $t_i$. Suppose the other battery in the flashlight at time $t_i$ is battery $j$ where $1\leq j \leq i-1$.
Saying battery $j$ occupies the flashlight at time $t_i$ tells us $X_j+t_j>t_i$. Moreover, the time battery $j$ spends in the flashlight since battery $i$ has been installed is $X_j-(t_i-t_j)$. It follows that $$\begin{eqnarray*}\mathbb{P}\left(X=i\right) &=& \mathbb{P}\left(X_i>\left[X_j-(t_i-t_j)\right]+X_{i+1}+\dots + X_n\Big|X_j+t_j>t_i\right)\end{eqnarray*}$$ From memorylessness $X_j-(t_i-t_j)\Big|\{X_j>t_i-t_j\}\sim \exp(\mu)$ so with independence $$\left[X_j-(t_i-t_j)\right]+X_{i+1}+\dots + X_n\Big|\{X_j+t_j>t_i\}\sim \text{Erlang}(n-i+1,\mu)$$ We have $$\begin{eqnarray*}\mathbb{P}(X=i)&=&\int_0^{\infty} \int_0^x \mu e^{-\mu x}\cdot \frac{\mu^{n-i+1} y^{n-i}e^{-\mu y}}{(n-i)!}\mathrm{d}y\mathrm{d}x \\ &=& \left(\frac{1}{2}\right)^{n-i+1}\end{eqnarray*}$$ We conclude that $\mathbb{P}(X=i)=\left(\frac{1}{2}\right)^{n-1}$ when $i=1$ and $\mathbb{P}(X=i)=\left(\frac{1}{2}\right)^{n-i+1}$ when $2\leq i \leq n$.
For the last two parts, take $T_{i+1}$ as the time in which battery $i+1$ is installed, where $i\in \{2,...,n-1\}$. Again assume battery $i$ is installed with battery $j\in \{1,...,i-1\}$
Then $T_{i+1}-t_i=\min\{X_i,X_j-(t_i-t_j)\}$ and so $T_{i+1}-t_i\Big|\{X_j>t_i-t_j\}\sim \exp(2\mu)$. Evidently $T$ is the arrival time of the $(n-1)^{\text{st}}$ arrival in a Poisson process with rate $2\mu$. The distribution of $T$ is known as $\text{Erlang}(n-1,2 \mu)$ which has expected value $\frac{n-1}{2\mu}$.
