# bayes / conditional probability question

The derivation of the conditional probabilities given in the solution puzzle me.

There are two identical boxes in front of you. In box X, there are 3 white balls and 7 black balls. In box Y, there are 7 white balls and 3 black balls. You randomly reach one of the boxes and draw three balls from it one by one. If every time you draw a ball you find it is white, at which of the following stages is the probability the highest that you chose box X?

(A) You drew one ball, and it was white.
(B) You drew two balls, and they were both white.
(C) You drew three balls, and they were all white.


• When sampling more than one ball from a box, is sampling done with or without replacement? Dec 20, 2020 at 6:58

Assuming draws w/o replacement based on the answers given, and I'll focus on the second question to form an example for others. Let $$B$$ be the chosen box ($$x$$ or $$y$$), the probability of selecting box $$x$$ in case we draw two white balls is as follows:

$$P(B=x|2W)=\frac{P(2W|B=x)P(B=x)}{P(2W|B=x)P(B=x)+P(2W|B=y)P(B=y)}$$

Here, $$P(B=x)=P(B=y)=1/2$$, so they cancel each other in numerator and denominator. And, $$P(2W|B=x)$$ is choosing two white balls when the box is $$x$$. There are two ways to think:

1. Probability of choosing the first balls as white, and then choosing the second ball as white, which is:

$$P(2W|B=x)=P(W_1|B=x)P(W_2|B=x,W_1)=\frac{3}{10}\times \frac{2}{9}$$

This way, we'll have $$P(2W|B=y)=\frac{7}{10}\times\frac{6}{9}$$, and therefore: $$P(B=x|2W)=\frac{{3\over 10}\times{2\over 9}}{{3\over 10}\times{2\over 9}+{7\over 10}\times{6\over 9}}=\frac{1}{8}$$

1. There are $${3 \choose 2}$$ ways to choose white balls from box $$x$$, and $${10\choose 2}$$ ways to choose any two balls from it. So, the probability of choosing two white balls is $${3\choose 2}/{10\choose 2}$$. This is similar for box $$y$$, with numerator being equal to $${7\choose 2}$$ and the denominator is the same since we have 10 balls in it, too.

$$P(B=x|2W)=\frac{{3\choose 2}/{10 \choose 2}}{{3\choose 2}/{10 \choose 2}+{7\choose 2}/{10 \choose 2}}=\frac{{3\choose 2}}{{3\choose 2}+{7\choose 2}}=\frac{1}{8}$$