(a) In this case, you should use Bayes Theorem to update your prior probabilities based on the observed color. If you observe a white ball, the posterior probabilities are:
P(Box 1 | white) = P(white | Box 1) * P(Box 1) / P(white) = (1/4)(1/3) / P(white)
P(Box 2 | white) = P(white | Box 2) * P(Box 2) / P(white) = (1/2)(1/3) / P(white)
P(Box 3 | white) = P(white | Box 3) * P(Box 3) / P(white) = (3/4)*(1/3) / P(white)
Normalized: P(Box 1 | white) ≈ 0.167, P(Box 2 | white) ≈ 0.333, P(Box 3 | white) ≈ 0.500
If you observe a black ball, the posterior probabilities are:
P(Box 1 | black) = P(black | Box 1) * P(Box 1) / P(black) = (3/4)(1/3) / P(black)
P(Box 2 | black) = P(black | Box 2) * P(Box 2) / P(black) = (1/2)(1/3) / P(black)
P(Box 3 | black) = P(black | Box 3) * P(Box 3) / P(black) = (1/4)*(1/3) / P(black)
Normalized: P(Box 1 | black) ≈ 0.500, P(Box 2 | black) ≈ 0.333, P(Box 3 | black) ≈ 0.167
Based on these posterior probabilities, you should guess Box 3 if I pick a white ball, and Box 1 if I pick a black ball. The overall probability of being correct can be calculated by averaging the probabilities of picking the correct box for both colors, weighted by how often each color appears.
P(correct) = P(correct | white) * P(white) + P(correct | black) * P(black)
P(white) = (1/4)(1/3) + (1/2)(1/3) + (3/4)*(1/3) = 1/2
P(black) = 1/2
P(correct | white) = 0.5 (guessing Box 3)
P(correct | black) = 0.5 (guessing Box 1)
P(correct) = (0.5)(1/2) + (0.5)(1/2) = 0.5
So your strategy is likely to be correct 50% of the time in this case.
(b) If I was randomizing with probabilities (1/4, 1/2, 1/4), your strategy from (a) would still be correct most of the time. The posterior probabilities can be updated the same way as in (a):
For white balls, the updated probabilities are:
P(Box 1 | white) ≈ 0.118
P(Box 2 | white) ≈ 0.471
P(Box 3 | white) ≈ 0.412
For black balls, the updated probabilities are:
P(Box 1 | black) ≈ 0.353
P(Box 2 | black) ≈ 0.471
P(Box 3 | black) ≈ 0.176
Your guessing strategy doesn't change, as you would still guess Box 3 for white balls and Box 1 for black balls. To calculate the overall probability of being correct with these new priors:
P(white) = (1/4)(1/4) + (1/2)(1/2) + (3/4)*(1/4) = 7/16
P(black) = 9/16
P(correct | white) = 0.412 (guessing Box 3)
P(correct | black) = 0.353 (guessing Box 1)
P(correct) = (0.412)(7/16) + (0.353)(9/16) ≈ 0.382
So in this case, your strategy would perform correctly about 38.2% of the time.
(c) If you knew I was randomizing with either set of prior probabilities, you could use a two-step approach. First, decide which set of prior probabilities is more likely based on the observed color. Then, use the same strategy as in (a) or (b) based on which set of priors you think is more likely.
In this case, it may be difficult to determine which set of prior probabilities is more likely based solely on the color of the balls. You might need additional information or more observations to make a confident decision. Until you can make that determination, you would likely stick to the initial guess of Box 3 for white balls and Box 1 for black balls, as outlined in (a) and (b).