====================== Homework #5 ====================== ======================================== PART A. Probability warmup ======================================== Events: AIDS : the person is infected test=+ : the AIDS test was positive We are given: P(AIDS) = 0.00001 P(~AIDS) = 0.99999 P(test=+ | AIDS) = 0.995 P(test=+ | ~AIDS ) = 0.005 We want to compute P(AIDS | test=+) Using Bayes rule we get: P(AIDS | test=+) = P(test=+|AIDS)/P(test=+) We still have to compute P(test=+) (the probability that test=+ without knowing if the person is (or isn't) infected Then P(test=+) = P(test=+, AIDS) + P(test=+, ~AIDS) using Bayes rule again we obtain: P(test=+) = P(test=+|AIDS)P(AIDS) + P(test=+|~AIDS)P(~AIDS) = 0.995*0.00001 + 0.005*0.99999 = 0.0019861 Therefore, P(AIDS | test=+) = 0.0019761 ======================================== PART B. Extending Holmes ======================================== Add to the original diagram one node E (for earthquake) and one node K (for KNX news radio) Add a link from E to K and another from E to A (Alarm) The earthquake does not affect the other nodes directly. ======================================== PART C. Probabilities for new nodes ======================================== Events: B : there is a burglary E : there is an earthquake A : the alarm sounds K : KNX reports the earthquake P(E) = 0.0001 because "...The incidence of quakes in Los Angeles is equal to the incidence of burglaries" P(~E)= 0.9999 (same reason) P(K|E) = 0.97 because "...will report the occurrence of a sufficiently large quake 97% of the time" P(~K|E) = 0.03 because the rest of the time will not report earthquakes P(K|~E) = 0.0 because "...KNX never makes a false positive report of a quake" P(~K|~E)= 1.0 (same reason) Now we have to change the table for the alarm, because in the new model A depends on E and B We use a noisy-or model. Therefore the alarm can sound: - when there is a burglary, - when there is an earthquake, - when some other factors make it sound. We will model the rest of factors that can activate the alarm with the "leak node". From the class notes we know that the alarm has a false positive rate of 1%. Then we have that the probability that the alarm will sound when no burglary nor earthquake happens is 0.01. Formally, P(A |~B, ~E ) = 0.01 = L Assuming independence between B and E (and using the noisy-or model) we have: P(A |~B, E ) = 1 - ( 1-P(A|E) )*(1-L) = 1 - ( 1- 0.70 )*(1-0.01) = 0.70300 P(A | B, ~E ) = 1 - ( 1-c_b )*(1-L) We can assume, under noisy-or, that P(A|B) ~ P(A|B~E) 0.95 = 1 - ( 1- c_b )*(1-0.01) 0.05 = (1 - c_b) * 0.99 0.05/0.99 = 1 - c_b c_b ~ 0.95 P(A | B, E ) = 1 - ( 1- c_b )*( 1-P(A|E) )*(1-L) = 1 - ( 1- 0.95 )*( 1- 0.70 )*(1-0.01) = 0.98515 The rest of the probabilities are easy to compute from this values using the property: P(~A) = 1 - P(A) ======================================== PART D. Problem 14.1 ======================================== (a) No special knowledge about car functioning was required. So you were free of choose what features of the car's electrical system and/or engine were affected by IcyWeather and StarterMotor. No directed cycles are allowed. (see section 14.1 from the book) (b) You should take into account that: - For each node X without parents (no incoming arrows) only a table with P(X) was necessary (the table has two entries P(X) and P(~X) ) - For each node X with k parents it was necessary to provide a table for P(X | Parents(X) ). This table should have 2^k entries. P(X) + P(~X) = 1.0 (and P(X|A) + P(~X|A) = 1.0 ) 0.0 <= P(X) <= 1.0 (c) The joint distribution for 8 boolean nodes would include 256 values (2^8) if there are NO conditional independence relations among the nodes. In this case it would be necessary to compute the probability of each combination of values for the nodes. (d) The Bayesian network requires less probability values (What are the assumptions that lead to this reduction?) For each node without parents we need 2 values and for each node with k parents we need 2^k values.