[Math] Probability of balls drawn with replacement

bayes-theorembinomial distributionprobabilityprobability distributions

We have two bags, Bag A has 40 red balls and 15 blue balls, Bag B has 40 blue balls and 10 red balls. One of these bags is selected at random and from it five balls are drawn at random, replacing each ball back into the bag after it has been drawn. The result is that we find 4 red balls and 1 blue. What is the probability that the selected bag was Bag A?

How to solve this problem? It is supposed to be solved using Bayes’ theorem and binomial distribution, but I failed to get the logic! Thank you very much for help!

Best Answer

Let $A, B$ be the events of picking bag $A$ and $B$ respectively, and let $X$ be the event of picking $4$ red balls and $1$ blue ball. We will assume that $\mathbb{P}(A)=\mathbb{P}(B)=\frac{1}{2}$.

We want to find $\mathbb{P}(A|X)$.

Now by Bayes' theorem we have that: $$\mathbb{P}(A|X)=\frac{\mathbb{P}(X|A)\mathbb{P}(A)}{\mathbb{P}(X)} $$ But we also have (since $B$ is the complement of $A$): $$\mathbb{P}(X)=\mathbb{P}(X|A)\mathbb{P}(A)+\mathbb{P}(X|B)\mathbb{P}(B) $$ Now let's calculate these probabilities.

We have a total of $55$ balls in bag $A$, of which $40$ are red and $15$ are blue, so when we pick one ball the probability that it is red or blue is $\frac{40}{55}$ or $\frac{15}{55}$ respectively. When picking $5$ balls of which $4$ are red and $1$ is blue, the blue ball can appear in five places, so we have: $$\mathbb{P}(X|A)=\left(\frac{40}{55}\right)^4\cdot \frac{15}{55}\cdot 5 $$ Similarly we get: $$\mathbb{P}(X|B)=\left(\frac{10}{50}\right)^4\cdot \frac{40}{50}\cdot 5 $$ So we find, filling in our results: $$\mathbb{P}(A|X)=\frac{\mathbb{P}(X|A)\cdot\frac{1}{2}}{\mathbb{P}(X|A)\cdot\frac{1}{2}+\mathbb{P}(X|B)\cdot\frac{1}{2}}=\frac{\mathbb{P}(X|A)}{\mathbb{P}(X|A)+\mathbb{P}(X|B)}=\frac{9600000}{9761051}\approx 0.9835 $$