Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can someone help me with the following scenario, found on the Wikipedia page on Bayesian Inference:

Suppose there are two full bowls of cookies. Bowl #1 has 10 chocolate chip and 30 plain cookies, while bowl #2 has 20 of each. Our friend Fred picks a bowl at random, and then picks a cookie at random. We may assume there is no reason to believe Fred treats one bowl differently from another, likewise for the cookies. The cookie turns out to be a plain one. How probable is it that Fred picked it out of bowl #1?

I understand how to work out the probability when Fred picks one bowl and one cookie at random, which is:

\begin{align} P(H_1|E) &= \frac{P(E|H_1)\,P(H_1)}{P(E|H_1)\,P(H_1)\;+\;P(E|H_2)\,P(H_2)} \end{align}

\begin{align} = \frac{0.75 \times 0.5}{0.75 \times 0.5 + 0.5 \times 0.5} \ \ \ & = 0.6 \end{align}

What I would like to understand is how to work out the probability if Fred picks up a second cookie from the same bowl.

Can anyone help me with the formula?


share|cite|improve this question
You now want $P(E_1E_2|H_1)$ which is $\frac{30}{40}\times\frac{29}{39}$ and $P(E_1E_2|H_2)$ which is $\frac{20}{40}\times\frac{19}{39}$ etc. – Dilip Sarwate Jan 4 '12 at 16:51
up vote 1 down vote accepted

The only thing that changes when Fred picks two cookies is that E is "Fred picks a plain cookie and then (say) another plain cookie". So we have $$ P(E|H_1) = \frac{30}{40} * \frac{29}{39} = \frac{29}{52} $$ $$ P(E|H_2) = \frac{20}{40} * \frac{19}{39} = \frac{19}{78} $$ These are simply the probability for each bowl of picking a plain cookie, and then picking another plain cookie from the remaining cookies. Now we can use the same formula, $$ P(H_1|E) = \frac{P(E|H_1)P(H_1)}{P(E|H_1)P(H_1) + P(E|H_2)P(H_2)} $$ $$ = \frac{\frac{29}{52} \times 0.5}{\frac{29}{52} \times 0.5 + \frac{19}{78} \times 0.5} = \frac{87}{125} $$ As a sanity check, we expect this to be greater than 0.6 since he picked another plain cookie and the first bowl has more plain cookies - and indeed, $87/125 = 0.696 > 0.6$ .

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.