1. In a small town, there are three bakeries. Each of the bakeries bakes twelve cakes per day. Bakery 1
has two different types of cake, bakery 2 three different types, and bakery 3 four different types. Every
bakery bakes equal amounts of cakes of each type.
You randomly walk into one of the bakeries, and then randomly buy two cakes.
(a) What is the probability that you will buy two cakes of the same type?
(b) Suppose you have bought two different types of cake. Given this, what is the probability that you
went to bakery 2?
Solution: (a) Define the events Fi = {choose bakery i}, and E = {buy different cakes}. Then P(Fi ) = 13 ,
and we compute the conditional probabilities
6 2
6
P(E|F1 ) = 112 =
2
11
2
3 · 41 8
P(E|F2 ) = 12 =
2
11
3 2
6· 9
P(E|F3 ) = 121 =
2
11
By the law of total probability,
1 6 8 9 23
P(E) = + + = .
3 11 11 11 33
10
Therefore P(buy same type) = 33 .
(b) By Bayes,
P(F2 ) 8
P(F2 |E) = P(E|F2 ) =
P(E) 23
2. An assembly line produces a large number of products, of which 1% are faulty in average. A quality
control test correctly identifies 98% of the faulty products, and 95% of the flawless products. For every
product that is identified as faulty, the test is run a second time, independently.
(a) Suppose that a product was identified as faulty in both tests. What is the probability that it is,
indeed, faulty?
(b) What if the quality control test is only performed once?
Solution: Let
F = the event that a product is faulty,
E1 = the event that the first test result is “faulty”
E2 = the event that the second test result is “faulty”
Then, P(F ) = 1% and, since the second test is independent of the first,
P(E1 ∩ E2 |F ) = P(E1 |F )P(E2 |F ) = 0.982
P(E1 ∩ E2 |F c ) = P(E1 |F c )P(E2 |F c ) = 0.052