There are 2 bags with 30 candies. One has 15 red/yellow and one has 10 red/10 yellow/10 purple. You pick a bag randomly, and pick 2 candies...

527 Views Asked by At

There are 2 bags with 30 candies.

One has 15 red/15 yellow (Bag A) and one has 10 red/10 yellow/10 purple (Bag B). You pick a bag randomly, and pick 2 candies. The store has 100 of bag A, and 200 of Bag B. Given that both candies are red, what is the probability you picked bag Bag B?

So trying to use Bayes theorem:

Pr(Bag B|two candies were strawberry)= Pr(two strawberries|bag b)*Pr(bag b)/Pr(two candies are strawberry)

My solution isn't correct. Was hoping for some insight as to why.

Plugging in:

$$\frac{\frac{10}{30}\frac{9}{29}\frac{2}{3}}{\frac{25}{60}\frac{24}{59}}=\frac{2}{29}*\frac{59}{10}=\frac{59}{145}$$

2

There are 2 best solutions below

0
On

It seems as if my idea was right, just the numbers used in the denominator were wrong

I didn't take into account the ways I could pick a red candy (since we have two bags with them.

The denominator should be:

$$\frac13\left(\frac{15}{30}\frac{14}{29}\right)+\frac{2}{3}\left(\frac{10}{30}\frac{9}{29}\right)$$ according to the law of total probability.

0
On

Let $R$ be the event that both candies are red. Let $A$ be the event that bag $A$ is selected. Let $B$ be the event that bag $B$ is selected. We wish to find $P(B \mid R)$. The conditional probability that bag $B$ was selected given that two red candies were selected is \begin{align*} P(B \mid R) & = \frac{P(B \cap R)}{P(R)}\\ & = \frac{P(B)P(R \mid B)}{P(A)P(R \mid A) + P(B)P(R \mid B)}\\ & = \frac{\frac{200}{300} \cdot \frac{10}{30} \cdot \frac{9}{29}}{\frac{100}{300} \cdot \frac{15}{30} \cdot \frac{14}{29} + \frac{200}{300} \cdot \frac{10}{30} \cdot \frac{9}{29}}\\ & = \frac{\frac{2}{29}}{\frac{7}{87} + \frac{2}{29}}\\ & = \frac{\frac{6}{87}}{\frac{13}{87}}\\ & = \frac{6}{13} \end{align*} Note that you calculated the probability of $B$ incorrectly in the numerator since $200$ of the $300$ bags in the store are of type $B$ and that you did not take into account the two events that lead to the selection of two red candies in the denominator.