## Artificial Intelligence: Solution Set 5

Assigned: Oct. 24
Due: Oct. 31

Consider the Bayesian network shown below:

In this network, B is independent of A absolutely; D is independent of A and B given C; and E is independent of A, B, and D given C.

Assume that all the random variables are Boolean and that the following probabilities are recorded for the network:

Prob(A=T) = 0.9
Prob(B=T) = 0.5
Prob(C=T | A=T,B=T) = 0.8
Prob(C=T | A=T,B=F) = 0.7
Prob(C=T | A=F,B=T) = 0.7
Prob(C=T | A=F,B=F) = 0.0
Prob(D=T | C=T) = 0.8
Prob(D=T | C=F) = 0.5
Prob(E=T | C=T) = 0.2
Prob(E=T | C=F) = 0.9
Compute the following quantities:
1. Prob(B=F | A=T) = Prob(B=F) (since B is independent of A) = 1 - Prob(B=T) = 0.5

2. Prob(C=T) =
Prob(C=T,A=T,B=T) + Prob(C=T,A=T,B=F) + Prob(C=T,A=F,B=T) + Prob(C=T,A=F,B=F) =
Prob(C=T |A=T,B=T) Prob(B=T|A=T) Prob(A=T) + Prob(C=T |A=T,B=F) Prob(B=F|A=T) Prob(A=T) + Prob(C=T |A=F,B=T) Prob(B=T|A=F) Prob(A=F) + Prob(C=T |A=F,B=F) Prob(B=F|A=F) Prob(A=F) =
(since B is independent of A)
Prob(C=T |A=T,B=T) Prob(B=T) Prob(A=T) + Prob(C=T |A=T,B=F) Prob(B=F) Prob(A=T) + Prob(C=T |A=F,B=T) Prob(B=T) Prob(A=F) + Prob(C=T |A=F,B=F) Prob(B=F) Prob(A=F) =
0.8*0.5*0.9 + 0.7*0.5*0.9 + 0.7*0.5*0.1 * 0.0*0.5*0.1 = 0.36 + 0.315 + 0.035 + 0.0 = 0.71

3. Prob(B=T | C=T) = Prob(B=T,C=T)/Prob(C=T)
Now, Prob(B=T,C=T) = Prob(B=T,C=T,A=T) + Prob(B=T,C=T,A=F) = (by calculations in part 2)
0.36 + 0.035 = 0.395 and Prob(C=T)=0.71. So
Prob(B=T,C=T)/Prob(C=T) = 0.395/0.71 = 0.556

4. Prob(D=T) = Prob(D=T,C=T) + Prob(D=T,C=F) = Prob(D=T|C=T)Prob(C=T) + Prob(D=T|C=F)Prob(C=F) =
0.8*0.71 + 0.5*0.29 (note that Prob(C=F) = 1-Prob(C=T)) = 0.713.

5. Prob(E=T | B=T,C=T) = Prob(E=T|C=T) (since E is independent of B given C) = 0.2.

6. Prob(E=T | B=T) = Prob(E=T,C=T|B=T) + Prob(E=T,C=F|B=T) =
Prob(E=T|C=T,B=T)*Prob(C=T|B=T) + Prob(E=T|C=F,B=T)*Prob(C=F|B=T) =
(since E is independent of B given C)
Prob(E=T|C=T)*Prob(C=T|B=T) + Prob(E=T|C=F)*Prob(C=F|B=T).

Now Prob(C=T|B=T) = Prob(B=T,C=T)/Prob(B=T) = (from problem 3) 0.395/0.5 = 0.79.
Prob(C=F|B=T) = 1-Prob(C=T|B=T) = 0.21
Hence Prob(E=T|B=T) = Prob(E=T|C=T)*Prob(C=T|B=T) + Prob(E=T|C=F)*Prob(C=F|B=T) =
0.2*0.79 + 0.9*0.21 = 0.347

7. Prob(C=F | E=T) = (by Bayes's Law) Prob(E=T|C=F)*Prob(C=F)/Prob(E=T).
Now Prob(E=T) = Prob(E=T,C=T) + Prob(E=T,C=F) = Prob(E=T|C=T) Prob(C=T) + Prob(E=T|C=F) Prob(C=F) = 0.2*0.71 + 0.9*0.29 = 0.403.
Hence Prob(C=F|E=T) = 0.9*0.29/0.403 = 0.648