flashlight and n batteries The lifetimes of batteries are independent exponential random variables, each having
parameter . A flashlight needs 4 batteries to work. If one has a 
flashlight and a stockpile of n batteries, what is the expected time that the 
flashlight can operate?
I found out that in the end it becomes gamma distribution with the parameters (n-1 , 4lamda). now how do i expand this distribution, i am really bad with them.
 A: Let $T_i$ be the remaining lifetime of battery $i$, then $T_i\stackrel{\mathrm{iid}}\sim\operatorname{Exp}(\lambda)$. The flashlight fails when the first battery fails, so we want to find the distribution of the minimum of the $T_i$, that is, $T:=\bigwedge_{i=1}^4 T_i$. For $t>0$ we have
$$
\mathbb P(T>t) = \mathbb P\left(\bigwedge_{i=1}^4 T_i\right) = e^{-4\lambda t},
$$
so that $T\sim\operatorname{Exp}(4\lambda)$.
(It is a simple exercise to verify this consequence of the memoryless property for two exponential random variables and generalize for finite sums by induction.)
Since $4$ batteries are required to power the flashlight, its total lifetime is given by the time until $n-1$ failures (as then we will only have 3 left). Let $U_0=S_0$ and $S_m=\sum_{k=1}^m U_k$ for $m\geqslant 1$, where $U_k$ is the time of the $k^{\mathrm{th}}$ failure. Then the expected time until $n-1$ failures is
$$\mathbb E[S_{n-1}] = \mathbb E\left[\sum_{k=1}^{n-1}T_k\right] = \sum_{k=1}^{n-1}\mathbb E[T_k-T_{k-1}] = (n-1)\mathbb E[U_1] = \frac{n-1}{4\lambda}. $$
To find the distribution of $S_n$, let $f$ be the density of $U_1$, then $S_2$ has density
\begin{align}
g(t)&=(f\star f)(t)\\
&= \int_0^t f(s)f(t-s)\ \mathsf ds\\
&= \int_0^t \lambda e^{-\lambda s}\lambda e^{-\lambda(t-s)}\ \mathsf ds\\
&= \lambda^2 e^{-\lambda t} \int_0^t  \mathsf ds\\
&= (\lambda t)\lambda e^{-\lambda t}.
\end{align}
It can be verified by induction that the density of $S_n$ is
$$\frac{(\lambda t)^{n-1}}{(n-1)!}\lambda e^{-\lambda t}. $$
