Probability of an insect to die in Z days 
Halsey placed 6 moths in a container. The probability that any moth will die the next day is $1/3$. After $Z$ days, all moths died. What is the expected value of $Z$? Solve with at least 4 decimal places.

I have been thinking of it. Looking for possible answer but I always end up with different answers. At first, my answer is 11. Then it changed to 8. Can you give me a formula please?
 A: There are two interesting approaches to the problem. One is a recursive method I developed in this answer, and one uses the idea of order statistics; I detail the latter below as it is less demanding of calculations.
The lifetime of a given moth is given by a geometric random variable $X_i$ ($1\le i\le6$) not supported on 0, with success parameter (death rate) $\frac13$; its pdf is $\frac13(2/3)^{x-1}$ and $P(X_i<x)=1-(2/3)^{x-1}$. We are looking for $E(X_{(6)})$, the expectation of the longest-surviving moth's lifetime.
For $X_{(6)}$ to be less than $x$, all the $X_i$ (which are independent) must be less than $x$, so $P(X_{(6)}<x)=P(X_i<x)^6=(1-(2/3)^{x-1})^6$. Then $P(X_{(6)}\ge x)$ is just the complement of this, or $1-(1-(2/3)^{x-1})^6$.
It is a very interesting fact that $E(X)$ where $X$ is an integer-valued positive random variable is equal to $\sum_{x=1}^\infty P(X\ge x)$. Thus
$$E(X_{(6)})=\sum_{x=1}^\infty(1-(1-(2/3)^{x-1})^6)=\sum_{x=0}^\infty(1-(1-(2/3)^x)^6)$$
$$=\sum_{x=0}^\infty(6(2/3)^x-15(2/3)^{2x}+20(2/3)^{3x}-15(2/3)^{4x}+6(2/3)^{5x}-(2/3)^{6x})$$
and we are left with adding and subtracting geometric series, which is very easy:
$$=\frac6{1-(2/3)}-\frac{15}{1-(2/3)^2}+\frac{20}{1-(2/3)^3}-\frac{15}{1-(2/3)^4}+\frac6{1-(2/3)^5}-\frac1{1-(2/3)^6}$$
$$=\frac{11934063}{1824095}=6.5425\text{ (4 d.p.)}$$
For the generalised problem with $n$ moths and $p$ chance for a given moth to die the next day, the expected number of days for all moths to die is
$$\sum_{k=1}^n\binom nk\frac{(-1)^{k+1}}{1-(1-p)^k}$$
