100% found this document useful (1 vote)
117 views

Bayesian Network - Problem

The document provides examples and explanations of Bayesian networks. It contains 5 problems that involve: 1) Writing the joint probability table for a simple Bayesian network about having the flu and coughing. 2) Analyzing which of two Bayesian networks about burglary alarms makes incorrect independence assumptions. 3) Determining whether variables in several Bayesian networks are necessarily independent given evidence. 4) Calculating the probability of an output variable given evidence in a Bayesian network. 5) Constructing a Bayesian network where two variables are independent if an intermediate variable is unknown.

Uploaded by

prateek.cs20
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
117 views

Bayesian Network - Problem

The document provides examples and explanations of Bayesian networks. It contains 5 problems that involve: 1) Writing the joint probability table for a simple Bayesian network about having the flu and coughing. 2) Analyzing which of two Bayesian networks about burglary alarms makes incorrect independence assumptions. 3) Determining whether variables in several Bayesian networks are necessarily independent given evidence. 4) Calculating the probability of an output variable given evidence in a Bayesian network. 5) Constructing a Bayesian network where two variables are independent if an intermediate variable is unknown.

Uploaded by

prateek.cs20
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Bayesian Networks– Solution

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

so that it specifies the same joint probabilities as the given one.


Answer:
P(C) = 0.08 + 0.27 = 0.35
P(F | C) = P(F, C) / P(C) = 0.08/0.35 ∼ 0.23
P(F | ¬ C) = P(F, ¬ C) / P(¬ C) = 0.02/0.65 ∼ 0.03
c) Which Bayesian network would you have specified using the rules learned in
class?
Answer:
The first one. It is good practice to add nodes that correspond to causes before
nodes that correspond to their effects.
d) Are C and F independent in the given Bayesian network?
Answer:
No, since (for example) P(F) = 0.1 but P(F | C) ∼ 0.23
e) Are C and F independent in the Bayesian network from Question b?
Answer:
No, for the same reason.
2) To safeguard your house, you recently installed two different alarm systems by
two different reputable manufacturers that use completely different sensors for
their alarm systems.
a) Which one of the two Bayesian networks given below makes independence
assumptions that are not true? Explain all of your reasoning. Alarm1 means
that the first alarm system rings, Alarm2 means that the second alarm system
rings, and Burglary means that a burglary is in progress.

(1) Burglary (2) Alarm1 Alarm2

Alarm1 Alarm2 Burglary

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

a) Are D and E necessarily independent given evidence about both A and B?


Answer:
No. The path D-C-E is not blocked.
b) Are A and C necessarily independent given evidence about D?
Answer:
No. They are directly dependent. The path A-C is not blocked.
c) Are A and H necessarily independent given evidence about C?
Answer:
Yes. All paths from A to H are blocked.

4) Consider the following Bayesian network. A, B, C, and D are Boolean random


variables. If we know that A is true, what is the probability of D being true?
A P(A) = 0.75

P(B | A) = 0.2 P(C | A) = 0.7


B C P(C |  A) = 0.25
P(B |  A) = 0.5

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

5) For the following Bayesian network


Y

X Z

we know that X and Z are not guaranteed to be independent if the value of Y


is unknown. This means that, depending on the probabilities, X and Z can be
independent or dependent if the value of Y is unknown. Construct probabilities
where X and Z are independent if the value of Y is unknown, and show that
they are indeed independent.
Answer:
Y P(Y) = 0.5

P(X | Y) = 0.5 P(Z | Y) = 0.5


P(X |  Y) = 0.5 X Z P(Z |  Y) = 0.5

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.

You might also like