Week 4 Tutorial: Probability, Bayes Rule and Prediction March 25, 2013 1. Suppose the probabilities that the ASX stock increases today is 0.54, that it increases tomorrow is 0.54, and that it increases both days is 0.28. What is the probability that it does not increase on either day [Ross]. Answer: Let A be the event that the ASX will increase today. Let B be the event that it will increase tomorrow. Then A ∪ B is the event that it will increase either today or tomorrow. Thus P (A∪B) = P (A)+P (B)−P (AB) = 0.54+0.54−0.28 = 1.08−0.28 = 0.80 Thus, the probability it will not increase either today or tomorrow is 1 − P (A ∪ B) = 1 − 0.80 = 0.20 2. A family picnic scheduled for tomorrow will be postponed if it is either rainy or cloudy. If the probability that it will be cloudy is 0.4, the probability that it will be rainy is 0.30, and the probability that will be both rainy and cloudy is 0.2, what is the probability that the picnic will not be postponed [Ross]. Answer: Let R be the even that it will rain tomorrow. Let C be the even that it will be cloudy tomorrow. Then P (R ∪ C) = P (R) + P (C) − P (RC) = 0.4 + 0.3 − 0.2 = 0.5 Thus, the probability that the picnic will not be postponed is 1 − P (R ∪ C) = 1 − 0.5 = 0.5 3. XYZ is a rare genetic disease which occurs in one in one million people. A pharma company has come up with a new test for XYZ and claims that the test is very accurate. The test is 100% sensitive (it is always correct if you have the disease) and 99.99% specific (it gives a false positive result 1 only 0.01% of the time). Use Bayes rule to determine if the test should be approved or not. Answer: Let A be the event that a person has a disease. Then P (A) = 0.000001. Let T be the event that the test is positive. Now we are given P (T |A) = 1. We are also given that P (T |Ac ) = 0.0001. Now, what we want is to determine P (Ac |T ). Why ? Now Bayes rule says that P (Ac |T ) = P (T |Ac )P (Ac ) P (T ) Also, P (T ) = P (T, Ac ) + P (T, A). And, P (T, Ac ) = P (T |Ac )P (Ac ) and P (T, A) = P (T |A)P (A). Thus P (Ac |T ) = P (T |Ac )P (Ac ) P (T |Ac )P (Ac ) + P (T |A)P (A) Thus, P (Ac |T ) = 0.0001 × (1 − 0.000001) = 0.9999 0.0001 × (1 − 0.000001) + 1 × 0.000001 4. Consider data shown in Figure 1. Use the Naive Bayes Method to predict whether to play tennis or not for the following example: (Outlook=Sunny, Temperature=Cool,Humidity=High,Wind=Strong) Answer: Outlook Sunny Overcast Rain Play=Yes 2/14 4/14 3/14 Play=No 3/14 0/14 2/14 Humidity High Normal Play=Yes 3/14 6/14 Play=No 4/14 1/14 Temperature Hot Mild Cool Wind Strong Weak Play=Yes 2/14 4/14 3/14 Play=Yes 3/14 6/14 Play=No 2/14 2/14 1/14 Play=No 3/14 2/14 P (P lay = Y es) = 9/14 and P (P lay = N o) = 5/14. P(Outlook=Sunny|Play=Yes) =2/9 P(Outlook=Sunny|Play=No)=3/5 P(Temperature=Cool|Play=Yes)=3/9 P(Temperature=Cool|Play=No)=1/5 P(Humidity=High|Play=Yes)=3/9 P(Humidity=High|Play=No) = 3/5 P(Wind=Strong|Play=Yes) = 3/9 P(Wind=Strong|Play=No)=3/5 P(Play=Yes) = 9/14 P(Play=No) = 5/14 Thus 2 Figure 1: Training Data for Tennis Example P(Yes|data):[P(Sunny|Yes)P(Cool|Yes)P(High|Yes)P(Strong|Yes)P(Play=Yes)=0.0053 P(No|data):[P(Sunny|No)P(Cool|No)P(High|No)P(Strong|No)P(Play=No)=0.0206 3
© Copyright 2026 Paperzz