You are on page 1of 5

Assignment - 4 Bayesian Networks Submission Deadline - November 3rd,11.

55 PM

Name : Jaikrishna Chaparala 14CS10011

1. What is the maximum number of edges in a Bayesian network with n nodes?

Since a bayesian network is nothing but a directed graph, from each edge we can have a maximum
of N-1 edges. So, the maximum number of edges is n*(n-1) = n^2 -1.

2.

Part 1 :
P(Lungcancer|Smoker) = P(old)*P(lungcancer|old^smoker) +P(~old)*P(lungcancer|~old^smoker) =
0.2 * 0.3 + 0.8* 0.1 = 0.06 + 0.08 = 0.14

P(lungcancer) = P(old)*P(smoker)*P(L|old^smoker) + P(~old)*P(smoker)*P(L|~old^smoker) +


P(old)*P(~smoker)*P(L|old^~smoker) + P(~old)*P(~smoker)*P(L|~old^~smoker)=
= 0.2*0.1*0.3 + 0.8*0.1*0.1 + 0.2*0.9*0.2 + 0.9*0.8*0.01
=0.115

Part 2:
P(TUBERCULOSIS) = P(TUBERCULOSIS|old)*P(old) + P(TUBERCULOSIS|~old)*P(~old)
= 0.05 * 0.2 + 0.8* 0.1
= 0.09
P(blood|smoker) = P(b|L^TUBERCULOSIS)*P(L|S)*P(TUBERCULOSIS) + P(b|
~L^TUBERCULOSIS)*P(~L|S)*P(TUBERCULOSIS) +
P(b|L^~TUBERCULOSIS)*P(L|S)*P(~TUBERCULOSIS) + P(b|~L^~TUBERCULOSIS)*P(~L|
S)*P(~TUBERCULOSIS)
= 1*0.14*0.09 + 0.86*0.09*0.8 + 0.14*0.91*0.9 + 0.86*0.91*0.01
=0.197

Part 3:
P(TUBERCULOSIS | old ^ smoker) = 0.05
P(L | old ^ smoker) = 0.3
P ( blood | L ^ old ^ smoker ) = P(blood|L^T^old^smoker) * P (T|old^smoker^L) + P(blood|
L^~T^old^smoker) * P (~T|old^smoker^L)
= 1*0.05 + 0.9*0.95 = 0.905

P ( blood| old^smoker) = P(blood | L^T)*P(L|old^smoker)*P(T|old^smoker) + ….. (similarly for 4


cases of L and T)
= 1.0*0.3 *0.05 + 0.9*0.3 *0.95 + 0.8*0.7*0.05 + 0.01*0.7*0.95
= 0.306

P ( L | blood ^ old ^ smoker) = P ( blood | L ^ old ^ smoker ) * P(L | old ^ smoker) / P(blood|old ^
smoker)
= 0.905 * 0.3 / 0.306 = 0.887

Q3)
. For each of the networks given in Figure 1 (a,b), do the following statements hold? Please explain
your reasoning.

a) A⊥C| blood, D
b) blood⊥D| A, C

Fig 1.a: A⊥C|blood,D :True. All the paths are inactive between A and C. blood⊥D|A,C : False.
Once C is observed the path between blood and D is active

Fig 1.b: A⊥C|blood,D : False. There is an active path between A and C once blood and D are
observed. blood⊥D|A,C : True. All the paths between A and C are inactive.

4. Construct two different Bayesian network which encode exactly the following conditional
independence assumptions
A⊥C | blood
A⊥D | blood
C⊥D | blood
i) Assume that these samples came from performing Prior Sampling, calculate the sample estimate
of P(+c)

P(+c) = 0.625 [From 3rd, 4th, 5th, 7th and 8th]

ii) Which samples would not be used when doing Rejection sampling for the task estimating P(+c |
+a,-d) . What is the sample of estimate of P(+c | +a,-d)

P(+c| +a, -d) = 0.67

b) Using Likelihood Weighting Sampling to estimate P(-a | +b,-d) the following samples were
obtained. Calculate the weight of each sample

You might also like