2 Balls in a Bag
Jane Street
There are 2 balls in a bag. Each ball is either white or black with equal probability. You draw one of the balls out randomly and you see it is white. You put it back and draw again - and it comes up white again. You return the ball back and draw randomly for the third time. What's the chance you draw a white ball again?
Answer
This is a conditional probability problem - we are asked about probability of an event given a previous event that gives further information about the setup. Recall the Bayes' conditional probability formula for two events A and B: $$P(A|B)=\frac{P(B|A)\cdot P(A)}{P(B)}$$Where $P(A|B)$ means probability of event A given that event B occured. What does all this have to do with our question?
We are told that the two balls can be either black or white with probability 0.5. That means both balls can be white, both can be black, or we can have one black and other white. Depending on which scenario we're in, the probability of drawing a white ball will be different. The fact that we already drew two white balls tells us something about which scenario we're in: e.g it's definitely not the case that we have two black balls - otherwise we couldn't have drawn a white one. It's also more likely that we are in a double white ball case than one black-one white case.
Now let's formalise these intuitions. Before drawing any balls, we would say the probability of drawing a white ball is: $$P(w)=P(w|2w)\cdot P(2w)+P(w|2b)\cdot P(2b)+ P(w|mix)\cdot P(mix)$$After already drawing two white balls, we condition the probability on this event. Denoting 'ww' the event of drawing two white balls, we have: $$P(w|ww)=P(w|2w)\cdot P(2w|ww)+P(w|2b)\cdot P(2b|ww)+ P(w|mix)\cdot P(mix|ww)$$Now we must evaluate each of these terms. Notice we can immediately discard the middle term, as if both balls are black, probabolity of drawing a white one is 0, so $P(w|2b)=0$. We know straight away that if both balls are white, chance of drawing another white is 1, i.e. $P(w|2w)=1$. Also, if one is white and other is black, the chance of getting a white on any draw is $\frac{1}{2}$, so chance of getting white on two independent draws is $\frac{1}{2}\cdot \frac{1}{2}=\frac{1}{4}$. Now we use Bayes' formula to find $P(2w|ww)$ - chance of both balls being white given we drew 2 white; and $P(mix|ww)$ - chance of having one black one white in the bag given we drew two whites.
Applying Bayes' rule to the first term, we have: $$P(2w|ww)=\frac{P(ww|2w)\cdot P(2w)}{P(ww)}$$We already said $P(ww|2w)=1$. $P(2w)$ is the standalone probability of having 2 white balls in the bag before any draws. We are told in the question the chance of either ball being white is $\frac{1}{2}$, so chance of both being white is $\frac{1}{2}\cdot \frac{1}{2}=\frac{1}{4}$.
Now as we stated before, $P(ww)$ - the chance of drawing two white balls independently (before any info about content of the bag) - depends on the scenario we are in. Therefore we find it as: $$P(ww)=P(ww|2w)\cdot P(2w)+P(ww|2b)\cdot P(2b)+ P(ww|mix)\cdot P(mix)$$We already found that $P(ww|2w)=1$, $P(ww|2b)=0$, $P(ww|mix)=\frac{1}{4}$. Now chance of having two black balls is same as the chance of having two white balls, so $P(2b)=P(2w)=\frac{1}{4}$ as we found before. Then the chance of having a mix is $P(mix)=1-P(2b)-P(2w)=\frac{2}{4}$ since these are the only options so they must add up to 1. Bringing these together we find that $P(ww)=\frac{3}{8}$. And therefore $P(2w|ww)=\frac{1\cdot \frac{1}{4}}{\frac{3}{8}}=\frac{2}{3}$
Now the last piece is finding $P(mix|ww)$. Bages' rule says: $$P(mix|ww)=\frac{P(ww|mix)\cdot P(mix)}{P(ww)}$$We've already found all these components, so we calculate: $$P(mix|ww)=\frac{\frac{1}{4}\cdot \frac{1}{2}}{\frac{3}{8}}=\frac{1}{3}$$We' ve now found all we need. Phiew. Bring it all together: $$P(w|ww)=\frac{1}{4}\cdot \frac{2}{3} + \frac{2}{3}\cdot 1=\frac{3}{4}$$