2
$\begingroup$

A person randomly chooses a battery from a store which has 80 batteries of type A and 260 batteries of type B. Battery life of type A and type B batteries are exponentially distributed with average life of 8.0 years and 13.0 years, respectively. If the chosen battery lasts for 5 years, what is the probability that the battery is of type A?

Define random variable $X$ and $Y$ such that $$ X = \begin{cases} 1, & \text{if the battery if of type A} \\ 0, & \text{if the battery if of type B} \end{cases} $$ $$Y = \text{Lifespan of a battery}$$

In the answer sheet they have used $f_{Y|X}(y) = \lambda e^{-\lambda y}$, where they put $y = 5$ to get the answer. But I studied that the probability of a continuous random variable at a given point is $0$. So I did it like this $P(X = 1 | Y \ge 5)$ to find the answer. Why they have done that and what's the correct way to solve this question? I am really confused between these concepts.

$\endgroup$
2
  • 2
    $\begingroup$ Basically you are asking why $\Pr[Y=5]$ was used even though it is supposed to be $\Pr[Y=5]=0$ owing to it being a continuous rv, aren't you? $\endgroup$ Commented Jul 11 at 6:03
  • $\begingroup$ The density of $Y$ given $X$ should be $f_{Y|X=x}(y)=xe^{-yx}$ with $X$ being $1/8$ with probability $80/340$ and $1/13$ with probability $260/340$. $\endgroup$
    – Xi'an
    Commented Jul 11 at 7:40

3 Answers 3

6
$\begingroup$

The question wording leaves a little bit of room for interpretation, but I would assume that they mean that the chosen battery lasts exactly 5 years. Not: after 5 years, it's still going.

If you do as you suggested, and calculate $p(X=1|Y\geq5)$, then you condition on the lifespan being greater than or equal to 5 years. But this doesn't make sense if we assume that the lifespan was exactly 5 years. It does of course make sense under the second interpretation that I mentioned, that we know the battery is still alive after 5 years, but we don't yet know when it will fail.

Now, you are correct that the probability of a continuous random variable taking any one specific value is 0. That is why we have to deal with probability densities in this situation, which specify how concentrated the probability is around a given value (more formally, the probability density function is the derivative of the cumulative distribution function, which is valid for continuous variables). So we get: $$ p(X=1|Y=5) = \frac{p(Y=5|X=1)p(X=1)}{p(Y=5|X=0)p(X=0)+p(Y=5|X=1)p(X=1)} $$ $$ =\frac{\frac{1}{8}e^{-\frac{1}{8}\times5} \times \frac{80}{340}}{\frac{1}{13}e^{-\frac{1}{13}\times5}\times \frac{260}{340} + \frac{1}{8}e^{-\frac{1}{8}\times5} \times \frac{80}{340}} $$ $$ =\frac{\frac{1}{8}e^{-\frac{1}{8}\times5} }{\frac{1}{13}e^{-\frac{1}{13}\times5}\times \frac{260}{340} \times \frac{340}{80} + \frac{1}{8}e^{-\frac{1}{8}\times5} } $$ $$ =\frac{\frac{1}{8}e^{-\frac{1}{8}\times5} }{\frac{1}{4}e^{-\frac{1}{13}\times5} + \frac{1}{8}e^{-\frac{1}{8}\times5}} $$ $$ =\frac{1}{\frac{\frac{1}{4}e^{-\frac{1}{13}\times5}} {\frac{1}{8}e^{-\frac{1}{8}\times5}} +1} $$ $$ =\frac{1}{2 e^{-5(\frac{1}{13}-\frac{1}{8})} +1} $$ $$ = 1 - 2 e^{-5(\frac{1}{13}-\frac{1}{8})} $$ $$ \approx 0.2822 $$

$\endgroup$
2
  • 1
    $\begingroup$ You used the wrong parametrization. $\lambda = 1/\mu$, so you must use $1/8$ and $1/13$! $\endgroup$ Commented Jul 11 at 10:28
  • 1
    $\begingroup$ Ah yes, of course. Sloppy of me - thanks for spotting that! $\endgroup$ Commented Jul 11 at 11:59
4
$\begingroup$

Ruben gave a very good answer with the lifespan of five years, exactly, which seems to be what the people who wrote the question wanted. But .... I think that's kind of a weird way to think of the question. Not weird in terms of learning the stats and the math, but weird on a practical basis.

First, how exactly? Rounded to the year? Day? or what? If we round to anything then we are no longer dealing with exact measure and we no longer have a probability of 0. If this is some sort of common battery situation (like in some household appliance) then I'm guessing we'd be interested in rounding to the year. And if the authors of the question meant some tighter rounding, why say "years"? Why not say "1500 days" or whatever?

Second, who would care about the exact time? Maybe there are some situations, but I think that, in the vast majority of cases, the interest would be in "five years or more", so I would interpret the question as you did.

$\endgroup$
2
$\begingroup$

Ruben and Peter Flom have given the relevant practical answers but I want to point out that conditioning on events with probability 0 is in fact not always a well defined undertaking. If you have no experience with measure theory I'd recommend against looking too much into it. Just using the likelihood should almost always work. Here's Wikipedia if you do want to get into it:

https://en.wikipedia.org/wiki/Conditional_probability#Conditioning_on_an_event_of_probability_zero

https://en.wikipedia.org/wiki/Borel%E2%80%93Kolmogorov_paradox

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.