MAB210 Worksheet 03 Solutions
MAB210 Worksheet 03 Solutions
MAB210 Worksheet 03 Solutions
This is just Bayes rule, but always conditioning on I. Note that A, B and C are
subsets of being Ill (i.e. having one of the three diseases). So therefore, AI is
equivalent to A, etc. Also using Bayes rule again for the disease given illness
probabilities we obtain:
Therefore we obtain:
.
(ii) We want to find Pr( .
As all our probability rules are valid also for conditional probabilities (see Section 2),
we can use the addition rule here. As A and B are disjoint events (the person cannot
have two diseases at the same time here), we use the addition rule for disjoint sets.
MAB210-2-13 Solutions Worksheet 3 4
Pr(A|DI) is known from (i). For Pr(B|DI) we use the technique of Bayes Theorem
again (same as in (i)), but we can keep things short by using our knowledge from (i)
for the denominator.
.
MAB210-2-13 Solutions Worksheet 3 5
B) Questions for further practice (voluntary)
(These questions are from part B of the Worksheet for Section 3.)
1. Events:
R := "Bert and Ernie come up with the correct answer after having used
strategy (2)"
AC := "Bert and Ernie agree on the correct answer"
AI := "Bert and Ernie agree on the incorrect answer"
D := "Bert and Ernie disagree"
E := "Ernie is right"
B := "Bert is right"
Probabilities:
P(R|AC) = 1 (because their common answer counts)
P(R|AI) = 0 (because their common answer counts)
P(R|D) = 0.5 (because the coin decides)
P(E) = P(B) = p with E and B independent
We would like to know P(R).
The law of total probability yields:
P(R) = P(R AC) + P(R AI) + P(R D)
= P(R|AC)P(AC) + P(R|AI)P(AI) + P(R|D)P(D).
The probabilities P(AC), P(AI) and P(D) can be expressed in terms of P(E) and
P(B) and we can use the multiplication rule for the intersection of independent
events as B and E are said to be independent.
P(AC) = P(E B) = P(E)P(B) = p
2
(multiplication rule for independence)
P(AI) = P(
) = P(
)P(
)
= P(E
) + P(
) + P(
P := "randomly chosen person likes punk rock"
H := "randomly chosen person likes hip hop" =
We denote the (unknown) number of boys into hip hop by n.
Probabilities:
P(B) =
P(P) =
P(B P) =
There are always several ways of expressing independence, i.e. there are several ways
of calculating n.
As a criterion for independence, we can use
P(B) = P(B|P), or
P(P) = P(P|B), or
P(B P) = P(B) * P(P),
or any similar expression of the events mentioned above, i.e. events referring to girls
and hip hop, girls and punk rock, or boys and hip hop. (Remember: when two
events are independent, so are their complements, and vice versa.)
Using the first option, for example, we obtain
P(B) = P(B|P)
<=> 10(6 + n) = 6(16 + n)
<=> 60 + 10n = 96 + 6n
<=> n = 9
Answer: 9 boys into hip hop must be at the party for sex and taste of music to
be independent.
MAB210-2-13 Solutions Worksheet 3 7
3. (i)(1) Pr(
1 + k k
A A ) = Pr(
k
A ) Pr(
1 + k k
A A ) but
1 + k
A _
k
A
so Pr(
1 + k k
A A ) = Pr(
1 + k
A ) and Pr(
1 + k k
A A ) = (0.9)
k
(0.9)
k+1
= 0.1(0.9)
k
for k = 1, 2, , 9.
(2) Pr(total at least 28) = Pr(exactly 28)+Pr(exactly 29)+Pr(exactly 30)
= 3Pr(1 gives 10 and other 2 give 9) + 3Pr(1 gives 8 and other 2 give 10)
+ 3Pr(1 gives 9 and other 2 give 10) + Pr(all give 10)
= 3 x 0.1(0.9)
9
x 0.1(0.9)
9
x (0.9)
10
+ 3 x 0.1(0.9)
8
x (0.9)
10
x (0.9)
10
+ 3 x 0.1(0.9)
9
x (0.9)
10
x (0.9)
10
+ (0.9)
10
x (0.9)
10
x (0.9)
10
= (0.9)
28
[0.03 + 0.3 + 0.27 + 0.81] = 0.05233 x 1.41 = 0.0738
(ii) Pr[(CB >10, Oth > 6) (CB > 8, Oth > 8)]
= (0.9)
10
(0.9)
6
+ (0.9)
8
(0.9)
8
Pr(CB >10, Oth > 6, CB > 8, Oth > 8)
= 2(0.9)
16
- Pr(CB >10, Oth > 8)
= (0.9)
16
(2 0.81) = 0.2205
4. Let Y be the event that the warning light should flash (i.e., that the cars oil pressure
IS too low) and A be the event that the light flashes.
Probabilties:
( ) ( ) ( ) Pr | 0.95, Pr | 0.02, Pr 0.1 A Y A Y Y = = = .
We want Pr(Y|A) and use Bayes Theorem.
( )
( ) ( )
( ) ( ) ( ) ( )
( )
( ) ( )
Pr | Pr
Pr |
Pr | Pr Pr | Pr
0.95 0.1
0.95 0.1 0.02 0.9
0.84
A Y Y
Y A
A Y Y A Y Y
=
+
=
+
=
5. Events: D := defective Y:= Test says defective
Probabilities: P(D) = 0.06 P(Y | D) = 0.95
(i) We want Pr(D | Y) and use Bayes Theorem (and the rule for the
complement).
=
=
.
MAB210-2-13 Solutions Worksheet 3 8
(ii) For the unknown probability P(Y|D) we use the variable p. So we have the
following probabilities:
P(D) = 0.06 P(Y | D) = p P(Y | D ) = 0.1
We require P(D | Y ) 0.001. Again we use Bayes Theorem and the rule
for the complement.
1 - p 0.001 (1 - p) + 0.0141
(1 - p) 0.014114
p 0.986.
MAB210-2-13 Solutions Worksheet 3 9
6. (i) Events: Y := device says word occurred, W := word did occur
Probabilities: Pr(W) = 0.1 Pr(Y|W) = 0.98
( )
Pr | 0.05 Y W =
We would like to know Pr(W|Y) and use Bayes Theorem.
Pr(W|Y) = Pr(WY)/Pr(Y)
= Pr(Y|W) Pr(W) /[Pr(Y|W)Pr(W) + Pr(Y|W )Pr(W)]
= 0.98 * 0.1/[0.98 * 0.1 + 0.05 * 0.9]
= 0.685
(ii) Let Pr(Y|
=
4 . 0
1 . 0 7 . 0 x
= 0.175
P(R | F) =
.
MAB210-2-13 Solutions Worksheet 3 10
8. Events: D := classified defective
A := component has defect of type A
B := component has defect of type B.
Probabilities:
Pr(D | A) = 0.9 Pr(D | B) = 0.85 Pr(D | AB) = 0.95
Pr
(D| AB)
= 0.1
Pr(A) = 0.04 Pr(B) = 0.02 Pr(AB) = 0.01
(i) We would like to know Pr(A|D).
In view of the numbers given it seems reasonable to start with the technique of
Bayes Theorem, i.e. we use the definition for conditional probabilities followed
by the general multiplication rule.
Pr(A|D)
.
For the denominator we slightly modify the technique of Bayes Theorem: we use
the addition rule for disjoint sets, then the general addition rule and finally the
general multiplication rule:
Pr(D) = Pr(D (A B)) + Pr(D (AB))
= Pr(DA) + Pr(DB) - Pr(DAB) + Pr(D (AB))
= Pr(D | A) Pr(A) + Pr(D | B) Pr(B) - Pr(D | AB) Pr(AB)
+ Pr(D | (AB)) Pr((AB))
= 0.9 x 0.04 + 0.85 x 0.02 - 0.95 x 0.01+ 0.1 x 0.95
= 0.1385
With the equation we had for Pr(A|D) above, we now obtain:
Pr(A | D) =
0.9 0.04
0.1385
= 0.26.
(ii) What is the probability that the component is defective? We are looking for
Pr(AB|D).
The definition of conditional probabilities yields
Pr(A B | D) =
.
With the general addition rule in the numerator we obtain
=
.
We use the general multiplication rule in the numerator and get
MAB210-2-13 Solutions Worksheet 3 11
=
0.9 0.04+0.85 0.020.950.01
0.1385
= 0.314.
9. (i) Consider only non-spam emails, so all the probabilities below are conditional on
Sp , but as we are considering the same condition below, we can omit the | Sp for
the moment. For non-spam emails coming to the staff member, we are told (by the
statement in the brackets) that Ph is the same as the event that the email is about the
new pharmaceutical course.
We use the general addition rule:
( ) ( ) ( ) ( ) Pr Pr Pr Pr Ph L Ph L Ph L = +
For the last term we can use the general multiplication rule:
( ) ( ) ( ) Pr Pr | Pr Ph L L Ph Ph =
Putting the two equation together, we have, for non-spam emails, as
( ) Pr | 1 L Ph = ,
( ) ( ) ( ) ( ) ( ) Pr Pr Pr Pr Pr Ph L Ph L Ph L = + = .
Specifying the condition of non-spam emails (remember: all probability rules remain
valid if we add a condition at the end), this is
( ) ( )
Pr | Pr | Ph L Sp L Sp =
(Remark: Alternatively, we could have started with our probability rules in the
conditional version straight away.)
(ii) Consider only spam emails. We have the probabilities
Pr (Ph|Sp) = 0.2 Pr(L|Sp) = 0.5, with the two events being independent.
We would like to find
( ) Pr | Ph L Sp
.
With the general addition rule, here used with a condition attached (remember all our
rules are valid also for conditional probabilities), we get
( ) Pr | Ph L Sp
= Pr(Ph|Sp) + Pr(L|Sp) Pr(Ph intersection L|Sp).
We apply the multiplication rule for independent events (in a version with a condition
attached) to the last term and obtain:
( ) Pr | Ph L Sp
= Pr(Ph|Sp) + Pr(L|Sp) Pr(Ph|Sp)Pr(L|Sp).
= 0.2 + 0.5 0.2*0.5 = 0.6.
MAB210-2-13 Solutions Worksheet 3 12
(iii)
( ) ( )
Pr 0.1, Pr | 0.3 Sp L Sp = = .
We want to know Pr( . We follow the procedure of Bayes Theorem, i.e.
we use the definition of conditional probabilities and the general multiplication rule
for the numerator.
( )
( ) ( )
( )
Pr | Pr
Pr |
Pr
Ph L Sp Sp
Sp Ph L
Ph L
.
For the denominator we use the law of total probability.
( ) ( ) ( ) ( ) ( )
( ) ( )
Pr Pr | Pr Pr | Pr
0.6 0.1 0.3 0.9
0.33
Ph L Ph L Sp Sp Ph L Sp Sp = +
= +
=
Hence we have
( )
( ) 0.6 0.1
Pr | 0.1818
0.33
Sp Ph L
= = .
MAB210-2-13 Solutions Worksheet 3 13
10. Events:
B := bacteria present, Y := test says bacteria are present
A := bacteria not present, N := test says bacteria are not present.
Probabilities:
Pr(B) = 0.02 Pr(Y|B) = 0.95 Pr(Y|A) = 0.1
(i) We use the technique of Bayes Theorem.
Pr(A|Y) = Pr(AY)/Pr(Y) = Pr(Y|A)Pr(A)/Pr(Y)
(definition of conditional probabilities and general multiplication rule for the
numerator)
Pr(Y) = Pr(Y|A)Pr(A) + Pr(Y|B)Pr(B)
(law of total probability for the denominator)
Hence (using the rule for the complement to get Pr(A)) we have
Pr(A|Y) =
0.1x0.98
0.1x0.98 + 0.95x0.02
=
0.098
0.117
= 0.8376
(ii) Again, we use the technique of Bayes Theorem.
Pr(B|N) = Pr(BN)/Pr(N) = Pr(N|B)Pr(B)/Pr(N)
(definition of conditional probabilities and general multiplication rule for the
numerator)
For the denominator we can make our life a bit easier and simply use the
complement of the denominator from (i), i.e.
Pr(N) = 1 Pr(Y) = 1 0.117 = 0.883
In sum we get Pr(B|N) =
0.05x0.02
0.883
= 0.00113
(iii) Now we have the new events
D := water sample comes from dam
C := water sample does not come from dam
and the new probabilities Pr(D) = 2/3 and Pr(C) = 1/3. The probabilities P(Y|A)
and P(Y|B) do not change, not matter where the water is from.
Using Bayes Theorem we get
Pr(B|N) = Pr(BN)/Pr(N) = Pr(N|B)Pr(B)/[Pr(N|B)Pr(B) + Pr(N|A)Pr(A)]
Except Pr(B) all quantities are know. We obtain Pr(B) by using the law of total
probability with respect to the events C and D:
Pr(B) = Pr(B|D)Pr(D) + Pr(B|C)Pr(C) = 0.02 * 2/3 + 0.03 * 1/3= 0.0233.
Hence we have
Pr(B|N) = 0.05 * 0.0233/[0.05*0.0233 + 0.9*0.98] = 0.00132.
MAB210-2-13 Solutions Worksheet 3 14
OR, ALTERNATIVELY, we could use the definition of conditional probabilities
and then the law of total probability twice, in both the numerator and the denominator.
(In the numerator, we would use the law of total probability for the event BN.)
Doing so yields :
Pr(B|N) = Pr(BN)/Pr(N) =
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
Pr | Pr Pr | Pr
Pr | Pr Pr | Pr
BN D D BN C C
N D D N C C
+
+
and we find Pr(N|C) in the same way as Pr(N|D)
so Pr(N|C) = 0.05x0.03 + 0.9x0.97
Hence Pr(B|N) =
0.05x0.02x2/3 + 0.05x0.03x1/3
0.883x2/3 + 0.8745x1/3
=
0.001167
0.58867 + 0.2915
= 0.00133
[Note that the above are NOT the same as
0.05x0.02
0.883
x 2/3 +
0.05x0.03
0.8745
x 1/3
That is if you use Pr(B|N) = Pr(B|N&D)Pr(D|N) + Pr(B|N&C)Pr(C|N)
then although Pr(B|N&D) is as found in (ii), and similarly for Pr(B|N&C), note that
Pr(D|N) is NOT Pr(D)]
11.
Events: E := Ernie attends, B := Bert attends, M := Miss Piggy attends
These 3 events are mutually independent. (Unless we assumed that Berts
commitments were somehow related to Miss Piggys plane.)
Probabilities: P(E) = 0.5, P(B) = 0.9, P(M) = 0.8
(i) We are looking for P(E B).
P(E B) = P(E) + P(B) P(E B) [general addition rule]
= P(E) + P(B) P(E)P(B) [multiplication rule for independent events]
= 0.5 + 0.9 - 0.5 * 0.9 = 0.95.
(ii) We are looking for P( ).
P( )
= P(EB) + P(M B
) + P(
[addition rule for disjoint sets; draw a set diagram to see this]
= P(E)P(B) + P(M)P(B)P(
) + P(M)P(E)P(
)
[multiplication rule for the mutually independent events E, B, M and their
complements]
= P(E)P(B) + P(M)P(B)[1 - P(E)] + P(M)P(E)[1 - P(B)]
[rule for the complement of an event]
= 0.5 * 0.9 + 0.8 * 0.9 * [1 0.5] + 0.8 * 0.5 * [1 0.9] = 0.85.