[Math] Distribution of time that a flashlight can operate

probabilityrandom variablessolution-verification

The lifetimes of batteries are independent exponential random variables , each having parameter $\lambda$. A flashlight needs two batteries to work. If one has a flashlight and a stockpile of n batteries, What is the distribution of time that the flashlight can operate?

What I have so far:

Let $Y$ be the lifetime of the flashlight; $Y_1=min(X_1,…,X_n)$ where $X_i$ is the lifetime of a battery ($1\le i\le n$), and $Y_2$ the second smallest of the $X_i$ (so $Y_1\le Y_2$)

I wanted to compute: $P[Y\le t]=P[Y_2\le k+m|Y_1\le m]$ where $k+m=t$ then we have that $$P[Y_2\le k+m|Y_1\le m]={P[Y_2\le k+m, Y_1\le m]\over P[Y_1\le m]}={P[Y_2\le k+m] P[Y_1\le m]\over P[Y_1\le m]}=P[Y_2\le k+m=t]$$ (because of the independence of the random variables)

So $P[Y_2\le t]=P[min(X_1,…,X_{j-1},X_{j+1},…X_n)\le t]$ (assuming $X_j=min(X_1,…,X_n)$) hence:

$$P[min(X_1,…,X_{j-1},X_{j+1},…X_n)\le t]= 1-P[min(X_1,…,X_{j-1},X_{j+1},…X_n)\ge t]=1-P[X_1\ge t,…,X_{j-1}\ge t, X_{j+1}\ge t,… X_n\ge t]=1-e^{(n-1)\lambda t}$$

I would really appreciate if you can tell me if this is the correct approach 🙂

Best Answer

Second answer, for a different interpretation: Batteries cannot die before they go into the flashlight. Because this interpretation involves both the minimum of two exponentials and the sum of several exponentials, it makes a more interesting problem than did the assumptions in my first answer. It is the interpretation suggested in Andre's note and used copper.hat's multiple integration.

Step 1: Wait for one of two initial batteries to fail. This waiting time is the minimum of two exponentials with failure rate $\lambda$, and hence $X_1$ ~ EXP($2\lambda$).

Step 2: Throw out dead battery, replace with new one. By the no-memory property, the one of the two batteries in the flashlight that did not die is as good as new. Waiting time for one of these two batteries to die is again $X_2$ ~ EXP($2\lambda$).

Last step $n-1$; Throw out dead battery, replace with $n$th (last remaining replacement) battery: Light goes out after additional time $X_{n-1}$ ~ EXP($2\lambda$).

Total time flashlight is lit is $T = X_1 + \dots + X_{n-1}$. This is the sum of $(n-1)$ exponentials, so $T$ ~ GAMMA($n-1,$ $2\lambda$). This is a gamma distribution with shape parameter $n-1$ and rate parameter $2\lambda.$ When the shape parameter is a positive integer the gamma distribution is sometimes called an Erlang distribution (especially in queueing theory).

Check: A previous answer, apparently using the same assumptions and with $n=3,$ has the CDF of the random variable $T$ as $F_T(x) = 1 - \exp(-2\lambda x)(1 + 2\lambda x),$ for $x > 0$. The form of the CDF does indeed get messier with increasing $n$, but the mean and variance are simple expressions in $n$ and $\lambda.$ In R, we easily verify (in one instance, anyhow) that this is a special case of the gamma (Erlang) distribution. Let $n = 3$, $\lambda = 1/15$, and $x = 1$. So this is the (small) probability that the flashlight goes dark by time 1. The code 'pgamma(1, 2, 2/15)' and the code '1 - exp(-2/15)*(1 + 2/15)' both return the probability 0.008136905. Also, 'qgamma(.5, 2, 2/15)' finds the exact median time the flaslhight burns to be 12.58760, and 'mean(rgamma(10^5, 2, 2/15))' approximates the mean as 14.97 (exact is 15).

Related Question