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)$?
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:
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$.