# Probability question - test two boxes

There are two unlabeled boxes, A and B. Each of the two boxes has 100 balls. Box A has 90 red balls and 10 white balls, and Box B has 20 red balls and 80 white balls. These two boxes have equal chance to be picked. Now a box is randomly picked and then a series of tests if performed on the box in order to make a good guess whether this box is A or B.

In each test, one ball is randomly picked from the box, its color is checked and then it's put back. Three tests were conducted, and 2 red balls were picked in the first two test and 1 white ball was picked in the third test.

Is the box more likely to be Box A or Box B ? How likely is the guess correct?

I tried to solve it this way:

A: it's box A
B: it's box B
R1: red on 1st test
R2: red on 2nd test
W3: white on 3rd test

P(A) = P(R1|A) . P(R2|A) . P(W3|A)

= 90/100 . 90/100 . 10/100

P(B) = P(R1|B) . P(R2|B) . P(W3|B)

= 20/100 . 20/100. 80/100


Thanks.

The product $P(R1|A) P(R2|A) P(W3|A)$ is not $P(A)$ but is $P(R1~R2~W3|A)$. In fact you know that $P(A)=1/2$. What you want is $$P(A|R1R2W3) = \frac{P(R1~R2~W3|A) P(A)}{P(R1~R2~W3)}$$ Similarly $P(B|R1~R2~W3)$.
Now $$P(R1~R2~W3) = P(R1~R2~W3|A) P(A) + P(R1~R2~W3|B) P(B)$$
You have already calculated $P(R1~R2~W3|A)$ and $P(R1~R2~W3|B)$ Now complete the calculations.
Here is the final answser: $$P(A|R1~R2~W3) = 81/113\\ P(B|R1~R2~W3) = 32/113$$