Bayesian Network - Problem
Bayesian Network - Problem
1) Consider the following Bayesian network, where F = having the flu and C =
coughing:
P(C | F) = 0.8
P(F) = 0.1 F C
P(C | F) = 0.3
a) Write down the joint probability table specified by the Bayesian network.
Answer:
F C
t t 0.1 × 0.8 = 0.08
t f 0.1 × 0.2 = 0.02
f t 0.9 × 0.3 = 0.27
f f 0.9 × 0.7 = 0.63
b) Determine the probabilities for the following Bayesian network
C F
Answer:
The second one falsely assumes that Alarm1 and Alarm2 are independent if the
value of Burglary is unknown. However, if the alarms are working as intended,
it should be more likely that Alarm1 rings if Alarm2 rings (that is, they should
not be independent).
b) Consider the first Bayesian network. How many probabilities need to be
specified for its conditional probability tables? How many probabilities would
need to be given if the same joint probability distribution were specified in a
joint probability table?
Answer:
We need to specify 5 probabilities, namely P(Burglary), P(Alarm1 | Burglary),
P(Alarm1 | ¬ Burglary), P(Alarm2 | Burglary) and P(Alarm2 | ¬ Burglary).
A joint probability table would need 23 − 1 = 7 probabilities.
c) Consider the second Bayesian network. Assume that:
P(Alarm1) = 0.1
P(Alarm2) = 0.2
P(Burglary | Alarm1, Alarm2) = 0.8
P(Burglary | Alarm1, ¬ Alarm2) = 0.7
P(Burglary | ¬ Alarm1, Alarm2) = 0.6
P(Burglary | ¬ Alarm1, ¬ Alarm2) = 0.5
Calculate P(Alarm2 | Burglary, Alarm1). Show all of your reasoning.
Answer:
P(Alarm2 | Burglary, Alarm1) = P(Alarm1, Alarm2, Burglary) / P(Burglary,
Alarm1) = 0.016/0.072 ∼ 0.22
with
P(Alarm1, Alarm2, Burglary) = P(Alarm1) P(Alarm2) P(Burglary | Alarm1,
Alarm2) = 0.1 × 0.2 × 0.8 = 0.016
P(Alarm1, ¬ Alarm2, Burglary) = P(Alarm1) P(¬ Alarm2) P(Burglary | Alarm1,
¬ Alarm2) = 0.1 × 0.8 × 0.7 = 0.056
P(Burglary, Alarm1) = P(Alarm1, Alarm2, Burglary) + P(Alarm1, ¬ Alarm2,
Burglary) = 0.016 + 0.056 = 0.072
3) Consider the following Bayesian network:
A B
D E
F G
P(D | B C) = 0.3
P(D | B C) = 0.25
P(D | B C) = 0.1
P(D | B C) = 0.35
Answer:
P(D|A) = P(A, D) / P(A)
= (P(A, B, C, D) + P(A, B, ¬ C, D) + P(A, ¬ B, C, D) + P(A, ¬ B, ¬ C,
D)) / P(A)
= P(B | A) P(C | A) P(D | B, C) + P(B | A) P(¬ C | A) P(D | B, ¬ C) +
P(¬ B | A) P(C | A) P(D | ¬ B, C) + P(¬ B | A) P(¬ C | A) P(D | ¬ B, ¬ C)
= (0.2 × 0.7 × 0.3) + (0.2 × 0.3 × 0.25) + (0.8 × 0.7 × 0.1) + (0.8 × 0.3 ×
0.35)
= 0.042 + 0.015 + 0.056 + 0.084
= 0.197
X Z
P(X) = P(Y) P(X | Y) + P(¬ Y) P(X | ¬ Y) = 0.5 × 0.5 + 0.5 × 0.5 = 0.5
P(Z) = P(Y) P(Z | Y) + P(¬ Y) P(Z | ¬ Y) = 0.5 × 0.5 + 0.5 × 0.5 = 0.5
P(X, Z) = P(X, Y, Z) + P(X, ¬ Y, Z)
= P(Y) P(X | Y) P(Z | Y) + P(¬ Y) P(X | ¬ Y) P(Z | ¬Z)
= 0.5 × 0.5 × 0.5 + 0.5 × 0.5 × 0.5 = 0.25
Therefore, P(X) P(Z) = P(X,Z). We can similarly show that P(X) P(¬ Z) =
P(X, ¬ Z), P(¬ X) P(Z) = P(¬ X, Z) and P(¬ X) P(¬ Z) = P(¬ X, ¬ Z) to
prove that X and Z are independent if the value of Y is unknown.