



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This document from the university of san francisco's department of computer science explores the concepts of probabilistic inference and the monty hall problem. It covers the basics of probability, conditional probability, and the monty hall problem, providing examples and formulas to help understand these concepts. The document also touches upon the use of bayesian networks for probabilistic inference.
Typology: Study notes
1 / 7
This page cannot be seen from the preview
Don't miss anything!




(A^ ∨^ B)^ is^ P^ (A) +^ P^ (
Tautologies have^ P^ = 1 Contradictions have^
P^ = 0^ Department of Computer Science — University of San Francisco – p.1/
??
P^ (Rain)^ goes up. this is called^ conditional probability Written as:^ P^ (Rain|Cloudy
P^ (a∧b) P (a|b) = P^ (b) or P (a ∧ b) =^ P^ (a|b)P (b) This is called the product rule.^ Department of Computer Science — University of San Fra
P^ (Rain) = 0.^2 P^ (cloudy^ ∧^ rain) = 0.
P^ (cloudy^ ∧ ¬Rain) = 0
P^ (¬cloudy^ ∧^ Rain) = 0
P^ (¬Cloudy^ ∧ ¬Rain) = 0
Initially,^ P^ (Rain) = 0
.^2. Once we see that it’s cloudy, P^ (Rain|Cloudy) =^ P
(Rain∧Cloudy)^0.^15 =^ = 0^ P^ (Cloudy)^0.^3
.^5 Department of Computer Science — University of San Francisco – p.3/ ??
∧^ B)^ is^ P^ (A|B)P^ (B) What if^ A^ and^ B^ are independent? Then^ P^ (A|B)^ is^ P^ (A ), and^ P^ (A^ ∧^ B)^ is^ P
Example:^ What is the probability of “heads” five times in a row?^ What is the probability of at least one “head”?
Department of Computer Science — University of San Francisco – p.4/
??
(b) P (a ∧ b) = P (b|a)P (a) We can set these equal to each other^ P^ (a|b)P^ (b) =^ P^ (b| a)P^ (a) And then divide by^ P
(a) P (a|b)P (b) P (b|a) = P (a) This equality is known as Bayes’ theorem (or rule orlaw).
Department of Computer Science — University of San Fra
Department of Computer Science — University of San Francisco – p.6/
??
,^ p,^ pABC Choose: C = c,^ c,^ cAB^ C Monty: M = m,^ m,^ mAB^ C^ Department of Computer Science — University of San Francisco – p.7/
??
Department of Computer Science — University of San Fra
P^ (p|c)AA, p) (^) A P^ (m|c)B^ A^ Department of Computer Science — University of San Francisco – p.9/
??
P^ (p|c)AA, p) (^) A P^ (m|c)B^ A P^ (m|c, p) =^ ?B^ AA
Department of Computer Science — University of San Francisco – p.10/
??
P^ (p|c)AA, p) (^) A P^ (m|c)B^ A P^ (m|c, p) = 1/^2 B^ AA P^ (p|c) =?AA
Department of Computer Science — University of San Fran
Bayesian network^ (or a
belief network )
Department of Computer Science — University of San Francisco – p.18/
??
Department of Computer Science — University of San Francisco – p.19/
??
) Earthquake Alarm MaryCalls Burglary^ A^ P ( J )^ T.90JohnCallsF.
Two neighbors will callwhen they hear youralarm.^ John sometimesoverreacts^ Mary sometimesmisses the alarm. .94 Two things can set offthe alarm A P ( M )^ Earthquake T.70F.01^ Burglary Given^ who has^ called,what’s the probability of aburglary? Department of Computer Science — University of San Fran
Department of Computer Science — University of San Francisco – p.21/
??
Department of Computer Science — University of San Francisco – p.22/
??
(x|parents(x))ii P^ (A^ ∧ ¬E^ ∧ ¬B^ ∧^ J^ ∧
999 ∗^0 .998 = 0.^00062 Department of Computer Science — University of San Fran
What is the probability of a breakin, given that we hearan alarm?^ P^ (B|A) = 0.95 + 0
What is the probability of a breakin given that both Johnand Mary called?^ P^ (B|J, M^ ) =^ P^ (B^ ∧^ J^ ∧^ M
∧^ A^ ∧ ¬E)^ ∨^ P^ (B^ ∧^ J^ ∧^ M^ ∧ A^ ∧^ E)^ ∨^ P^ (B^ ∧^ J^ ∧ M^ ∧ ¬A^ ∧ ¬E)P^ (B^ ∧^ J^ ∧^ M^ ∧ ¬
A^ ∧^ E) This last example shows a form of
inference.^ Department of Computer Science — University of San Francisco – p.24/
??
conditional independence^ relationships. Parents of a node should be those variables that directlyinfluence its value.^ JohnCalls is influenced by Earthquake, but notdirectly.^ John and Mary calling don’t influence each other. Formally, we believe that: P^ (M aryCalls|JohnCalls, Alarm, Earthquake, Burglary
P^ (M aryCalls|Alarm
)^ Department of Computer Science — University of San Francisco – p.25/
??
5 2 = 32^ numbers Total: 960. (^30) Joint: 2 entries, nearly all redundant.
Department of Computer Science — University of San Fran
Department of Computer Science — University of San Francisco – p.27/
??
b|c) A node is conditionally independent of itsnondescendants, given its parents.^ Given Alarm, JohnCalls is independent of Burglaryand Earthquake. A node is conditionally independent of all other nodes,given its parents, children, and siblings (the children’sother parents).^ Burglary is independent of JohnCalls given Alarmand Earthquake.
Department of Computer Science — University of San Francisco – p.28/
??
nj Y 1 Z^1 j
UU^1 m...^ X Z^ Z 1 jnj^ Y^ Yn^1^...^ Department of Computer Science — University of San Fran
We then need to compute the sum over the differentpossible values of^ A∑ This sum is^ f(A, B, EA^ a^
)f(A)f(A)J^ M^ We can process^ E^ the same way. In essence, we’re doing dynamic programming here,and exploiting the same memoization process. Complexity^ Polytrees: (one undirected path between any twonodes) - linear in the number of nodes.^ Multiply-connected nodes: Exponential.
Department of Computer Science — University of San Francisco – p.36/
??
Department of Computer Science — University of San Francisco – p.37/
??
Start at the top of the network and select arandom sample. (say it’s^ true). Draw a random sample from its children.conditioned on^ true.^ P^ (Sprinkler|Cloudy^ =^ true
)^ = <0.1,0.9>. Say we select F alse P (Rain|Cloudy = true) = <0.8, 0.2>. Saywe select T rue P (W etGrass|Sprinkler = f alse, Rain^ = true) = <0.9, 0.1>. Say we select^ true. This gives us a sample for <cloudy,
¬^ Sprinkler, Rain, WetGrass> As we increase the number of samples, thisprovides an estimate of P^ (cloudy,^ ¬Sprinkler, Rain, W etGrass
). We choose the query we are interested in andthen sample the network “enough” times to de-termine the probability of that event occurring,^ Department of Computer Science — University of San Fran
Department of Computer Science — University of San Francisco – p.39/
??