Download All You Ever Wanted to Know About Probability Theory, but Were

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Statistics wikipedia , lookup

History of statistics wikipedia , lookup

Inductive probability wikipedia , lookup

Birthday problem wikipedia , lookup

Ars Conjectandi wikipedia , lookup

Probability interpretations wikipedia , lookup

Probability wikipedia , lookup

Transcript
All You Ever Wanted to Know About
Probability Theory, but Were Afraid to Ask
1
Theoretical Exercises
1. Let p be a uniform probability on a sample space S. If S has n elements, what is the probability
of an element x of S ?
Solution : Because p is a probability on S, we have p(s1 ) + . . . + p(sn ) = 1. As p is taken a
uniform probability, all p(si ) are equal, so p(si ) = n1 for all elements si of S.
2. Take the sample space to be S = {a, b, c, d, e, f } and suppose the following are given:

 p(a) = p(e) = 2 · p(c)
p(b) = p(d) = p(f )

p(c) = 0.05
Calculate all elementary probabilities, i.e. calculate p(a), p(b), p(c), . . .
Solution : We know p(c) = 0.05, so p(a) = 2 · p(c) = 0.1. Likewise, p(e) = 0.1. Now, observe
p(b) + p(d) + p(f ) = 1 − p(a) − p(c) − p(e)
= 1 − 0.25
= 0.75
As p(b) = p(d) = p(f ), they each have to be one third of 0.75, i.e. p(b) = p(d) = p(f ) = 0.25
3. Take the sample space to be S = {a, b, c, d, e, f } and suppose the following are given:

 p(a) = p(b) = p(c) = 0.1
p(d) = 2 · p(e)

p(e) = 2 · p(f )
Calculate p(d), p(e) and p(f ).
Solution : Observe the following:
p({d, e, f }) =
=
=
=
1 − p({a, b, c})
1 − p(a) − p(b) − p(c)
1 − 0.3
0.7
1
Furthermore, notice that p(d) = 2 · p(e) = 2 · 2 · p(f ) = 4 · p(f ) Hence
p(d)
p(e)
+ p(f )
0.7
=
4p(f )
=
2p(f )
= + p(f )
=
7p(f )
So p(f ) = 0.1 and thus p(e) = 0.2 and p(d) = 0.4.
2
Uniform Probability
1. In a class, there are 8 boys and 10 girls. A class council of 3 pupils is chosen. Calculate the
probability that the council consists of
(a) 3 boys
(b) exactly 2 boys and 1 girl
(c) at least 1 boy
Assume that all pupils are equally popular.
Solution : There are 18 pupils in the class. 3 are chosen. This can be done in C(18, 3) = 816
ways.
(a) Choosing 3 boys out of a group of 8 and 0 girls out of a group of 10 can be done in
C(8, 3) · C(10, 0) ways. So
p(“3 boys”) =
C(8, 3) · C(10, 0)
56
=
= 0.068627
C(18, 3)
816
(b) Choosing 2 boys out of a group of 8 and 1 girl out of a group of 10 can be done in
C(8, 2) · C(10, 1) ways. So
p(“2 boys, 1 girl”) =
C(8, 2) · C(10, 1)
280
=
= 0.0343137 . . .
C(18, 3)
816
(c) Choosing at least 1 boy is equivalent to choosing any combination but 3 girls. in other
words:
p(“at least 1 boy”) = 1 − p(“3 girls”)
Therefore
p(“at least 1 boy”) = 1 −
C(10, 3) · C(8, 0)
120
=1−
= 0.852941 . . .
C(18, 3)
816
2
2. In a box there are 9 white pieces of chalk and 1 red one. When taking 2 pieces at random, what
is the probability that it is exactly 1 white and 1 red piece.
Solution :The total number of ways in which 2 pieces can be taken out of 10 is C(10, 2).
Taking 1 white piece out of 9 and 1 red piece out of the only red piece available can be done in
C(9, 1) · C(1, 1) ways. Therefore
p(“1 red, 1 white”) =
C(9, 1) · C(1, 1)
9·1
=
= 0.2
C(10, 2)
45
You can also see it as
p(“1 red, 1 white”) = p(“first a red, then a white”) + p(“first a white, then a red”)
1 9
9 1
=
· +
·
10 9 10 9
= 0.2
Which is, of course, the same value. One method is no better than the other. You should follow
whatever line of thought appeals most to you. As long as it is correct, mathematics has no
preferences.
3. Out of a deck of 52 cards, we draw a card at random.
(a) What is the probability to draw a spade ?
(b) What is the probability to draw a jack or a king ?
(c) What is the probability to draw an ace or a hart ?
Solution :
(a) Out of 52 cards in a deck, 13 are spades. Hence
p(♠) =
#♠0 s
13
=
= 0.25
#cards
52
(b) Out of 52 cards in a deck, 4 are jacks, 4 are kings. None are both, so we can simply add
them. In other words,
p(Jack or King) = p(Jack) + p(King)
=
=
#Jacks #Kings
+
#cards
#cards
4
4
+
52 52
= 0.1538 . . .
3
(c) Out of 52 cards in a deck, 4 are aces, 13 are harts. But the ace of harts is both, so we have
to deduct this one card to avoid double counting, i.e. :
p(A or ♥) = p(A) + p(♥) − p(A♥)
#A
#♥
1
+
−
#cards #cards #cards
4
13
1
=
+
−
52 52 52
= 0.3076 . . .
=
4. Out of a deck of 52 cards, we draw 2 cards at random (without replacement).
(a) What is the probability to draw a pair of kings ?
(b) What is the probability to draw a pair ?
(c) What is the probability that these cards are of consecutive face value, but not necessary of
the same suit ? (Note that aces are both low and high.)
Solution
(a) There are 4 kings in a deck of cards. Of these you choose 2, i.e. C(4, 2). The total number
of taking 2 cards out of a deck of 52 is C(52, 2), so the probability is
p(pair of kings) =
C(4, 2)
= 0.00425488 . . .
C(52.2)
(b) There are as much pairs of kings as there are pairs of jacks. This is of course true for any
face value. So the probability is just 13 times the probability of pair of kings, i.e.
p(any pair) =
13 · C(4, 2)
= 0.0588235 . . .
C(52.2)
(c) This is the same reasoning as the one used in the calculation of the number of straits in
5 hand poker. We proceed as follows: the first card can be any of the 52 in the deck.
The second card can then be either one higher or one lower, so there will be 8 choices for
the second card. But choosing first say 4♦ and then 5♦ results in the same hand as first
choosing 5♦ and then 4♦, so we counted everything twice. Therefore we have to divide by
2!:
52 · 8 · 2!1
p(2 consecutive cards) =
= 0.03921568 . . .
C(52.2)
4
3
Bernoulli Trials
1. The probability that a certain IC is faulty is 0.5%. How large is the probability that out of 1000
randomly chosen and tested IC’s that
(a) exactly 10 IC’s are faulty
(b) at most 3 IC’s are faulty
Solution : Note that we are dealing with a Bernoulli trial because
• There are only two possible outcomes “faulty” or “not faulty”.
• The fact that one IC is faulty is independent of the fact if another one is faulty.
• The probability of an IC being faulty is the same for all, namely 0.5%.
Therefore, we have,
p(“10 IC’s are faulty”) = C(1000, 10) · (0.005)10 · (0.995)990
= 0.01799 . . .
At most 3 IC’s are faulty means that either 3,2,1 or no IC’s are faulty. Hence
p(“at most 3 IC’s are faulty”)
= p(3 IC’s are faulty) + p(2 IC’s are faulty)
+p(1 IC’s are faulty) + p(0 IC’s are faulty)
= C(1000, 3) · (0.005)3 · (0.995)997 + C(1000, 2) · (0.005)2 · (0.995)998
+C(1000, 1) · (0.005)1 · (0.995)999 + C(1000, 0) · (0.005)0 · (0.995)1000
= 0.006654 + 0.033437 + 0.083929 + 0.140303
= 0.264323
2. A slightly biased coin (p(tail) = 0.51) is thrown 4 times
(a) How large is the probability that ”tails” shows up exactly 2 times ?
(b) How large is the probability that ”tails” shows up exactly 3 times ?
(c) Compare a) and b) with a fair coin.
Solution : Again , this is a Bernoulli trial because
• There are only two possible outcomes “heads” or “tails”.
• The outcome of one coin toss does not influence the outcome of another one.
• The probability of “heads” or “tails” is the same for each toss.
Note that the total number of trials is 4 and the “success rate” is 0.51, so the “failure rate” is
0.49 . This allows us to make the following calculations:
5
(a) The probability of throwing 2 times tails and 2 times heads with a biased coin is
p(2 Tails biased) = C(4, 2) · (0.51)2 · (0.49)2 = 0.37470006
(b) The probability of throwing 3 times tails and 1 time heads with a biased coin is
p(3 Tails biased) = C(4, 3) · (0.51)3 · (0.49)1 = 0.25999696
(c) As an unbiased coin has a slightly lower probability to get “tails” the probability of getting
three times “tails” will be a little lower and that of getting only two times “tails” will be a
little higher. Indeed
p(2 Tails unbiased) = C(4, 2) · (0.5)2 · (0.5)2 = 0.375 > p(2 Tails biased)
and
p(3 Tails unbiased) = C(4, 3) · (0.5)3 · (0.5)1 = 0.25 < p(3 Tails biased)
Note that the difference between this biased coin and the unbiased coin is very small. This
is to be expected as the biased coin is only a 51% to 49% coin as opposed to a straight
50/50, i.e. the coin is only slightly biased.
4
Miscellaneous Exercises
1. John, Peter, Martin and Henry are sitting behind one another in a classroom on the first, second,
third or fourth row. A “row” can only seat one of them.
(a) What is the probability that John is on the first row ?
(b) What is the probability that John and Peter are in the middle ?
Solution : There are many ways to solve these problems. In each case, we’ll go over two
possibilities.
(a) You can simply state that there are 4 rows on which John can sit down, so the probability
that he’ll sit on the first row is 1 out of 4, i.e. 0.25.
Another way of seeing this is remarking that these 4 guys can take a seat in 4! ways. The
number of ways in which John is on the first row (i.e. John on the first row, and let the
other three move around) is 3!. Therefore
p(“John on the first row”) =
3!
1
=
4!
4
(b) One way of looking at it is
p(“John and Peter in the middle”) =
2 1
1
· =
4 3
6
where 42 is the probability that John will be in the second or third row, and 13 is the
probability that Peter is on the third or second row, which ever one John is not occupying.
If you are confused by this, you can resort to simply writing out all possibilities. So, as we
6
argued in case (a), there are 4! possibilities. The only ones of those where John and Peter
are in the middle are:
M
H
M
H
J
J
P
P
P
P
J
J
H
M
H
M
Therefore
p(“John and Peter in the middle”) =
4
1
=
24
6
2. An airplane flies over an infantry platoon. The platoon fires 5000 bullets at the plane. A bullet
has a chance of only 0.001 to hit one of the “sensitive areas” (e.g. the engine, the pilot or the
gasoline tank).
(a) What is the probability to hit the plane at least once ?
(b) How many bullets have to be fired to have a 50% chance of at least one hit ?
Solution : First note that this is a Bernoulli trial because
• there are only two possible outcomes “hit” or “miss”.
• the fact that one bullet hits is independent of the fact if another one does
• the probability of a bullet hitting is the same for all, namely 0.001
Furthermore, note that “at least one hit” is the same as ”everything but no hits at all”. Therefore
p(“at least one hit”) = 1 − p(“all 5000 shots are misses”)
= 1 − C(5000, 0) · (0.001)0 · (0.999)5000
= 0.993279
where (0.999)5000 is the probability that all 5000 bullets mis. Also note that with 5000 bullets
you have more than 99% chance of hitting the plane. This is to be expected; although the
probability of hitting with a single bullet is only one out of a 1000, you have 5000 tries for just
the one hit.
Conversely, setting the probability of hitting at 50% gives the equation
0.5 = 1 − (0.999)x
where x is the number of bullets fired. So
−0.5 = −(0.999)x
0.5 = (0.999)x
log(0.5) = x · log(0.999)
log(0.5)
x =
log(0.999)
x = 692.8005 . . .
So you need 693 bullets to ensure a 50% hit
7
3. Gary drives a UCONN yellow line bus, which has 12 stops. From his past record, we know
Gary to have been on time on 55% of his stops. Assume Gary’s punctuality neither betters nor
worsens.
(a) What is the probability that Gary makes every stop on time ?
(b) What is the probability that Gary makes at least 10 on time ?
Solution : Note that we are dealing with a Bernoulli trial because
• there are only two possible outcomes “late” or “on time”
• as Gary’s punctuality neither betters nor worsens, the probability of being on time or not
on one bus stop is independent from the previous ones
• the probability of arriving on time is the same for all stops, namely 55%
(a) Simply applying the formula, we have,
p(“all 12 stops on time”) = C(12, 12) · (0.55)12 · (0.45)0 = 0.0007662 . . .
(b) At least 10 stops means 10,11 or 12, so
p(“at least 10 stops on time”)
= p(“10 stops on time”) + p(“11 stops on time”) + p(“12 stops on time”)
= C(12, 10) · (0.55)10 · (0.45)2 + C(12, 11) · (0.55)11 · (0.45)1 + C(12, 12) · (0.55)12 · (0.45)0
= 0.033853 . . . + 0.007523 . . . + 0.000766 . . .
= 0.042142 . . .
4. We toss 5 fair coins. What is the probability that the number of heads is higher then the number
of tails ?
Solution : There cannot be a 50/50 because it is impossible to get 2.5 times tail. Therefore,
we have
p(“more T then H”) + p(“more H then T”) = 1
Because the probability of Tails equals the probability of Heads, the probabilities in the above
equation have to be equal. Hence p(“more H then T”) = 21 If you don’t see this, simply calculate
the probabilities as a Bernoulli trial.
5. Chevalier de Méré claimed that the probability to throw at least one “1” when throwing one die
four times in a row equals the probability of throwing at least one “2” in 24 throws with 2 dice.
His friend Blaise Pascal proved him wrong. How much was he of the mark ?
Solution : Note that both experiments are Bernoulli trials for the same reasons as in exercise
3.2. For throwing one dice, we get
p(“at least one 1 in 4 throws”)
= 1 − p(“no 1 at all in 4 throws”)
0 4
1
5
= 1 − C(4, 0) ·
·
6
6
= 0.5177469136
8
For the two dice experiment, exactly the same reasoning yields
p(“at least one 2 in 24 throws”)
= 1 − p(“no 2 at all in 24 throws”)
0 24
1
35
= 1 − C(24, 0) ·
·
36
36
= 0.4914038761
So Chevalier de Méré was about 2.6% of the mark.
6. You pull 13 cards out of a deck of 52.
(a) What is the probability to get 3 aces ?
(b) What is the probability to get all 13 cards of the same suit ?
Solution : The total number of ways to take 13 cards out of 52 is C(52, 13) = 6.3501356 · 1011 .
(a) The total number of ways to get exactly 3 aces is C(4, 3) · C(48, 10), namely take 3 aces out
of the 4 available aces and take 10 cards out of the other 48 “non-ace” cards. Therefore
p(“exactly 3 aces”) =
C(4, 3) · C(48, 10)
= 0.0412 . . .
C(52, 13)
(b) There are only 4 ways in picking out exactly all cards of the same suit (namely all harts,
all clubs, all diamonds, or all spades). So
p(“all of the same suit”) =
4
= 6.29907 . . . · 10−12
C(52, 13)
7. A box contains 75 screws of which 5 are faulty. If 25 of these 75 screws are taken out, what is
the probability that exactly 1 screw is faulty?
Solution : The total number of ways in which 25 screws can be taken out of a box of 75 is
C(75, 25), so the probability is
p(“one faulty screw”) =
C(5, 1) · C(70, 24)
= 0.33585 . . .
C(75, 25)
where C(5, 1) represents the one bad screw taken out of the 5 bad ones and C(70, 24) the 24
good screws taken out of the 70 good ones.
8. In a jar, there are 4 bills of $1 and 6 bills of $5. We take out 2 bills at the same time. What is
the probability of each of the simple outcomes?
Solution : Taking only two bills out of that jar results in either taking out $2, $6 or $10, so
the state space is
S = {$2, $6, $10}
9
(a) The probability of getting $2 is
p($2) =
C(4, 2) · C(6, 0)
6
2
=
=
C(10, 2)
45
15
Where C(4, 2) stands for taking 2 $1 bills and C(6, 0) stands for taking no $5 bills.
(b) The probability of getting $6 is
p($6) =
C(4, 1) · C(6, 1)
24
8
=
=
C(10, 2)
45
15
Where C(4, 1) stands for taking 1 $1 bill and C(6, 1) stands for taking 1 $5 bill.
(c) The probability of getting $10 is
p($10) =
C(4, 0) · C(6, 2)
15
5
=
=
C(10, 2)
45
15
Where C(4, 2) stands for taking 2 $1 bills and C(6, 0) stands for taking no $5 bills.
Note that adding all the different possibilities does indeed give 1:
p($2) + p($6) + p($10) =
2
8
5
+
+
=1
15 15 15
9. In a local lottery 5 prizes are given away and 1000 tickets are sold. In a probabilistic mood, you
buy 2 tickets.
(a) What is the probability of winning 2 prizes?
(b) What is the probability of winning nothing at all?
Solution : The total number of ways in which to buy 2 tickets out of 1000 is C(1000, 2).
(a) The probability of winning 2 prizes is
p(“2 prizes”) =
C(5, 2) · C(995, 0)
= 0.00002002 . . .
C(1000, 2)
Where C(5, 2) stands for buying 2 tickets of the 5 winning ones and where C(995, 0) stands
for buying none of the 995 loosing tickets.
(b) The probability of winning no prizes at all is
p(“no prizes”) =
C(5, 0) · C(995, 2)
= 0.99002002 . . .
C(1000, 2)
Where C(5, 0) stands for buying no tickets of the 5 winning ones and where C(995, 2) stands
for buying 2 of the 995 loosing tickets.
10. An oil company estimates that only 1 oil well out of 20 will yield commercial quantities of oil.
Assume that successively drilled wells represent independent events. If 12 wells are drilled, find
the probability that a successful well was hit the following number of times:
10
(a) exactly 4
(b) none at all
(c) at least 2
Solution : This is a Bernoulli trial because
• There are only two possible outcomes “viable oil well” or “not a viable oil well”.
• The economic viability of one oil well is independent of the viability of the other ones.
• The probability for an oil well to be viable is the same for all, namely 1 out of 20.
So we can simply use the formula:
(a) Simply stating the formula for n = 12, k = 4 and p = 1/20 gives
1
20
4 8
19
·
= 0.002052
20
1
20
0 12
19
·
= 0.540360
20
p(“4 good oil wells”) = C(12, 4) ·
(b) No oil wells means 0 oil wells and therefore
p(“no good oil wells”) = C(12, 0) ·
(c) At least 2 oil wells means everything but no or only one oil well.
p(“at least 2 good oil wells”)
= 1 − p(“1 good oil well”) − p(“no good oil well”)
1 11
0 12
1
19
1
19
= 1 − C(12, 1) ·
·
− C(12, 0) ·
·
20
20
20
20
= 1 − 0.540360 − 0.341280
= 0.118359 . . .
5
Independence
1. Let A be a subset of the sample space S. A is neither the empty set nor the entire sample space
S. Can A and Ac be independent ?
Solution: Because A ∩ Ac = φ, we know that p(A ∩ Ac ) = 0. In order for A and Ac to be
independent, p(A ∩ Ac ) = p(A) · p(Ac ), so p(A) or p(Ac ) would have to be 0. As we have chosen
A to be neither φ nor S, this cannot be the case.
2. Pull a card out of a deck of 52. Are the events “the card is a spade” and “the card is a jack, a
queen or a king” independent events ?
Solution: The only thing we have to do is to verify:
p({spades}) · p({J,Q,K}) = p({spades} ∩ {J,Q,K})
11
As there are 13 spades in a deck, the probability of getting a spade is 13
52 and as there are 12 Jacks,
12
3
.
So
the product is 13
Queens and Kings, the probability of drawing one of those is 12
52
52 · 52 = 52 .
On the other hand,
p({spades} ∩ {J,Q,K}) = p({J♠, Q♠, K♠}) =
3
52
They are equal, so the sets are independent.
6
Conditional Probability
You are given the following: E and F are real, non-empty subsets of S with
p(E\F ) = 0.07, p(F \E) = 0.32 and p(E ∩ F ) = 0.08.
Calculate the following :
(a) p(E)
(b) p(F )
(c) p(E|F )
(d) p(F |E)
(e) p((E ∪ F )c )
Solution: Drawing a Venn Diagram is not necessary to make this exercise, but it definitely clarifies
what we are doing:
Then it is mostly reading probabilities of the diagram in a correct way:
(a) p(E) = p(E − F ) + p(E ∩ F ) = 0.07 + 0.08 = 0.15
(b) p(F ) = p(E ∩ F ) + p(F − E) = 0.08 + 0.32 = 0.40
(c) p(E|F ) =
p(E ∩ F )
0.08
=
= 0.2
p(F )
0.40
(d) p(E|F ) =
p(E ∩ F )
0.08
=
= 0.53
p(E)
0.15
(e) p((E ∪ F )c ) = 1 − p(E ∪ F ) = 1 − (0.07 + 0.08 + 0.32) = 0.53
12
7
Theorem of Total Probability
1. A hitchhiker travels from Mumbai to Calcutta. He can travel via either New Delhi, Hyderabad on
Kanpur. The probability of getting from New Delhi to Calcutta for free is 23 , from Hyderabad
to Calcutta, it is 21 and from Kanpur to Calcutta, a free ride is certain. Assuming that our
hitchhiker is not too well informed and has no preference for either of the three routes, what is
his probability of arriving in Calcutta?
Solution: Again, making a diagram is not necessary, but certainly clarifies a few things:
The theorem for total probability (i.e. just summing up the different possibilities) then gives:
p(arriving) = p(arriving via New Delhi) + p(arriving via Kanpur) + p(arriving via Hyderabad)
2 1
1 1 1
=
· +1· + ·
3 3
3 2 3
= 0.72
2. Research shows that smokers have a 5% chance to get lung cancer, while non-smokers have only
a 1% chance. In a group of students, 15 out of 25 are smokers. What is the probability that
a student, picked at random will get lung cancer ? 30 years later one of the ex-students does
contract lung cancer. What is the probability that the ex-student was/is a smoker ?
Solution: In this case, the probability tree looks like
13
The probability that a student will get cancer is the weighted average of the probability that a
smoking student will get lung cancer and the probability that a non-smoking student will get
lung cancer:
p(cancer) = p(smoker and cancer) + p(non-smoker and cancer)
15
10
=
· 0.05 +
· 0.01
25
25
= 0.034
Note that we can simply add these probabilities because the sets are disjoint: no student can be
both a smoker and a non-smoker.
In order to find the probability that a student that has contracted lung cancer was a smoker,
look for the weight of the “smoker gets cancer” branch with respect to all the branches that
result in cancer:
p(smoker|cancer) =
8
15
25
15
25
· 0.05
0.03
=
= 0.8832
10
0.03
· 0.05 + 25 · 0.01
Bayes’ Theorem
1. John does the washing up twice a week and his older brother Frank 5 times a week. The
probability that John breaks a piece of crockery is 10%, while the probability that Frank breaks
something is 2%. One evening, a plate hits the floor. What is the probability that John did it ?
Solution: First, draw a tree diagram:
The reasoning used is the same as as in the previous exercise. Calculate the weight of the branch
“John washes up and breaks a plate” w.r.t. the total weight of all the branches were a plate
gets broken:
2
7
· 0.10
· 0.10 + 57 · 0.02
= 0.6
p(John washes up|a plate brakes) =
14
2
7
2. ACME Machine Co, which makes small parts for other industries, has dedicated 3 of its machines
to produce a nuzzle used in the carburetor of a car. The machines are located in Kisangani,
Kinshasha and Lubumbashi and produce resp. 45%, 35% and 20% of the total output. The
percentage of defective parts are respectively 2%, 3% and 4%.
(a) What is the probability that a randomly selected nozzle in a spare part shop is good?
(b) If a part is defective, what is the probability that it comes from the plant in Kinshasha?
(c) What is the probability that a nozzle in a spare part shop is good and comes from Kinshasha?
Solution: The probability tree for this problem has the following shape:
(a) The probability of a good nozzle can be found by adding the probabilities of getting a
good nozzle coming from resp. Kisangani, Kinshasha and Lubumbashi. This boils down to
applying the theorem of total probability:
p(good nozzle) = p(good nozzle coming from Kisangani)
+ p(good nozzle coming from Kinshasha)
+ p(good nozzle coming from Lubumbashi)
= 0.45 · 0.98 + 0.35 · 0.97 + 0.20 · 0.96
= 0.9725
(b) Again, we are looking for the relative weight of a branch:
p(Kinshasha|bad nozzle) =
0.35 · 0.03
= 0.381
0.35 · 0.03 + 0.45 · 0.02 + 0.20 · 0.04
(c) The probability of a good nozzle coming from Kinshasha can be read directly from the
probability tree:
p({Kinshasha} ∩ {good nozzle}) = 0.35 · 0.97 = 0.3395
15
3. A company has plants in Berlin, Hamburg, Munich and Cologne which resp. produce 15%, 20%,
30% and 35% of the company’s cathode ray tubes. The probability that there is something
wrong with the cathode ray tube produced by these plants is resp. 5%, 4%, 3% and 2%. A
cathode ray tube turns out to be faulty. What is the probability that it was made in resp.
Berlin, Hamburg, Munich and Cologne?
Solution: First, apply the theorem of total probability:
p(a cathode ray tube is faulty) = p(faulty|Berlin) · p(Berlin)
+ p(faulty|Hamburg) · p(Hamburg)
+ p(faulty|Munich) · p(Munich)
+ p(faulty|Cologne) · p(Cologne)
= 0.05 · 0.15 + 0.04 · 0.2 + 0.03 · 0.3 + 0.02 · 0.35
= 0.0315
Then apply Bayes’ theorem for each of the 4 possibilities:
(a) p(Berlin|faulty) =
p(faulty|Berlin) · p(Berlin)
0.05 · 0.15
=
= 0.238095 . . .
p(faulty)
0.0315
(b) p(Hamburg|faulty) =
p(faulty|Hamburg) · p(Hamburg)
0.04 · 0.02
=
= 0.253968 . . .
p(faulty)
0.0315
(c) p(Munich|faulty) =
0.03 · 0.30
p(faulty|Munich) · p(Munich)
=
= 0.285714 . . .
p(faulty)
0.0315
(d) p(Cologne|faulty) =
0.02 · 0.35
p(faulty|Cologne) · p(Cologne)
=
= 0.2 . . .
p(faulty)
0.0315
16