Uncertainty

35
Uncertainty 1 Uncertainty Uncertainty Russell and Norvig: Chapter 14 Russell and Norvig: Chapter 13 CS121 – Winter 2003

description

Uncertainty. Russell and Norvig: Chapter 14 Russell and Norvig: Chapter 13 CS121 – Winter 2003. sensors. ?. ?. agent. actuators. model. Uncertain Agent. ?. environment. ?. An Old Problem …. Types of Uncertainty. - PowerPoint PPT Presentation

Transcript of Uncertainty

Page 1: Uncertainty

Uncertainty 1

UncertaintyUncertainty

Russell and Norvig: Chapter 14Russell and Norvig: Chapter 13CS121 – Winter 2003

Page 2: Uncertainty

Uncertainty 2

environment

Uncertain AgentUncertain Agent

agent

?

sensors

actuators

??

??

?

model

Page 3: Uncertainty

Uncertainty 3

An Old Problem …An Old Problem …

Page 4: Uncertainty

Uncertainty 4

Types of UncertaintyTypes of UncertaintyUncertainty in prior knowledgeE.g., some causes of a disease are unknown and are not represented in the background knowledge of a medical-assistant agent

Page 5: Uncertainty

Uncertainty 5

Types of UncertaintyTypes of UncertaintyUncertainty in prior knowledgeE.g., some causes of a disease are unknown and are not represented in the background knowledge of a medical-assistant agentUncertainty in actions E.g., actions are represented with relatively short lists of preconditions, while these lists are in fact arbitrary long

For example, to drive my car in the morning:• It must not have been stolen during the night• It must not have flat tires• There must be gas in the tank• The battery must not be dead• The ignition must work• I must not have lost the car keys• No truck should obstruct the driveway• I must not have suddenly become blind or paralyticEtc…

Not only would it not be possible to list all of them, but would trying to do so be efficient?

Page 6: Uncertainty

Uncertainty 6

Types of UncertaintyTypes of UncertaintyUncertainty in prior knowledgeE.g., some causes of a disease are unknown and are not represented in the background knowledge of a medical-assistant agentUncertainty in actions E.g., actions are represented with relatively short lists of preconditions, while these lists are in fact arbitrary longUncertainty in perceptionE.g., sensors do not return exact or complete information about the world; a robot never knows exactly its position

Courtesy R. Chatila

Page 7: Uncertainty

Uncertainty 7

Types of UncertaintyTypes of UncertaintyUncertainty in prior knowledgeE.g., some causes of a disease are unknown and are not represented in the background knowledge of a medical-assistant agentUncertainty in actions E.g., actions are represented with relatively short lists of preconditions, while these lists are in fact arbitrary longUncertainty in perceptionE.g., sensors do not return exact or complete information about the world; a robot never knows exactly its position

Sources of uncertainty:1.Laziness (efficiency?)2.Ignorance

What we call uncertainty is a summary of all that is not explicitly taken into account in the agent’s KB

Page 8: Uncertainty

Uncertainty 8

QuestionsQuestionsHow to represent uncertainty in knowledge?

How to perform inferences with uncertain knowledge?

Which action to choose under uncertainty?

Page 9: Uncertainty

Uncertainty 9

Handling UncertaintyHandling Uncertainty

Approaches:1. Default reasoning [Optimistic]2. Worst-case reasoning

[Pessimistic]3. Probabilistic reasoning [Realist]

Page 10: Uncertainty

Uncertainty 10

Default ReasoningDefault ReasoningRationale: The world is fairly normal. Abnormalities are rareSo, an agent assumes normality, until there is evidence of the contraryE.g., if an agent sees a bird x, it assumes that x can fly, unless it has evidence that x is a penguin, an ostrich, a dead bird, a bird with broken wings, …

Page 11: Uncertainty

Uncertainty 11

Representation in LogicRepresentation in LogicBIRD(x) ABF(x) FLIES(x)PENGUINS(x) ABF(x)BROKEN-WINGS(x) ABF(x)BIRD(Tweety)…

Default rule: Unless ABF(Tweety) can be proven True, assume it is False [unsound inference rule]But what to do if several defaults are contradictory?

Which ones to keep? Which one to reject?

Very active research field in the 80’s Non-monotonic logics: defaults, circumscription, closed-world assumptionsApplications to databases

Page 12: Uncertainty

Uncertainty 12

Worst-Case ReasoningWorst-Case ReasoningRationale: Just the opposite! The world is ruled by Murphy’s LawUncertainty is defined by sets, e.g., the set possible outcomes of an action, the set of possible positions of a robotThe agent assumes the worst case, and chooses the actions that maximizes a utility function in this caseExample: Adversarial search (next lecture)

Page 13: Uncertainty

Uncertainty 13

Probabilistic ReasoningProbabilistic Reasoning Rationale: The world is not divided between “normal” and “abnormal”, nor is it adversarial. Possible situations have various likelihoods (probabilities)The agent has probabilistic beliefs – pieces of knowledge with associated probabilities (strengths) – and chooses its actions to maximize the expected value of some utility function

Page 14: Uncertainty

Uncertainty 14

Target Tracking ExampleTarget Tracking Example

Maximization of worst-case value of utility vs. of expected value of utility

targetrobot

Utility =escape timeof target

Page 15: Uncertainty

Uncertainty 15

Forthcoming ClassesForthcoming Classes

1. Problem-solving with worst-case uncertainty (adversarial search)

2. Problem solving with probabilistic uncertainty (2 classes)

Page 16: Uncertainty

Uncertainty 16

Axioms of probability

Notion of ProbabilityNotion of Probability

The probability of a proposition A is a real number P(A) between 0 and 1P(True) = 1 and P(False) = 0P(AvB) = P(A) + P(B) - P(AB)

You drive on 101 to SFO often, and you notice that 70%of the times there is a traffic slowdown at the exit to highway 92. The next time you plan to drive on 101, you will believe that the proposition “there is a slowdown at the exit to 92” is True with probability 0.7

P(AvA) = 1 = P(A) + P(A)So:P(A) = 1 - P(A)

Page 17: Uncertainty

Uncertainty 17

Frequency InterpretationFrequency Interpretation

Draw a ball from a bag containing n balls of the same size, r red and s yellow.The probability that the proposition A = “the ball is red” is true corresponds to the relative frequency with which we expect to draw a red ball P(A) = r/n

Page 18: Uncertainty

Uncertainty 18

Subjective InterpretationSubjective Interpretation There are many situations in which

there is no objective frequency interpretation: On a windy day, just before paragliding

from the top of El Capitan, you say “there is probability 0.05 that I am going to die”

You have worked hard on your AI class and you believe that the probability that you will get an A is 0.9

Page 19: Uncertainty

Uncertainty 19

Random VariablesRandom VariablesA proposition that takes the value True with probability p and False with probability 1-p is a random variable with distribution (p,1-p)If a bag contains balls having 3 possible colors – red, yellow, and blue – the color of a ball picked at random from the bag is a random variable with 3 possible valuesThe (probability) distribution of a random variable X with n values x1, x2, …, xn is: (p1, p2, …, pn) with P(X=xi) = pi and i=1,…,n pi = 1

Page 20: Uncertainty

Uncertainty 20

Expected ValueExpected ValueRandom variable X with n values x1,…,xn and distribution (p1,…,pn)E.g.: X is the state reached after doing an action A under uncertaintyFunction U of XE.g., U is the utility of a stateThe expected value of U after doing A is E[U] = i=1,…,n pi U(xi)

Page 21: Uncertainty

Uncertainty 21

Joint DistributionJoint Distributionk random variables X1, …, Xk

The joint distribution of these variables is a table in which each entry gives the probability of one combination of values of X1, …, Xk

Example:

P(CavityToothache)P(CavityToothache)

Toothache

Toothache

Cavity 0.04 0.06Cavity

0.01 0.89

Page 22: Uncertainty

Uncertainty 22

Joint Distribution Says It AllJoint Distribution Says It All

P(Toothache) = P((Toothache Cavity) v (ToothacheCavity)) = P(Toothache Cavity) + P(ToothacheCavity) = 0.04 + 0.01 = 0.05

P(Toothache v Cavity) = P((Toothache Cavity) v (ToothacheCavity) v (Toothache Cavity)) = 0.04 + 0.01 + 0.06 = 0.11

Toothache

Toothache

Cavity 0.04 0.06Cavity

0.01 0.89

Page 23: Uncertainty

Uncertainty 23

Conditional ProbabilityConditional ProbabilityDefinition:P(AB) = P(A|B) P(B)Read P(A|B): Probability of A given that we know BP(A) is called the prior probability of AP(A|B) is called the posterior or conditional probability of A given B

Page 24: Uncertainty

Uncertainty 24

ExampleExample

P(CavityToothache) = P(Cavity|Toothache) P(Toothache)P(Cavity) = 0.1P(Cavity|Toothache) = P(CavityToothache) / P(Toothache) = 0.04/0.05 = 0.8

Toothache

Toothache

Cavity 0.04 0.06Cavity

0.01 0.89

Page 25: Uncertainty

Uncertainty 25

GeneralizationGeneralization

P(A B C) = P(A|B,C) P(B|C) P(C)

Page 26: Uncertainty

Uncertainty 26

Conditional IndependenceConditional Independence

Propositions A and B are (conditionally) independent iff: P(A|B) = P(A) P(AB) = P(A) P(B)A and B are independent given C iff: P(A|B,C) = P(A|C) P(AB|C) = P(A|C) P(B|C)

Page 27: Uncertainty

Uncertainty 27

Car ExampleCar ExampleThree propositions: Gas Battery Starts

P(Battery|Gas) = P(Battery)Gas and Battery are independentP(Battery|Gas,Starts) ≠ P(Battery|Starts)Gas and Battery are not independent given Starts

Page 28: Uncertainty

Uncertainty 28

Conditional IndependenceConditional IndependenceLet A and B be independent, i.e.:

P(A|B) = P(A) P(AB) = P(A) P(B)What about A and B?

Page 29: Uncertainty

Uncertainty 29

Conditional IndependenceConditional IndependenceLet A and B be independent, i.e.:

P(A|B) = P(A) P(AB) = P(A) P(B)What about A and B?

P(A|B) = P(A B)/P(B)

Page 30: Uncertainty

Uncertainty 30

Conditional IndependenceConditional IndependenceLet A and B be independent, i.e.:

P(A|B) = P(A) P(AB) = P(A) P(B)What about A and B?

P(A|B) = P(A B)/P(B)A = (AB) v (AB)P(A) = P(AB) + P(AB)

Page 31: Uncertainty

Uncertainty 31

Conditional IndependenceConditional IndependenceLet A and B be independent, i.e.:

P(A|B) = P(A) P(AB) = P(A) P(B)What about A and B?

P(A|B) = P(A B)/P(B)A = (AB) v (AB)P(A) = P(AB) + P(AB)P(AB) = P(A) x (1-P(B)) P(B) = 1-P(B)

Page 32: Uncertainty

Uncertainty 32

Bayes’ RuleBayes’ Rule

P(A B) = P(A|B) P(B) = P(B|A) P(A)

P(B|A) =P(A|B) P(B)P(A)

Page 33: Uncertainty

Uncertainty 33

ExampleExample

Given: P(Cavity) = 0.1 P(Toothache) = 0.05 P(Cavity|Toothache) = 0.8Bayes’ rule tells: P(Toothache|Cavity) = (0.8 x

0.05)/0.1 = 0.4

Page 34: Uncertainty

Uncertainty 34

GeneralizationGeneralization

P(ABC) = P(AB|C) P(C) = P(A|B,C) P(B|C) P(C)P(ABC) = P(AB|C) P(C) = P(B|A,C) P(A|C) P(C)

P(B|A,C) = P(A|B,C) P(B|C)P(A|C)

Page 35: Uncertainty

Uncertainty 35

SummarySummaryTypes of uncertaintyDefault/worst-case/probabilistic reasoningProbabilityRandom variable/expected valueJoint distributionConditional probabilityConditional independenceBayes’ rule