Finding the number of white balls in a box given the probability of selection

59 Views Asked by At

Assume there are two boxes: box A contains $x$ white balls and $y$ black balls, box B contains exactly 6 white balls and 3 black balls. We randomly choose either box A or box B, then randomly sample a ball from the chosen box. The ball turns out to be black. We then perform a second sample of one ball: if we do this with replacement, then the probability of the second ball also being black is $\frac{13}{30}$ and if we perform sampling without replacement the probability is $\frac{17}{50}$. The task is to find $x$
My idea is to compute 2 probabilities: $$P(\text{a black ball is drawn}|\text{prior to that a black ball was drawn with replacement})$$ $$P(\text{a black ball is drawn}|\text{prior to that a black ball was drawn without replacement})$$ Let me show the reasoning for the second one and then the other will be analogous:
$$P(\text{a black ball is drawn}|\text{prior to that a black ball was drawn without replacement})=\frac{P(\text{a black ball is drawn and prior to that a black ball was drawn without replacement})}{P(\text{a black ball was drawn})}$$ $$P(\text{a black ball was drawn})=P(\text{a black ball was drawn from the first box})+P(\text{a black ball was drawn from the second box})=\frac{1}{2}\cdot\frac{y}{x+y}+\frac{1}{2}\cdot\frac{3}{9}={\frac{1}{2}\cdot\left(\frac{y}{x+y}+\frac{1}{3}\right)}$$ By the same logic $$P(\text{a black ball is drawn and prior to that a black ball was drawn without replacement})={\frac{1}{2}\cdot\left(\frac{y(y-1)}{(x+y)(x+y-1)}+\frac{1}{12}\right)}$$ So, the probability is $$\frac{\frac{y(y-1)}{(x+y)(x+y-1)}+\frac{1}{12}}{\frac{y}{x+y}+\frac{1}{3}}=\frac{17}{50}$$ Doing the same for the probability with replacement we get $$\frac{\frac{y^2}{(x+y)^2}+\frac{1}{9}}{\frac{y}{x+y}+\frac{1}{3}}=\frac{13}{30}$$ I graphed this system of equations for $x>0$ and $y>0$ and obtained the only solution of $x=y=3$. However, I am not sure that this is the correct approach as I was not able to analytically solve the system. Is my reasoning here correct and if it is, is there a faster way of arriving at this answer?