Sie sind auf Seite 1von 6

Stat 430: Probability Fall 2010

Guessing Which Box

In the lectures, we have discussed several versions of the box guessing problem. Detailed solu-
tions are given here.

1. Suppose there are three similar boxes. Box i contains i white balls and one black ball,
i = 1, 2, 3. Suppose I mix up the boxes and then pick one at random. Then I pick a ball at
random from the box and show you the ball. I offer you a prize if you can guess correctly
what box it came from.

Which box would you guess if the ball drawn is white and what is your chance of guessing
right?

Solution: An intuitively reasonable guess is Box 3, because the most likely explanation of
how a white ball was drawn is that it came from a box with a large proportion of whites. To
confirm this, using the Bayes’ rule

P (Box i and white) P (Box i)P (white | Box i)


P (Box i| white) = = P3
P (white) j=1 P (Box j)P (white | Box j)
1 i
3 · i+1 12 i
= 1 1 1 2 1 3 = · (i = 1, 2, 3)
3 · 2 + 3 · 3 + 3 · 4
23 i + 1

gives the following posterior probabilities:

i 1 2 3
P (Box i| white) 6/23 8/23 9/23

So Box 3 is the most likely explanation of a white ball.

2. Consider again the same three boxes as above. Suppose I pick a box. then I pick a ball at
random and show you the ball. Which box would you guess if the drawn ball is white, and
what is your chance of guessing right?

Solution:

The wording of this problem is identical to the wording of the previous one except that it
doesn’t assume that I am equally likely to pick any one of the three boxes. If you assign prior
probabilities πi for I picking box i, i = 1, 2, 3, then you can obtain the posterior probabilities
by Bayes’ rule:
i
πi · i+1
P (Box i | white) = 1 3, i = 1, 2, 3.
π1 · 2 + π2 · 23 + π3 · 4

1
Thus, given that a white ball was drawn, to maximize your chance of guessing correctly you
should guess box i for whichever i maximizes πi · i/(i + 1). Which i this is depends on the
πi . The probabilities in question are now clearly a matter of your opinion about how I picked
the box. There remains the problem of how to assign the prior probabilities πi . This is a
tricky business, as it depends on psychological factors, such as whether or not you think I am
deliberately trying to make it hard for you to guess, and if so what strategy you think I am
using.

We now consider randomized strategies.

3. Consider a game as above where I pick one of the three boxes, then you guess which box I
picked after seeing the color of a ball drawn at random from the box. Then you learn whether
your guess was right or wrong. Suppose we play the game over and over, replacing the ball
drawn and mixing up the balls between plays. Your objective is to guess the box correctly as
often as possible.

(a) Suppose you know that I pick a box each time at random (probability 1/3 for each
box). And suppose you adopt the strategy of guessing the box with highest posterior
probability given the observed color, as described in Example 1, in case the observed
color is white. About what proportion of the time do you expect to be right over the
long run?
Solution:
As in Example 1,

i 1 2 3
P (Box i & white) 1/6 2/9 1/4
P (Box i & black) 1/6 1/9 1/12
P (Box i | white) 6/23 8/23 9/23
P (Box i | black) 6/13 4/13 3/13
Since P (Box i | white) is largest when i = 3 and P (Box i | black) is largest when i = 1,
the strategy is to guess Box 3 when a white ball is drawn and guess Box 1 when a black
ball is drawn. The probability of guessing correctly is

P (Box 3 and white) + P (Box 1 and black) = 5/12.

(b) Could you do any better by another guessing strategy? Explain.


Solution:
Suppose your strategy is to guess box i with probability pi (i = 1, 2, 3; p1 + p2 + p3 = 1)
whenever a white ball is drawn, and suppose I am picking each box with probability 1/3.

2
Then in cases where a white ball is drawn, the probability that you guess correctly is
6 8 9 9 3 1
p1 + p2 + p3 = − p1 − p2 .
23 23 23 23 23 23
Clearly the probability of your guessing correctly is greatest when p3 = 1; that is when
you guess Box 3 every time that you see a white ball. A similar argument for the case
where a black ball is drawn shows that the probability of your guessing correctly is
greatest when you guess Box 1 every time that you see a black ball.
(c) Suppose you use guessing strategy found in a), but I was in fact randomizing the choice
of the box each time, with probabilities (1/2, 1/4, 1/4) instead of (1/3, 1/3, 1/3). Now
how would your strategy perform over the long run?
Solution:
Here P (Box 1) = 1/2, P (Box 2) = 1/4, P (Box 3) = 1/4, so that

i 1 2 3
P (Box i & white) 1/4 1/6 3/16
P (Box i & black) 1/4 1/12 1/16
P (Box i | white) 12/29 8/29 9/29
P (Box i | black) 12/19 4/19 3/19
If you continue to use the strategy found in a), i.e. guess Box 3 if a white ball is seen,
and guess Box 1 if a black ball is seen, then the probability of guessing correctly is

P (Box 3 and white) + P (Box 1 and black) = 7/16.

(d) Suppose you knew I was either randomizing with probabilities (1/3, 1/3, 1/3), or with
probabilities (1/2, 1/4, 1/4). How could you learn which I was doing? How should you
respond, and how would your response perform over the long run?
Solution:
If you are convinced that I am using either the (1/3, 1/3, 1/3) strategy or the (1/2, 1/4, 1/4)
strategy, then you can decide which one it is by observing the long-run proportion of
trials that your guesses are correct. If I am using the (1/3, 1/3, 1/3) strategy then, by the
frequency interpretation of probability, the proportion of trials that you guess correctly
should be approximately 5/12, while if I am using the (1/2, 1/4, 1/4) then this proportion
should be closer to 7/16. If I am in fact using the (1/2, 1/4, 1/4) picking strategy, you
can improve upon the guessing strategy found in a) as follows: Since P (Box i | white) is
largest when i = 1 and P (Box i | black) is largest when i = 1, the strategy is to always
guess Box 1. The probability of guessing correctly is then
1
P (Box 1) = .
2

3
Remark: If you’re not sure at all what strategy I am using, you can determine it
approximately, as follows: Suppose I am using a (π1 , π2 , π3 ) strategy to pick the boxes,
and suppose you decide that you will always pick (say) Box 1 when you see a white ball,
Box 2 when you see a black ball. It is possible for you to determine my strategy, provided
you can keep track of the proportion of trials where a white ball was chosen from Box
1 and the proportion of trials where a black ball was chosen from Box 2. (This you can
do, because you can see the color of the ball drawn, and you are told whether your guess
is correct.) By the frequency interpretation of probability, these two proportions should
in the long run approximate the probabilities
1 1
P (Box 1 and white) = · π1 and P (Box 2 and black) = · π2
2 3
respectively. Thus you should be able to determine (approximately) the values π1 and
π2 (and hence π3 ).

4. The question now arises: What randomizing strategy should I use to make it as hard as
possible for you to guess correctly? Consider what happens if I use the (6/23, 9/23, 8/23)
strategy.

(a) What box should you guess if you see a black ball?
Solution:
The prior probabilities (of the boxes that I pick) are as follows:

i 1 2 3
πi 6/23 9/23 8/23
Use Bayes’ rule
1
P (Box i and black) πi ·i+1
P (Box i | black) = = 1
P (black) π1 · 2 + π2 · 13 + π3 · 1
4

to determine the posterior probabilities:


i 1 2 3
P (Box i and black) 3/8 3/8 1/4
So you should guess Box 1 or 2. For either choice, P (you guess correctly | black) = 3/8.
(b) What box should you guess if you see a white ball?
Solution:
Use Bayes’ rule
i
P (Box i and white) πi ·i+1
P (Box i | white) = = 1
P (white) π1 · 2 + π2 · 23 + π3 · 3
4

to determine the posterior probabilities:

4
i 1 2 3
P (Box i and white) 1/5 2/5 2/5
[You can use P (white) = 1 − P (black) = 15/23.] So you should guess Box 2 or 3. For
either choice, P (you guess correctly | white) = 2/5.
(c) What is your overall chance of winning?
Solution:

P (guess correctly) = P (guess correctly | black)P (black)


+P (guess correctly | white)P (white)
3 8 2 15 9
= · + · = .
8 23 5 23 23
This is your chance of winning, no matter which of the two best choices you make in
each case. For instance, you could simply always guess Box 2, in which case the event
of a win for you is the same as the event that I pick Box 2.
To see why the probability of your guessing correctly is at most 9/23 whatever your
strategy may be, suppose that your strategy whenever a black ball is drawn is to guess
Box i with probability pi . Then

P (guess correctly | black) = p1 P (Box 1 | black) + p2 P (Box 2 | black)


+p3 P (Box 3 | black)
3 3 1 3 1 3
= p1 + p2 + p3 = − p3 ≤ .
8 8 4 8 8 8
Similarly, whatever your strategy whenever a white ball is drawn,
2
P (guess correctly | white) ≤ .
5
Therefore

P (guess correctly) = P (guess correctly | black)P (black)


+P (guess correctly | white)P (white)
3 8 2 15 9
≤ · + · = .
8 23 5 23 23
Remark: So with this strategy, your chance of winning is at most 9/23, no matter what
you do. Moreover, you have a strategy which guarantees you this chance of winning, no
matter what randomization I use. It is the following:
• If black, guess 1 with probability 18/23, 2 with probability 5/23, and 3 with proba-
bility 0.
• If white, guess 1 with probability 0, 2 with probability 11/23, and 3 with probability
12/23.

5
(d) Check that using this strategy, you win with probability 9/23, no matter what box I
pick.
Solution:

P (guess correctly | Box 1)


= P (guess 1 | black & Box 1)P (black & Box 1 | Box 1)
+P (guess 1 | white & Box 1)P (white & Box 1 | Box 1)
18 1 1 9
= · +0· = .
23 2 2 23
9 9
Similarly P (guess correctly | Box 2) = 23 and P (guess correctly | Box 3) = 23 .

Remark: According to the above analysis, I can limit your chance of winning to 9/23
by a good choice of strategy, and you can guarantee that chance of winning by a good
choice of strategy. The fraction 9/23 is called the value of the above game, where it
is understood that the payoff to you is 1 for guessing correctly, 0 otherwise. Optimal
strategies of the type discussed above and a resulting value can be defined for a large
class of games between two players called zero-sum games.

Das könnte Ihnen auch gefallen