Conditional probability, bayes formula

80 Views Asked by At

Suppose there are 2 bags (A and B). In the A 30% of the blue balls, 40% red and 30% black. In the B 30% of red, 50% of blue and 20% of yellow. Each bag was taken out by a ball. The first ball was red and the second was blue. What is the probability that the first bag was A.

My solution is as follows, but it seems to me that I'm wrong.

Let P(red)=P(r), P(blue)=P(b). It's obvious that P(A)=P(B).

$$P(A|(r,b))=\frac{P((r,b)|A)P(A)}{P(r,b)}=\frac{P(r|A)P(b|A)P(A)}{P((r,b)|A)P(A)+P((r,b)|B)P(B)}=\frac{P(r|A)P(b|A)}{P(r|A)P(b|A)+P(r|B)P(b|B)}=\frac{0.4\cdot0.3}{0.4\cdot0.3+0.3\cdot0.5}=0.444444$$

2

There are 2 best solutions below

0
On BEST ANSWER

A ball was taken from each bag.

We want to find the probability for taking a red from bag A (and therefore a blue from bag B) given that a red and a blue ball were taken out; let us represent that as: $\newcommand{\pair}[2]{\langle{#1,#2}\rangle} \mathsf P(\pair r b \mid \pair r b \cup\pair b r )$ , where the pair $\pair ab$ represents that the colours taken from bag $A$ and $B$ respectively (not first and second bag).

(Whichever bag from which the red ball was taken is the "first bag".)

In the A 30% of the blue balls, 40% red and 30% black.

In the B 30% of red, 50% of blue and 20% of yellow.

$$\begin{align}\mathsf P(\pair r b \mid \pair r b \cup\pair b r )~&=~\dfrac{\mathsf P(\pair r b )}{\mathsf P(\pair r b )+\mathsf P(\pair b r )} \\[1ex] &=~ \dfrac{0.40\cdot 0.50}{0.40\cdot 0.50 + 0.30\cdot 0.30}\end{align}$$

0
On

There are some slightly confusing notational issues

For example when you say $P((r,b)\mid A)$, this seems to mean a red ball was taken from the first bag and then a blue ball was taken from the second bag, given the first bag being bag A.

But you then say this is equal to $P(r\mid A)P(b\mid A)$. Here $P(b\mid A)$ seems to mean a blue ball was taken from the second bag, given the first bag being bag A. If so, it should be $0.5$ not $0.3$.

There is a similar issue with $P((r,b)\mid B) = P(r\mid B)P(b\mid B)$. This will change your result.