Probability Question with Bayes Theorem

157 Views Asked by At

There are 2 companies, A and B. A pollutes 1/10 of the time while B pollutes 9/10 of the time. The difference between the discharge from the companies is that A usually has twice as many white jugs as black jugs while B has the exact reversed proportions.

Given a discharge with order - b, b, w, b, w, w, b, b, b, w, b - how likely is it that company A is the polluter?


I'm not sure if I'm plugging in things into Bayes Thm formula correctly, $ Pr(A|B) = \frac{Pr(B|A)Pr(A)}{Pr(B)} $

$ Pr((b,b,w,b,w,w,b,b,b,w,b)|company A) = \frac{Pr(company A|b,b,w,b,w,w,b,b,b,w,b)Pr(b,b,w,b,w,w,b,b,b,w,b)}{Pr(company A)} $

With $ Pr(company A) = 1/10 $, but I'm not sure how to calculate $ Pr(company A|b,b,w,b,w,w,b,b,b,w,b) $ and $ Pr(b,b,w,b,w,w,b,b,b,w,b) $. Also, once I have those calculations, do I just plug them in? I remember having to use to the law of total probability calculation but not sure how that factors in here.

Thanks!

2

There are 2 best solutions below

2
On BEST ANSWER

it's in the other direction. Let $X=(b,b,w,b,w,w,b,b,b,w,b)$. What you need is $Pr(A|X)$ as $X$ is given and the question is about the likely of being $A$. So you must use $$Pr(A|X)=\frac{Pr(X|A)Pr(A)}{Pr(X)}$$ where, using total probabilities $$Pr(X)=Pr(X|A)Pr(A)+Pr(X|B)Pr(B)$$ Also, $Pr(X|some\_company)$ is given by the proportion of black and white jugs. Said this we have that $Pr(b|A)=\frac{1}{3},Pr(w|A)=\frac{2}{3},Pr(b|B)=\frac{2}{3},Pr(w|B)=\frac{1}{3}$

1
On

First, it should be clear that the order of jug color is irrelevant, and that the only aspect of the data that is relevant (i.e. the "sufficient statistic") is the number of jugs of a particular color, say white. Thus, your data contains $n = 11$ jugs and $X = 4$ are white.

For convenience, let us define event $A$ to indicate that "Company A" is the polluter of the observed sample, and similarly $B$ indicates that "Company B" was the polluter. The prior probability (before you observed the data) is given as $$\Pr[A] = 1/10,$$ and similarly $\Pr[B] = 1 - \Pr[A] = 9/10$. We are also told that, given $A$ pollutes, the probability distribution of the number of white jugs $X$ is binomial with parameters $n$ and $p_A = 2/3$, whereas given $B$ pollutes, the probability distribution is binomial with parameters $n$ and $p_B = 1/3$; i.e., $$\Pr[X = x \mid A] = \binom{n}{x} (2/3)^x (1/3)^{n-x}, \quad x = 0, 1, \ldots, n, \\ \Pr[X = x \mid B] = \binom{n}{x} (1/3)^x (2/3)^{n-x}, \quad x = 0, 1, \ldots, n.$$ What we want to determine is the posterior probability $$\Pr[A \mid X = 4];$$ that is to say, given you observed the data, what is the chance $A$ generated it? Now the rest is simply an application of Bayes' theorem: $$\Pr[A \mid X = 4] = \frac{\Pr[X = 4 \mid A]\Pr[A]}{\Pr[X = 4]}.$$ The quantities in the numerator are easily calculated, but we don't yet have the denominator, which by the law of total probability, is $$\Pr[X = 4] = \Pr[X = 4 \mid A]\Pr[A] + \Pr[X = 4 \mid B]\Pr[B].$$ Thus we calculate $$\Pr[X = 4 \mid A] = \binom{11}{4}(2/3)^4 (1/3)^7 = \frac{1760}{59049}, \\ \Pr[X = 4 \mid B] = \binom{11}{4}(1/3)^4 (2/3)^7 = \frac{14080}{59049},$$ hence $$\Pr[A \mid X = 4] = \frac{(1760)(1/10)}{(1760)(1/10)+(14080)(9/10)} = \frac{1}{73} \approx 0.0136986.$$ Note that this result makes intuitive sense: the prior probability of $A$ is only $0.1$, and when $A$ occurs, the pollution tends to have more white jugs than black. Given that you observed a result that had more black jugs than white, your posterior belief about the likelihood of $A$ should be even lower than the prior belief.