question about poisson processes and gamma distribution So I'm working on a question. It reads "$100$ items are simultaneously put on a life test. Suppose the lifetimes of the individual items are indpendent exponential random variables with mean $200$ hours. The test will end when there have been a total of $5$ failures. If $T$ is the time at which the test ends, find $E(T)$ and $\text{Var}(T)$."
Since were talking about the sum of exponentially distributed random variables can I use the gamma formula for $E(X)$ with parameters $(n,\lambda)$?
 A: For $i=1,\ldots,100,$ let $X_i$ be the lifetime of the $i^{th}$ item. I don't think you need a sum. Here, $T=X_{(5)}$, the $5^{th}$ order statistic of this set of r.v.'s. That is, the fifth lowest value of these $100$ variables.
The probability density for the $k^{th}$ order statistic of $n$ iid r.v.'s, generally, is:
$$P(x_{(k)}=x) = \dfrac{n!}{1!(k-1)!(n-k)!}f(x)F(x)^{k-1}(1-F(x))^{n-k}$$
where, as usual, $f(x)$ is the pdf and $F(x)$ is the cdf of the r.v.'s. This can be verified by a simple combinatorial argument: to have $X_{(k)}=x$ there must be:


*

*one of the values equal to $x$

*$k-1$ of the values less than or equal to $x$

*$n-k$ of the values greater than $x$.


In our case, $X_i\sim \text{Exp}(1/200)$, so, with $\lambda=1/200,$ we have $f(x) = \lambda e^{-\lambda x}$ and $F(x) = 1 - e^{-\lambda x}$. Therefore,
$$P(X_{(5)}=x) = \dfrac{100!}{1!4!95!}\lambda e^{-\lambda x}\left(1-e^{-\lambda x}\right)^4 (e^{-\lambda x})^{95}.$$
\begin{align}
E(T) &= \int_{x=0}^{\infty} xP(X_{(5)}=x)\; dx \\
& \\
&= \int_{x=0}^{\infty} x\dfrac{100!}{4!95!}\lambda \left(1-4e^{-\lambda x} + 6e^{-2\lambda x} - 4e^{-3\lambda x} + e^{-4\lambda x}\right) e^{-96\lambda x}\; dx \\
& \\
&= \dfrac{100!}{4!95!} \left[-\left(\dfrac{x}{96} + \dfrac{1}{96^2\lambda}\right) e^{-96\lambda x} + 4\left(\dfrac{x}{97} + \dfrac{1}{97^2\lambda}\right) e^{-97\lambda x} - 6\left(\dfrac{x}{98} + \dfrac{1}{98^2\lambda}\right) e^{-98\lambda x} + 4\left(\dfrac{x}{99} + \dfrac{1}{99^2\lambda}\right) e^{-99\lambda x} - \left(\dfrac{x}{100} + \dfrac{1}{100^2\lambda}\right) e^{-100\lambda x} \right]_{x=0}^{\infty} \\
& \\
&= \dfrac{100!}{4!95!} \left[ - \dfrac{1}{96^2\lambda} + \dfrac{4}{97^2\lambda} - \dfrac{6}{98^2\lambda} + \dfrac{4}{99^2\lambda} - \dfrac{1}{100^2\lambda} \right] \\
& \\
&\approx 10.206.
\end{align}
Next, $E(T^2)$ can be similarly calculated and then you can use $Var(T)=E(T^2)-E(T)^2$.
A: Another method is to have separate r.v.'s for each inter-arrival time, so that, with $T_k$ being the time of the first failure out of $k$ items:
$$T = T_{100} + T_{99} + T_{98} + T_{97} + T_{96}.$$
Because of the memorylessness property of the exponential distribution, after each failure, for the ones that remain it is like starting over again before the next failure.
So, for $k=96,\ldots,100$ and with $\lambda = 1/200$,
\begin{align}
E(T_k) &= \int_{t=0}^{\infty} t\binom{k}{1}f(t)(1-F(t))^{k-1}\; dt \\
&\qquad\text{since we want $1$ of the $k$ items to fail at time $t$ and all others to have survived} \\
&= \int_{t=0}^{\infty} k\lambda t e^{-k\lambda t}\; dt \\
&= \left[\left(-t-\dfrac{1}{k\lambda}\right) e^{-k\lambda t}\right]_{t=0}^{\infty} \\
&= \dfrac{1}{k\lambda}.
\end{align}
Similarly,
\begin{align}
E(T_k^2) &= \int_{t=0}^{\infty} k\lambda t^2 e^{-k\lambda t}\; dt \\
&= \left[\left(-t^2 - \dfrac{2t}{k\lambda} - \dfrac{2}{k^2\lambda^2}\right) e^{-k\lambda t}\right]_{t=0}^{\infty} \\
&= \dfrac{2}{k^2\lambda^2}.
\end{align}
Therefore,
\begin{align}
E(T) &= \sum_{k=96}^{100} E(T_k) = \dfrac{1}{\lambda} \left(\dfrac{1}{100} + \dfrac{1}{99} + \dfrac{1}{98} + \dfrac{1}{97} + \dfrac{1}{96} \right) \\
& \\
Var(T) &= \sum_{k=96}^{100} Var(T_k) \qquad\text{since the $T_k$s are independent} \\
&= \sum_{k=96}^{100} \left(E(T_k^2) - E(T_k)^2\right) \\
&= \dfrac{1}{\lambda^2} \left(\dfrac{1}{100^2} + \dfrac{1}{99^2} + \dfrac{1}{98^2} + \dfrac{1}{97^2} + \dfrac{1}{96^2} \right).
\end{align}
These results should match the previous answer.
