Course Artificial Intelligence Effective Period September 2018 Quantifying
Course : Artificial Intelligence Effective Period : September 2018 Quantifying Uncertainty II Session 10 Prof. Dr. Ir Widodo Budiharto 2020 1
Learning Outcomes At the end of this session, students will be able to: § LO 4: Apply various techniques to an agent when acting under certainty 2
Outline 1. Inference using Full-Joint Distribution 2. Independence 3. Bayes Theorem 4. Exercise 3
Inference Using Full Joint Distributions • Probabilistic Inference – Given observed evidence, estimate the posterior probability! – Full-joint distribution = Knowledge base 4
Inference Using Full Joint Distributions • Probabilistic Inference – To measure the probability of Cavity = True, we use marginalization (or summing out) 5
Inference Using Full Joint Distributions • Full Joint Distribution for the Toothache, Cavity, Catch • Four possible world in which cavity holds: – P(cavity) = 0. 108 + 0. 012 + 0. 016 + 0. 064 = 0. 2 6
Inference Using Full Joint Distributions • Full Joint Distribution for the Toothache, Cavity, Catch • Six possible world in which cavity toothache holds: – P(cavity toothache) • = 0. 108 + 0. 012 + 0. 072 + 0. 008 + 0. 016 + 0. 064 = 0. 28 7
Conditional Probability 8
Independence • How are P(toothache, catch, cavity, cloudy) and P(toothache, catch, cavity) related? – Use the product rule : • P(toothache, catch, cavity, cloudy) = P(cloudy | toothache, catch, cavity) P(toothache, catch, cavity) – However, the weather does not influence the dental variables, therefore : (independence) • P(cloudy | toothache, catch, cavity) = P(cloudy) 9
Independence • A and B are independent iff – P(A|B) = P(A) or P(B|A) = P(B) or P(A, B) = P(A) P(B) – P(Toothache, Catch, Cavity, Weather) = P(Toothache, Catch, Cavity) P(Weather) 10
Probability and Bayes’ Theorem • Bayes’ rule or Bayes’ theorem – Why use this? • We perceive as evidence the effect of some unknown cause and we would like to determine that cause 11
Probability and Bayes’ Theorem • For example, a doctor knows that the disease meningitis causes the patient to have a stiff neck, say, 70% of the time • The doctor also knows some unconditional facts: the prior probability that a patient has meningitis is 1/50, 000, and the prior probability that any patient has a stiff neck is 1%. 12
Probability and Bayes’ Theorem Vany had onset of symptoms such as spots on the face. Doctor diagnose that Vany got chicken pox with the possibility: • Probability appearance of spots on the face, if Vany got chicken pox, p (spots/chicken pox) = 0, 8 • Probability Vany got chicken pox without notice any symptoms, p(chicken pox) = 0, 4 • Probability appearance of spots on the face, if Vany got allergy, p(spots/allergy) = 0, 3 • Probability Vany got allergy without notice any symptoms, p(allergy) = 0, 7 13
Probability and Bayes’ Theorem • Probability appearance of spots on the face, if Vany got pimples, p(spots/pimples) = 0, 9 • Probability that Vany got pimples without notice any symptoms, p(pimples) = 0, 5 Calculate the probability of each symptoms stated above! 14
Probability and Bayes’ Theorem • Problem : Marie is getting married tomorrow, at an outdoor ceremony in the desert. In recent years, it has rained only 5 days each year. Unfortunately, the weatherman has predicted rain for tomorrow. When it actually rains, the weatherman correctly forecasts rain 90% of the time. When it doesn't rain, he incorrectly forecasts rain 10% of the time. What is the probability that it will rain on the day of Marie's wedding? 15
Probability and Bayes’ Theorem • Solution: The sample space is defined by two mutuallyexclusive events - it rains or it does not rain. Additionally, a third event occurs when the weatherman predicts rain. Notation for these events appears below. ü Event A 1. It rains on Marie's wedding. ü Event A 2. It does not rain on Marie's wedding. ü Event B. The weatherman predicts rain. 16
Probability and Bayes’ Theorem • P( A 1 ) = 5/365 = 0. 0136985 [It rains 5 days out of the year. ] • P( A 2 ) = 360/365 = 0. 9863014 [It does not rain 360 days out of the year. ] • P( B | A 1 ) = 0. 9 [When it rains, the weatherman predicts rain 90% of the time. ] • P( B | A 2 ) = 0. 1 [When it does not rain, the weatherman predicts rain 10% of the time. ] 17
Probability and Bayes’ Theorem • We want to know P( A 1 | B ), the probability it will rain on the day of Marie's wedding, given a forecast for rain by the weatherman. The answer can be determined from Bayes' theorem, as shown below. 18
References • Stuart Russell, Peter Norvig. 2010. Artificial Intelligence : A Modern Approach. Pearson Education. New Jersey. ISBN: 9780132071482 • http: //aima. cs. berkeley. edu 19
Exercise 20
Exercise Bayes Theorem There are three boxes each containing two balls. Box I contains two red balls, box II contains one red ball and one white ball, while box III contains two white balls. Without looking, you are asked to take one box randomly, and then take one ball randomly from the chosen box. You are told that the ball is red. Question: What is the probability of the ball being taken from each boxes? 21
- Slides: 21