2

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?

Parcly Taxel
  • 103,344
Heroic24
  • 317
  • "The probability that a moth will die next day is 1/3" Is that the probability for a single moth, or is it the probability that there is a dead moth in the glass next day? – Arthur Nov 02 '18 at 15:29
  • It is the probabilitythat there is a dead moth the next day, Arthur. – Heroic24 Nov 02 '18 at 15:33
  • And can there be two dead moths? – Arthur Nov 02 '18 at 15:34
  • Yes, because 1/3 is the probability that moths will die the next day. – Heroic24 Nov 02 '18 at 15:36
  • Eh... what? Ok, so you have six moths in the glass one day, and the next day, there is a 1/3 probability that there is a dead moth (and five alive moths) in the glass and 2/3 probability that all six are alive? Or does each moth have a 1/3 probability of dying, so that the next day there may be no dead moths, or they may all be dead, but most likely that exactly two of them are dead? Can you clarify what's going on here? – Arthur Nov 02 '18 at 16:09
  • So $1/3$ is the probability to die that holds for each individual moth, after each survival day? (The sentence "After Z days, all moths died." makes no sense / is not a definition of $Z$. What is $Z$ exactly? The minimal day, such that... ?! We have $Z\ge 1$ for instance, or we can have with positive probability $Z=0$?) – dan_fulea Nov 02 '18 at 16:10
  • I expect that (a) each moth has a $1/3$ probability of dying per day, and (b) $Z$ is defined as the number of days that have elapsed when the last moth dies. – Brian Tung Nov 04 '18 at 19:22

2 Answers2

1

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}$$

Parcly Taxel
  • 103,344
0

Here is a further way to attack the problem, if the problem is the following one.

We start with a population of $6$ moths in a box. The probability that each individual moth dies from one day to an other day is $1/3$. We ask for the expected mean time till no member of the population is alive.

I model this with a Markov chain with 6 states, $6, 5,4,3,2,1,0$, and the probability to pass from one state $k$ to a state $n$, $0\le n\le k$ is given by $$ a_{kn}= \binom kn\left(\frac 23\right)^n\left(\frac 13\right)^{k-n}\ . $$ We want to find the expectation $H_k$ of the hitting time of $0$, when we start in $k$. We need in fact $H_k$ only for $k=6$. But we compute using a recursion formula and a linear system all values $H_k$ for $k\in\{1,2,3,4,5,6\}$.

Using the markovian property, we write the system: $$ \begin{aligned} H_6 &= 1 + a_{66}H_6 + a_{65}H_5 + a_{64}H_4 + a_{63}H_3 + a_{62}H_2 + a_{61}H_1\\ H_5 &= 1 + a_{55}H_5 + a_{54}H_4 + a_{53}H_3 + a_{52}H_2 + a_{51}H_1\\ H_4 &= 1 + a_{44}H_4 + a_{43}H_3 + a_{42}H_2 + a_{41}H_1\\ H_3 &= 1 + a_{33}H_3 + a_{32}H_2 + a_{31}H_1\\ H_2 &= 1 + a_{22}H_2 + a_{21}H_1\\ H_1 &= 1 + a_{11}H_1\\ \end{aligned} $$ and we can already ask the computer for the solutions, here sage:

sage: p, q = 2/3, 1/3
sage: R = [1,2,3,4,5,6]
sage: A = matrix(QQ, 6, 6, [binomial(k,n)*p^n*q^(k-n) for k in R for n in R])
sage: v = vector(QQ, 6, [1,1,1,1,1,1])
sage: A
[    2/3       0       0       0       0       0]
[    4/9     4/9       0       0       0       0]
[    2/9     4/9    8/27       0       0       0]
[   8/81    8/27   32/81   16/81       0       0]
[ 10/243  40/243  80/243  80/243  32/243       0]
[  4/243  20/243 160/729  80/243  64/243  64/729]
sage: ( identity_matrix(6) - A ).inverse() * v
(3, 21/5, 477/95, 6963/1235, 319551/52117, 11934063/1824095)

and the last entry above is the needed value $$ H_6=\frac{11934063}{1824095} \approx 6.5424569444025\dots\ . $$


We may stop above. Here is one more observation on the matrix $A$ used above. It is natural to extend it by the $0$.th column, so we allow also $k,n$ to take the value zero in the above definition of $a_{k,n}$. Then one has for the extended $A$ the diagonalization:

$$A=SDS^{-1}\ ,$$ where $D$ is the diagonal matrix with entries $1,p,p^2,p^3,\dots$ (here $p=2/3$), and $S$ is the base change matrix with entries given by the binomial coefficients. $$ D= \begin{bmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &\dots\\ 0 & \frac{2}{3} & 0 & 0 & 0 & 0 & 0 & 0 & 0 &\dots\\ 0 & 0 & \frac{4}{9} & 0 & 0 & 0 & 0 & 0 & 0 &\dots\\ 0 & 0 & 0 & \frac{8}{27} & 0 & 0 & 0 & 0 & 0 &\dots\\ 0 & 0 & 0 & 0 & \frac{16}{81} & 0 & 0 & 0 & 0 &\dots\\ 0 & 0 & 0 & 0 & 0 & \frac{32}{243} & 0 & 0 & 0 &\dots\\ 0 & 0 & 0 & 0 & 0 & 0 & \frac{64}{729} & 0 & 0 &\dots\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{128}{2187} & 0 &\dots\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{256}{6561}&\dots\\ \vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\ddots \end{bmatrix}\ , $$ and $$ S= \begin{bmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \dots\\ 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \ddots \\ 1 & 2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & \ddots\\ 1 & 3 & 3 & 1 & 0 & 0 & 0 & 0 & 0 & \ddots\\ 1 & 4 & 6 & 4 & 1 & 0 & 0 & 0 & 0 & \ddots\\ 1 & 5 & 10 & 10 & 5 & 1 & 0 & 0 & 0 & \ddots\\ 1 & 6 & 15 & 20 & 15 & 6 & 1 & 0 & 0 & \ddots\\ 1 & 7 & 21 & 35 & 35 & 21 & 7 & 1 & 0 & \ddots\\ 1 & 8 & 28 & 56 & 70 & 56 & 28 & 8 & 1& \ddots\\ \ddots& \ddots& \ddots& \ddots& \ddots& \ddots& \ddots& \ddots& \ddots & \ddots \end{bmatrix} \ . $$ Knowing how to diagonalize (the extended) $A$, and the base change matrix $S$, with inverse $$ S^{-1} = \begin{bmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \ddots\\ -1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 &\ddots \\ 1 & -2 & 1 & 0 & 0 & 0 & 0 & 0 & 0 &\ddots\\ -1 & 3 & -3 & 1 & 0 & 0 & 0 & 0 & 0 &\ddots\\ 1 & -4 & 6 & -4 & 1 & 0 & 0 & 0 & 0 &\ddots\\ -1 & 5 & -10 & 10 & -5 & 1 & 0 & 0 & 0 &\ddots\\ 1 & -6 & 15 & -20 & 15 & -6 & 1 & 0 & 0 &\ddots\\ -1 & 7 & -21 & 35 & -35 & 21 & -7 & 1 & 0 &\ddots\\ 1 & -8 & 28 & -56 & 70 & -56 & 28 & -8 & 1&\ddots\\ \ddots&\ddots&\ddots&\ddots&\ddots&\ddots&\ddots&\ddots&\ddots&\ddots \end{bmatrix} $$ lets us solve the system in similar cases as a human... (Diagonally, we have in $S$ and in its inverse the (signed) binomial coefficients.)

(I started to type this some days ago, but was not convinced this is a good way to solve. Well, in this second i decided to submit, but next second...)

dan_fulea
  • 32,856