1 Solutions to Bayesian Network Problems 1. Given the Bayesian Network about, determine: (a) if P1 and P5 are independent of P6 given P8 FALSE, the path through P3, P4 and P7 is not blocked; neither P1 and P6 or P5 and P6 are d-separated. (b) if P2 is independent of P6 given no information TRUE, the path is blocked by node P7. (c) if P1 is independent of P2 given P8 FALSE, P1 and P2 converge on P4 and the path between them is un-blocked by P8. (d) if P1 is independent of P2 and P5 given P4 FALSE, P4 unblocks the path of information from P2 and P3 is not blocked. 2. Given the Bayesian Network above, calculate P (−p3) and P (p2| − p3) by variable elimination. The elimination process is carried out by factors. Note that P4 is irrelevant. Let’s define f1 (P 1) = P r(P 1), f2 (P 1, P 2) = P r(P 2|P 1), f3 (P 3, P 2) = P r(P 3|P 2). To compute P r(p2| − p3): 1. Restrict f3 (P 3, P 2): 1 f4 (P 2) = f3 (P 3 = f alse, P 2) f4 (P 2 = true) = 0.8 f4 (P 2 = f alse) = 0.7 2. Sum out P1: P f5 (P 2) = P 1 f1 (P 1) ∗ f2 (P 1, P 2) f5 (P 2 = true) = .4 ∗ .8 + .6 ∗ .5 = .62 f5 (P 2 = f alse) = .4 ∗ .2 + .6 ∗ .5 = .38 3. Calculate the factor for P2: f6 (P 2 = true) = f4 (P 2 = true) ∗ f5 (P 2 = true) = .8 ∗ .62 = .496 f6 (P 2 = f alse) = f4 (P 2 = f alse) ∗ f5 (P 2 = f alse) = .7 ∗ .38 = .266 4. Normalize: f7 (P 2 = true) = .496/.762 = .6509 = P r(P 2 = true|P 3 = f alse) f7 (P 2 = f alse) = .266/.762 = .3491 = P r(P 2 = true|P 3 = f alse) To compute P r(−p3) note that: P r(−p3) = P P r(−p3|P 2) ∗ P r(−p3) = P f4 (P 2) ∗ f5 (P 2) P2 P2 P P1 P r(P 2|P 1) ∗ P r(P 1) P r(−p3) = .62 ∗ .8 + .7 ∗ .38 = .762 3. There are three streetcars – the 501, 504 and 514 – that stop in front of your house. The 504 operates more frequently than the 514 and the 514 goes more often than the 501 (the ratio is 5:3:2 and this is kept during all the hours of operation). The 501 is short in 9 out of 10 cases during the daytime, in the evening it is always short. The 504 is rarely short and only in evenings (1 out of 10 streetcars are short). The 514 can be short anytime, however, it is long in 8 out of 10 cases. Every tenth 501 and 504 streetcar will have be routed to its depot at the end of its run. Nine of ten 514s will be routed to the depot. The evening is from 6pm to midnight and the daytime is from 6am to 6pm. (a) Draw a Bayesian network that reflects causal intuitions. N is the number of the streetcar (501, 504 or 514). E is either ”evening” or ”daytime”. L is the length of the car (”long” or ”short”). D is whether the streetcar will end at the depot. (b) Write the conditional probability tables at each node. 2 P r(E = evening) P r(E = daytime) = 1/3 = 2/3 P r(N = 501) P r(N = 504) P r(N = 514) 1/5 1/2 3/10 = = = P r(L = short|E = daytime, N = 501) = P r(L = short|E = evening, N = 501) = P r(L = short|E = daytime, N = 504) = P r(L = short|E = evening, N = 504) = P r(L = short|E = daytime, N = 514) = P r(L = short|E = evening, N = 514) = P r(D = depot|N = 501) = 1/10 P r(D = depot|N = 504) = 1/10 P r(D = depot|N = 514) = 9/10 9/10 1 0 1/10 1/5 1/5 (c) What conditional independences hold? E is independent of N if we don’t know the length of the streetcar. L is conditionally independent of D given N E is conditionally independent of D given N E is conditionally independent of D given no information (d) Assume it is evening. A short streetcar is approaching your stop. What is the probability it will go to the depot? We want P r(D = depot|E = evening, L = short). This is P r(D = depot, E = evening, L = short)/P r(E = evening, L = short) = P N P r(D = depot, E = evening, L = short, N )/ P P N D P r(E = evening, L = short, N, D) P = P r(E = P evening) ∗ N P r(L = short|E = evening, N )P ∗ P r(D = depot|N ) ∗ P r(N )/P r(E = evening) ∗ N P r(L = short|E = evening, N ) ∗ P r(N ) ∗ D P r(D|N ) P P = N P r(L = short|E = evening, N ) ∗ P r(D = depot|N ) ∗ P r(N )/ N P r(L = short|E = evening, N ) ∗ P r(N ) = (1/5 ∗ 1 ∗ 1/10 + 1/2 ∗ 1/10 ∗ 1/10 + 3/10 ∗ 1/5 ∗ 9/10)/(1/5 ∗ 1 + 1/2 ∗ 1/10 + 3/10 ∗ 1/5) = .2548 3
© Copyright 2026 Paperzz