Unit-4 Uncertainty
Unit-4 Uncertainty
Inference
•6
Probability Basics
• Begin with a set S: the sample space
– e.g., 6 possible rolls of a die.
• x ϵ S is a sample point/possible world/atomic event
• A probability space or probability model is a sample
space with an assignment P(x) for every x s.t.
0≤P(x)≤1 and ∑P(x) = 1
• An event A is any subset of S
– e.g. A= ‘die roll < 4’
• A random variable is a function from sample points
to some range, e.g., the reals or Booleans
Axioms of Probability
•Beliefs satisfy the axioms of probability.
•For any propositions A, B:
1. 0 ≤ P (A) ≤ 1
2. P (True) = 1 (hence P (False) = 0)
3. P (A ∨ B) = P (A)+ P (B) − P (A ∧ B)
4. Alternatively, if A and B are mutually exclusive (A ∧ B = F )
then:
P (A ∨ B) = P (A)+ P (B)
A B
A
Tru
B
e
•© UW CSE AI Faculty •7
Beliefs
•We use probability to describe the world and existing
uncertainty
•Agents will have beliefs based on their current state of
knowledge
– E.g. P(Some day AI agents will rule the world)=0.2 reflects a
personal belief, based on one’s state of knowledge about
current AI, technology trends etc.
•Different agents may hold different beliefs, as these are
subjective
•Beliefs may change over time as agents get new evidence
•Prior (unconditional) beliefs denote belief prior to the arrival of
any new evidence.
Defining Probabilistic Models
•We define the world as a set of random variables Ω
= {X 1 .. . X n }.
•A probabilistic model is an encoding of probabilistic
information that allows us to compute the
probability of any event in the world
•The world is divided into a set of elementary,
mutually exclusive events, called states
– E.g. If the world is described by two Boolean
variables A, B, a state will be a complete
assignment of truth values for A and B.
•A joint probability distribution function assigns non-
negative weights to each event, such that these
weights sum to 1.
Prior Probability
A AB B
Tru
e
•© UW CSE AI Faculty • 10
Chain Rule/Product Rule
• P(X1, …, Xn) = P(Xn|X1..Xn-1)P(Xn-1|X1..Xn-2)… P(X1)
= ПP(Xi|X1,..Xi-1)
Dilemma at the Dentist’s
• 12
Conditional probability
• Conditional or posterior probabilities
e.g., P(cavity | toothache) = 0.8
i.e., given that toothache is all I know there is 80% chance of cavity
•30
Inference by Enumeration
P(toothache)=.108+.012+.016+.064
= .20 or 20%
•31
Inference by Enumeration
P(toothachecavity)??=
•32
Inference by Enumeration
?? + .008
P(toothachecavity) = .20 + .072
.28
•33
Inference by Enumeration
•34
Independence
• A and B are independent iff:
P(A| B) = P(A) These two constraints are
logically equivalent
P(B | A) =P(B)
P( A B) = P( A)P(B)
•35
Independence
31 10;
•37
Power of Cond. Independence
• Often, using conditional independence
reduces the storage complexity of the joint
distribution from exponential to linear!!
•38
Bayes Rule Bayes rules!
posterior
•39
Computing Diagnostic Prob. from Causal Prob.
P(M|S)
•40
Other forms of Bayes Rule
P( y | x) P(x) likelihood prior
P(x y) = =
P( y) evidence
P( y | x) P(x)
P(x y) =
P( y | x) P(x)
x
P( y | x, z) P(x | z)
P(x y, z) =
P(y | z)
P( y | x, z) P(x, z)
P(x y, z) =
P( y | x, z) P(x | z)
x
•43
Simple Example of State Estimation
• Suppose a robot obtains measurement z
• What is P(doorOpen|z)?
•44
Causal vs. Diagnostic Reasoning
• P(open|z) is diagnostic.
• P(z|open) is causal.
• Often causal knowledge is easier to obtain.
count frequencies!
• Bayes rule allows us to use causal knowledge:
•45
Example
• P(z|open) = 0.6 P(z|open) = 0.3
• P(open) = P(open) = 0.5
P(z |open)P(open)
P(open| z) =
P(z | open) p(open) + P(z | open) p(open)
0.60.5 2
P(open| z) = = = 0.67
0.6 0.5 + 0.3 0.5 3
•46
Combining Evidence
• Suppose our robot obtains another observation z2.
•47
Example: Second Measurement