Module 5
Module 5
Module 5
UNCERTAINTY
ACTING UNDER UNCERTAINTY
Agents may need to handle uncertainty, whether due to partial observability, nondeterminism,
or a combination of the two. An agent may never know what state it is in or where it will end
up after a sequence of actions.
Agent’s knowledge cannot guarantee a successful outcome but can provide some degree of
belief (likelihood) on it. A rational decision depends on both the relative importance of
(sub)goals and the likelihood that they will be achieved. Probability theory offers a clean way
to quantify likelihood.
Example
Automated taxi to Airport
• Goal: deliver a passenger to the airport on time
• Action At : leave for airport t minutes before flight: How can we be sure that
A90 will succeed?
• Too many sources of uncertainty:
o partial observability (ex: road state, other drivers’ plans, etc.) o uncertainty in action outcome
(ex: flat tire, etc.) o noisy sensors (ex: unreliable traffic reports) o complexity of modelling and
predicting traffic
With purely-logical approach it is difficult to anticipate everything that can go wrong
• risks falsehood: “A25 will get me there on time” or
pg. 1
MODULE 5 BAD402
• leads to conclusions that are too weak for decision making: “A25 will get me
there on time if there’s no accident on the bridge , and it doesn’t rain and my tires remain
intact”
• Over-cautious choices are not rational solutions either, ex: A1440 causes staying
overnight at the airport
Summarizing uncertainty
Let’s consider an example of uncertain reasoning: diagnosing a dental patient’s toothache. A
medical diagnosis
• Given the symptoms (toothache) infer the cause (cavity) How to encode
this relation in logic?
• diagnostic rules:
• Toothache → Cavity (wrong)
• Toothache → (Cavity ∨ GumProblem ∨ Abscess ∨ ...) (too many
possible causes, some very unlikely) causal rules:
• Cavity → Toothache (wrong)
• (Cavity ∧ ...) → Toothache (many possible (con)causes)
• Problems in specifying the correct logical rules: Complexity: too many
possible antecedents or consequents Theoretical ignorance: no complete theory
for the domain Practical ignorance: no complete knowledge of the patient
Trying to use logic to cope with a domain like medical diagnosis thus fails for three main
reasons:
pg. 2
MODULE 5 BAD402
Preferences, as expressed by utilities, are combined with probabilities in the general theory of
rationa l decisions called decision theory:
Decision theory = probability theory + utility theory .
pg. 3
MODULE 5 BAD402
The fundamental idea of decision theory is that an agent is rational if and only if it chooses
the action that yields the highest expected utility, averaged over all the possible outcomes
of the action. This is called the principle of maximum expected utility (MEU).
pg. 4
MODULE 5 BAD402
Probabilities such as P (Total = 11) and P (doubles) are called unconditional or prior
probabilities (and sometimes just “priors” for short); they refer to degrees of belief in
propositions in the absence of any other information.
pg. 5
MODULE 5 BAD402
ex: P(Odd = true) = P(1) + P(3) + P(5) = 1/6 + 1/6 + 1/6 = 1/2
“The probability that the patient has a cavity, given that she is a teenager with no toothache, is
0.1” as follows:
P (cavity |¬toothache ∧ teen)=0.1 .
Probability Distribution gives the probabilities of all the possible values of a random variable
ex: P (Weather = sunny)=0.6 P (Weather = rain )=0.1
P (Weather = cloudy)=0.29 P (Weather = snow)=0.01 , but as an abbreviation we will allow
P(Weather)= 0.6, 0.1, 0.29, 0.01 where the bold P indicates that the result is a vector of
numbers, and where we assume a pre defined ordering sunny, rain , cloudy , snow on the
pg. 6
MODULE 5 BAD402
domain of Weather. We say that the P statement defines a probability distribution for the random
variable Weather.TheP notation is also used for conditional distributions: P(X | Y ) gives the
values of P (X = xi | Y = yj) for each possible i, j pair.
For continuous variables, it is not possible to write out the entire distribution as a vector,
because there are infinitely many values. Instead, we can define the probability that a random
variable takes on some value x as a parameterized function of x. For example, the sentence P
(NoonTemp = x)=Uniform[18C,26C](x) expresses the belief that the temperature at noon is
distributed uniformly between 18 and 26 degrees Celsius. We call this a probability density
function.
P(Weather , Cavity) denotes the probabilities of all combinations of the values of Weather and
Cavity. This is a 4 × 2 table of probabilities called the joint probability distribution of
Weather and Cavity.
For example, the product rules for all possible values of Weather and Cavity can be written
as a single equation:
P(Weather , Cavity)=P(Weather | Cavity)P(Cavity) ,
Notice that the probabilities in the joint distribution sum to 1, as required by the axioms of
probability.
For example, there are six possible worlds in which cavity toothache holds:
P(cavity toothache) = 0.108 + 0.012 + 0.072 + 0.008 + 0.016 + 0.064 = 0.28.
Adding the entries in the first row gives the unconditional or marginal probability of cavity:
P(cavity) = 0.108 + 0.012 + 0.072 + 0.008 = 0.2
This process is called marginalization, or summing out—because we sum up the probabilities
for each possible value of the other variables, thereby taking them out of the equation.
We can write the following general marginalization rule for any sets of variables Y and Z:
pg. 8
MODULE 5 BAD402
This rule is called conditioning. Marginalization and conditioning turn out to be useful rules
for all kinds of derivations involving probability expressions.
For example, we can compute the probability of a cavity, given evidence of a toothache, as
follows:
The two values sum to 1.0, as they should. Notice that in these two calculations the term
1/P(toothache ) remains constant, no matter which value of Cavity we calculate. In fact, it can
be viewed as a normalization constant for the distribution P(Cavity | toothache), ensuring that
it adds up to 1. we can write the two preceding equations in one:
pg. 9
MODULE 5 BAD402
The 32-element table for four variables can be constructed from one 8-element table and one
4-element table. This decomposition is illustrated schematically in Figure below.
pg. 10
MODULE 5 BAD402
pg. 11
MODULE 5 BAD402
pg. 12
MODULE 5 BAD402
This decomposition makes it easy to see what the joint probability values should be. The first
term is the conditional probability distribution of a breeze configuration, given a pit
configuration; its values are 1 if the breezes are adjacent to the pits and 0 otherwise. The second
term is the prior probability of a pit configuration. Each square contains a pit with probability
0.2, independently of the other squares; hence,
pg. 13
MODULE 5 BAD402
pg. 14