Reasoning with Probabilities Paolo Turrini Department of Computing, - - PowerPoint PPT Presentation

reasoning with probabilities
SMART_READER_LITE
LIVE PREVIEW

Reasoning with Probabilities Paolo Turrini Department of Computing, - - PowerPoint PPT Presentation

Intro to AI (2nd Part) Reasoning with Probabilities Paolo Turrini Department of Computing, Imperial College London Introduction to Artificial Intelligence 2nd Part Paolo Turrini Intro to AI (2nd Part) Intro to AI (2nd Part) The main


slide-1
SLIDE 1

Intro to AI (2nd Part)

Reasoning with Probabilities

Paolo Turrini

Department of Computing, Imperial College London

Introduction to Artificial Intelligence 2nd Part

Paolo Turrini Intro to AI (2nd Part)

slide-2
SLIDE 2

Intro to AI (2nd Part)

The main reference

Stuart Russell and Peter Norvig Artificial Intelligence: a modern approach Chapter 14

Paolo Turrini Intro to AI (2nd Part)

slide-3
SLIDE 3

Intro to AI (2nd Part)

Today

Paolo Turrini Intro to AI (2nd Part)

slide-4
SLIDE 4

Intro to AI (2nd Part)

Today

Bayes’ rule Conditional independence Back to the Wumpus World Bayesian Networks

Paolo Turrini Intro to AI (2nd Part)

slide-5
SLIDE 5

Intro to AI (2nd Part)

Bayes’ Rule

Paolo Turrini Intro to AI (2nd Part)

slide-6
SLIDE 6

Intro to AI (2nd Part)

Holiday

Paolo Turrini Intro to AI (2nd Part)

slide-7
SLIDE 7

Intro to AI (2nd Part)

Holiday

Upon your return from a holiday on an exotic island, your doctor has bad news and good news.

Paolo Turrini Intro to AI (2nd Part)

slide-8
SLIDE 8

Intro to AI (2nd Part)

Holiday

Upon your return from a holiday on an exotic island, your doctor has bad news and good news. The bad news is that you’ve been diagnosed a serious disease and the test is 99% accurate.

Paolo Turrini Intro to AI (2nd Part)

slide-9
SLIDE 9

Intro to AI (2nd Part)

Holiday

Upon your return from a holiday on an exotic island, your doctor has bad news and good news. The bad news is that you’ve been diagnosed a serious disease and the test is 99% accurate. The good news is that the disease is very rare (1 in 10.000 get it).

Paolo Turrini Intro to AI (2nd Part)

slide-10
SLIDE 10

Intro to AI (2nd Part)

Holiday

Upon your return from a holiday on an exotic island, your doctor has bad news and good news. The bad news is that you’ve been diagnosed a serious disease and the test is 99% accurate. The good news is that the disease is very rare (1 in 10.000 get it). How worried should you be?

Paolo Turrini Intro to AI (2nd Part)

slide-11
SLIDE 11

Intro to AI (2nd Part)

Conditional probability and Bayes’ Rule

Definition of conditional probability: P(a|b) = P(a ∧ b) P(b) if P(b) = 0

Paolo Turrini Intro to AI (2nd Part)

slide-12
SLIDE 12

Intro to AI (2nd Part)

Conditional probability and Bayes’ Rule

Definition of conditional probability: P(a|b) = P(a ∧ b) P(b) if P(b) = 0 Product rule gives an alternative formulation: P(a ∧ b) = P(a|b)P(b) = P(b|a)P(a)

Paolo Turrini Intro to AI (2nd Part)

slide-13
SLIDE 13

Intro to AI (2nd Part)

Conditional probability and Bayes’ Rule

Definition of conditional probability: P(a|b) = P(a ∧ b) P(b) if P(b) = 0 Product rule gives an alternative formulation: P(a ∧ b) = P(a|b)P(b) = P(b|a)P(a) but then...

Paolo Turrini Intro to AI (2nd Part)

slide-14
SLIDE 14

Intro to AI (2nd Part)

Bayes’ Rule

P(a|b) = P(b|a)P(a) P(b)

Paolo Turrini Intro to AI (2nd Part)

slide-15
SLIDE 15

Intro to AI (2nd Part)

Bayes’ Rule

Useful for assessing diagnostic probability from causal probability: P(Cause|Effect) = P(Effect|Cause)P(Cause) P(Effect)

Paolo Turrini Intro to AI (2nd Part)

slide-16
SLIDE 16

Intro to AI (2nd Part)

Bayes’ Rule

Useful for assessing diagnostic probability from causal probability: P(Cause|Effect) = P(Effect|Cause)P(Cause) P(Effect) E.g., let c be cold, s be sore throat: P(c|s) = P(s|c)P(c) P(s) = 0.9 × 0.001 0.005 = 0.18

Paolo Turrini Intro to AI (2nd Part)

slide-17
SLIDE 17

Intro to AI (2nd Part)

Bayes’ rule

P(c|s) = P(s|c)P(c) P(s) = 0.9 × 0.001 0.005 = 0.18

Paolo Turrini Intro to AI (2nd Part)

slide-18
SLIDE 18

Intro to AI (2nd Part)

Bayes’ rule

P(c|s) = P(s|c)P(c) P(s) = 0.9 × 0.001 0.005 = 0.18 We might not know the prior probability of the evidence P(S)

Paolo Turrini Intro to AI (2nd Part)

slide-19
SLIDE 19

Intro to AI (2nd Part)

Bayes’ rule

P(c|s) = P(s|c)P(c) P(s) = 0.9 × 0.001 0.005 = 0.18 We might not know the prior probability of the evidence P(S) In this case...

Paolo Turrini Intro to AI (2nd Part)

slide-20
SLIDE 20

Intro to AI (2nd Part)

Bayes’ rule

P(c|s) = P(s|c)P(c) P(s) = 0.9 × 0.001 0.005 = 0.18 We might not know the prior probability of the evidence P(S) In this case... we compute the posterior probability for each value of the query variable (c, ¬c)

Paolo Turrini Intro to AI (2nd Part)

slide-21
SLIDE 21

Intro to AI (2nd Part)

Bayes’ rule

P(c|s) = P(s|c)P(c) P(s) = 0.9 × 0.001 0.005 = 0.18 We might not know the prior probability of the evidence P(S) In this case... we compute the posterior probability for each value of the query variable (c, ¬c) and then normalise

Paolo Turrini Intro to AI (2nd Part)

slide-22
SLIDE 22

Intro to AI (2nd Part)

Bayes’ rule

P(c|s) = P(s|c)P(c) P(s) = 0.9 × 0.001 0.005 = 0.18 We might not know the prior probability of the evidence P(S) In this case... we compute the posterior probability for each value of the query variable (c, ¬c) and then normalise P(C|s) = α P(s|c)P(c), P(s|¬c)P(¬c)

Paolo Turrini Intro to AI (2nd Part)

slide-23
SLIDE 23

Intro to AI (2nd Part)

Bayes’ Rule

P(X|Y ) = α P(Y |X)P(X)

Paolo Turrini Intro to AI (2nd Part)

slide-24
SLIDE 24

Intro to AI (2nd Part)

Holiday solved

Upon your return from a holiday on an exotic island, your doctor has bad news and good news. The bad news is that you’ve been diagnosed a serious disease and the test is 99% accurate. The good news is that the disease is very rare (1 in 10.000 get it).

Paolo Turrini Intro to AI (2nd Part)

slide-25
SLIDE 25

Intro to AI (2nd Part)

Holiday solved

Upon your return from a holiday on an exotic island, your doctor has bad news and good news. The bad news is that you’ve been diagnosed a serious disease and the test is 99% accurate. The good news is that the disease is very rare (1 in 10.000 get it).

Paolo Turrini Intro to AI (2nd Part)

slide-26
SLIDE 26

Intro to AI (2nd Part)

Holiday solved

Upon your return from a holiday on an exotic island, your doctor has bad news and good news. The bad news is that you’ve been diagnosed a serious disease and the test is 99% accurate. The good news is that the disease is very rare (1 in 10.000 get it). E.g., let D be disease, P be that you scored positive at the test:

Paolo Turrini Intro to AI (2nd Part)

slide-27
SLIDE 27

Intro to AI (2nd Part)

Holiday solved

Upon your return from a holiday on an exotic island, your doctor has bad news and good news. The bad news is that you’ve been diagnosed a serious disease and the test is 99% accurate. The good news is that the disease is very rare (1 in 10.000 get it). E.g., let D be disease, P be that you scored positive at the test: P(d|p)

Paolo Turrini Intro to AI (2nd Part)

slide-28
SLIDE 28

Intro to AI (2nd Part)

Holiday solved

Upon your return from a holiday on an exotic island, your doctor has bad news and good news. The bad news is that you’ve been diagnosed a serious disease and the test is 99% accurate. The good news is that the disease is very rare (1 in 10.000 get it). E.g., let D be disease, P be that you scored positive at the test: P(d|p) =

P(p|d)P(d) P(p|d)P(d)+P(p|¬d)P(¬d)

Paolo Turrini Intro to AI (2nd Part)

slide-29
SLIDE 29

Intro to AI (2nd Part)

Holiday solved

Upon your return from a holiday on an exotic island, your doctor has bad news and good news. The bad news is that you’ve been diagnosed a serious disease and the test is 99% accurate. The good news is that the disease is very rare (1 in 10.000 get it). E.g., let D be disease, P be that you scored positive at the test: P(d|p) =

P(p|d)P(d) P(p|d)P(d)+P(p|¬d)P(¬d) = 0.99×0.0001 0.99×0.0001+0.01×0.9999

Paolo Turrini Intro to AI (2nd Part)

slide-30
SLIDE 30

Intro to AI (2nd Part)

Holiday solved

Upon your return from a holiday on an exotic island, your doctor has bad news and good news. The bad news is that you’ve been diagnosed a serious disease and the test is 99% accurate. The good news is that the disease is very rare (1 in 10.000 get it). E.g., let D be disease, P be that you scored positive at the test: P(d|p) =

P(p|d)P(d) P(p|d)P(d)+P(p|¬d)P(¬d) = 0.99×0.0001 0.99×0.0001+0.01×0.9999 = 0.0098

Paolo Turrini Intro to AI (2nd Part)

slide-31
SLIDE 31

Intro to AI (2nd Part)

Holiday solved

Upon your return from a holiday on an exotic island, your doctor has bad news and good news. The bad news is that you’ve been diagnosed a serious disease and the test is 99% accurate. The good news is that the disease is very rare (1 in 10.000 get it). E.g., let D be disease, P be that you scored positive at the test: P(d|p) =

P(p|d)P(d) P(p|d)P(d)+P(p|¬d)P(¬d) = 0.99×0.0001 0.99×0.0001+0.01×0.9999 = 0.0098

Notice:posterior probability of disease still quite small!

Paolo Turrini Intro to AI (2nd Part)

slide-32
SLIDE 32

Intro to AI (2nd Part)

Back to joint distributions: combining evidence

Paolo Turrini Intro to AI (2nd Part)

Start with the joint distribution: P(Cavity|toothache ∧ catch) =

slide-33
SLIDE 33

Intro to AI (2nd Part)

Back to joint distributions: combining evidence

Paolo Turrini Intro to AI (2nd Part)

Start with the joint distribution: P(Cavity|toothache ∧ catch) = α 0.108, 0.016

slide-34
SLIDE 34

Intro to AI (2nd Part)

Back to joint distributions: combining evidence

Paolo Turrini Intro to AI (2nd Part)

Start with the joint distribution: P(Cavity|toothache ∧ catch) = α 0.108, 0.016 =

slide-35
SLIDE 35

Intro to AI (2nd Part)

Back to joint distributions: combining evidence

Paolo Turrini Intro to AI (2nd Part)

Start with the joint distribution: P(Cavity|toothache ∧ catch) = α 0.108, 0.016 = 0.871, 0.129

slide-36
SLIDE 36

Intro to AI (2nd Part)

Back to joint distributions: combining evidence

Paolo Turrini Intro to AI (2nd Part)

Start with the joint distribution: It doesn’t scale up to a large number of variables Absolute Independence is very rare Can we use Bayes’ rule?

slide-37
SLIDE 37

Intro to AI (2nd Part)

Back to joint distributions: combining evidence

Paolo Turrini Intro to AI (2nd Part)

Start with the joint distribution: P(Cavity|toothache ∧ catch) = α P(toothache ∧ catch|Cavity)P(Cavity)

slide-38
SLIDE 38

Intro to AI (2nd Part)

Back to joint distributions: combining evidence

Paolo Turrini Intro to AI (2nd Part)

Start with the joint distribution: P(Cavity|toothache ∧ catch) = α P(toothache ∧ catch|Cavity)P(Cavity) Still not good: with n evidence variables 2n possible combinations for which we would need to know the conditional probabilities

slide-39
SLIDE 39

Intro to AI (2nd Part)

Back to joint distributions: combining evidence

We can’t use absolute independence:

Paolo Turrini Intro to AI (2nd Part)

slide-40
SLIDE 40

Intro to AI (2nd Part)

Back to joint distributions: combining evidence

We can’t use absolute independence: Toothache and Catch are not independent:

Paolo Turrini Intro to AI (2nd Part)

slide-41
SLIDE 41

Intro to AI (2nd Part)

Back to joint distributions: combining evidence

We can’t use absolute independence: Toothache and Catch are not independent: If the probe catches in the tooth then it is likely the tooth has a cavity, which means that toothache is likely too.

Paolo Turrini Intro to AI (2nd Part)

slide-42
SLIDE 42

Intro to AI (2nd Part)

Back to joint distributions: combining evidence

We can’t use absolute independence: Toothache and Catch are not independent: If the probe catches in the tooth then it is likely the tooth has a cavity, which means that toothache is likely too. But they are independent given the presence or the absence

  • f cavity!

Paolo Turrini Intro to AI (2nd Part)

slide-43
SLIDE 43

Intro to AI (2nd Part)

Back to joint distributions: combining evidence

We can’t use absolute independence: Toothache and Catch are not independent: If the probe catches in the tooth then it is likely the tooth has a cavity, which means that toothache is likely too. But they are independent given the presence or the absence

  • f cavity! Toothache depends on the state of the nerves in the

tooth, catch depends on the dentist’s skills, to which toothache is irrelevant

Paolo Turrini Intro to AI (2nd Part)

slide-44
SLIDE 44

Intro to AI (2nd Part)

Conditional Independence

Paolo Turrini Intro to AI (2nd Part)

slide-45
SLIDE 45

Intro to AI (2nd Part)

Conditional independence

Paolo Turrini Intro to AI (2nd Part)

slide-46
SLIDE 46

Intro to AI (2nd Part)

Conditional independence

1 P(catch|toothache, cavity) = P(catch|cavity), the same

independence holds if I haven’t got a cavity:

Paolo Turrini Intro to AI (2nd Part)

slide-47
SLIDE 47

Intro to AI (2nd Part)

Conditional independence

1 P(catch|toothache, cavity) = P(catch|cavity), the same

independence holds if I haven’t got a cavity:

2 P(catch|toothache, ¬cavity) = P(catch|¬cavity) Paolo Turrini Intro to AI (2nd Part)

slide-48
SLIDE 48

Intro to AI (2nd Part)

Conditional independence

1 P(catch|toothache, cavity) = P(catch|cavity), the same

independence holds if I haven’t got a cavity:

2 P(catch|toothache, ¬cavity) = P(catch|¬cavity)

Catch is conditionally independent of Toothache given Cavity:

Paolo Turrini Intro to AI (2nd Part)

slide-49
SLIDE 49

Intro to AI (2nd Part)

Conditional independence

P(Catch|Toothache, Cavity) = P(Catch|Cavity)

Paolo Turrini Intro to AI (2nd Part)

slide-50
SLIDE 50

Intro to AI (2nd Part)

Conditional independence

P(Catch|Toothache, Cavity) = P(Catch|Cavity) Equivalent statements:

Paolo Turrini Intro to AI (2nd Part)

slide-51
SLIDE 51

Intro to AI (2nd Part)

Conditional independence

P(Catch|Toothache, Cavity) = P(Catch|Cavity) Equivalent statements: P(Toothache|Catch, Cavity) = P(Toothache|Cavity)

Paolo Turrini Intro to AI (2nd Part)

slide-52
SLIDE 52

Intro to AI (2nd Part)

Conditional independence

P(Catch|Toothache, Cavity) = P(Catch|Cavity) Equivalent statements: P(Toothache|Catch, Cavity) = P(Toothache|Cavity) P(Toothache, Catch|Cavity) = P(Toothache|Cavity)P(Catch|Cavity)

Paolo Turrini Intro to AI (2nd Part)

slide-53
SLIDE 53

Intro to AI (2nd Part)

Conditional independence contd.

Write out full joint distribution using chain rule: P(Toothache, Catch, Cavity)

Paolo Turrini Intro to AI (2nd Part)

slide-54
SLIDE 54

Intro to AI (2nd Part)

Conditional independence contd.

Write out full joint distribution using chain rule: P(Toothache, Catch, Cavity) = P(Toothache|Catch, Cavity)P(Catch, Cavity)

Paolo Turrini Intro to AI (2nd Part)

slide-55
SLIDE 55

Intro to AI (2nd Part)

Conditional independence contd.

Write out full joint distribution using chain rule: P(Toothache, Catch, Cavity) = P(Toothache|Catch, Cavity)P(Catch, Cavity) = P(Toothache|Catch, Cavity)P(Catch|Cavity)P(Cavity)

Paolo Turrini Intro to AI (2nd Part)

slide-56
SLIDE 56

Intro to AI (2nd Part)

Conditional independence contd.

Write out full joint distribution using chain rule: P(Toothache, Catch, Cavity) = P(Toothache|Catch, Cavity)P(Catch, Cavity) = P(Toothache|Catch, Cavity)P(Catch|Cavity)P(Cavity) = P(Toothache|Cavity)P(Catch|Cavity)P(Cavity)

Paolo Turrini Intro to AI (2nd Part)

slide-57
SLIDE 57

Intro to AI (2nd Part)

Conditional independence contd.

Write out full joint distribution using chain rule: P(Toothache, Catch, Cavity) = P(Toothache|Catch, Cavity)P(Catch, Cavity) = P(Toothache|Catch, Cavity)P(Catch|Cavity)P(Cavity) = P(Toothache|Cavity)P(Catch|Cavity)P(Cavity) I.e., 2 + 2 + 1 = 5 independent numbers (equations 1 and 2 remove 2)

Paolo Turrini Intro to AI (2nd Part)

slide-58
SLIDE 58

Intro to AI (2nd Part)

Conditional independence contd.

In most cases, the use of conditional independence reduces the size

  • f the representation of the joint distribution from exponential in n

to linear in n.

Paolo Turrini Intro to AI (2nd Part)

slide-59
SLIDE 59

Intro to AI (2nd Part)

Conditional independence contd.

In most cases, the use of conditional independence reduces the size

  • f the representation of the joint distribution from exponential in n

to linear in n. Conditional independence is our most basic and robust form of knowledge about uncertain environments.

Paolo Turrini Intro to AI (2nd Part)

slide-60
SLIDE 60

Intro to AI (2nd Part)

Bayes’ Rule and conditional independence

P(Cavity|toothache ∧ catch)

Paolo Turrini Intro to AI (2nd Part)

slide-61
SLIDE 61

Intro to AI (2nd Part)

Bayes’ Rule and conditional independence

P(Cavity|toothache ∧ catch) = α P(toothache ∧ catch|Cavity)P(Cavity)

Paolo Turrini Intro to AI (2nd Part)

slide-62
SLIDE 62

Intro to AI (2nd Part)

Bayes’ Rule and conditional independence

P(Cavity|toothache ∧ catch) = α P(toothache ∧ catch|Cavity)P(Cavity) = α P(toothache|Cavity)P(catch|Cavity)P(Cavity)

Paolo Turrini Intro to AI (2nd Part)

slide-63
SLIDE 63

Intro to AI (2nd Part)

Bayes’ Rule and conditional independence

P(Cavity|toothache ∧ catch) = α P(toothache ∧ catch|Cavity)P(Cavity) = α P(toothache|Cavity)P(catch|Cavity)P(Cavity)

Paolo Turrini Intro to AI (2nd Part)

slide-64
SLIDE 64

Intro to AI (2nd Part)

Bayes’ Rule and conditional independence

P(Cavity|toothache ∧ catch) = α P(toothache ∧ catch|Cavity)P(Cavity) = α P(toothache|Cavity)P(catch|Cavity)P(Cavity) This is an example of a naive Bayes model: P(Cause, Effect1, . . . , Effectn) = P(Cause)ΠiP(Effecti|Cause)

Paolo Turrini Intro to AI (2nd Part)

slide-65
SLIDE 65

Intro to AI (2nd Part)

Bayes’ Rule and conditional independence

P(Cavity|toothache ∧ catch) = α P(toothache ∧ catch|Cavity)P(Cavity) = α P(toothache|Cavity)P(catch|Cavity)P(Cavity) This is an example of a naive Bayes model: P(Cause, Effect1, . . . , Effectn) = P(Cause)ΠiP(Effecti|Cause) Total number of parameters is linear in n

Paolo Turrini Intro to AI (2nd Part)

slide-66
SLIDE 66

Intro to AI (2nd Part)

The Wumps World

Paolo Turrini Intro to AI (2nd Part)

slide-67
SLIDE 67

Intro to AI (2nd Part)

The Wumpus World

Paolo Turrini Intro to AI (2nd Part)

slide-68
SLIDE 68

Intro to AI (2nd Part)

The Wumpus World

Paolo Turrini Intro to AI (2nd Part)

slide-69
SLIDE 69

Intro to AI (2nd Part)

The Wumpus World

Paolo Turrini Intro to AI (2nd Part)

slide-70
SLIDE 70

Intro to AI (2nd Part)

The Wumpus World

Paolo Turrini Intro to AI (2nd Part)

slide-71
SLIDE 71

Intro to AI (2nd Part)

The Wumpus World

Paolo Turrini Intro to AI (2nd Part)

slide-72
SLIDE 72

Intro to AI (2nd Part)

The Wumpus World

Paolo Turrini Intro to AI (2nd Part)

slide-73
SLIDE 73

Intro to AI (2nd Part)

The Wumpus World

Paolo Turrini Intro to AI (2nd Part)

slide-74
SLIDE 74

Intro to AI (2nd Part)

The Wumpus World

Paolo Turrini Intro to AI (2nd Part)

slide-75
SLIDE 75

Intro to AI (2nd Part)

The Wumpus World

Paolo Turrini Intro to AI (2nd Part)

slide-76
SLIDE 76

Intro to AI (2nd Part)

Wumpus World

Paolo Turrini Intro to AI (2nd Part)

slide-77
SLIDE 77

Intro to AI (2nd Part)

Wumpus World

Pij = true iff [i, j] contains a pit Bij = true iff [i, j] is breezy

Paolo Turrini Intro to AI (2nd Part)

slide-78
SLIDE 78

Intro to AI (2nd Part)

Wumpus World

Pij = true iff [i, j] contains a pit Bij = true iff [i, j] is breezy

Paolo Turrini Intro to AI (2nd Part)

slide-79
SLIDE 79

Intro to AI (2nd Part)

Specifying the probability model

Paolo Turrini Intro to AI (2nd Part)

slide-80
SLIDE 80

Intro to AI (2nd Part)

Specifying the probability model

Include only B1,1, B1,2, B2,1 in the probability model!

Paolo Turrini Intro to AI (2nd Part)

slide-81
SLIDE 81

Intro to AI (2nd Part)

Specifying the probability model

Include only B1,1, B1,2, B2,1 in the probability model! The full joint distribution is P(P1,1, . . . , P4,4, B1,1, B1,2, B2,1)

Paolo Turrini Intro to AI (2nd Part)

slide-82
SLIDE 82

Intro to AI (2nd Part)

Specifying the probability model

Include only B1,1, B1,2, B2,1 in the probability model! The full joint distribution is P(P1,1, . . . , P4,4, B1,1, B1,2, B2,1) Apply product rule: P(B1,1, B1,2, B2,1 | P1,1, . . . , P4,4)P(P1,1, . . . , P4,4) (Do it this way to get P(Effect|Cause).)

Paolo Turrini Intro to AI (2nd Part)

slide-83
SLIDE 83

Intro to AI (2nd Part)

Specifying the probability model

Include only B1,1, B1,2, B2,1 in the probability model! The full joint distribution is P(P1,1, . . . , P4,4, B1,1, B1,2, B2,1) Apply product rule: P(B1,1, B1,2, B2,1 | P1,1, . . . , P4,4)P(P1,1, . . . , P4,4) (Do it this way to get P(Effect|Cause).) First term: 1 if pits are adjacent to breezes, 0 otherwise

Paolo Turrini Intro to AI (2nd Part)

slide-84
SLIDE 84

Intro to AI (2nd Part)

Specifying the probability model

Include only B1,1, B1,2, B2,1 in the probability model! The full joint distribution is P(P1,1, . . . , P4,4, B1,1, B1,2, B2,1) Apply product rule: P(B1,1, B1,2, B2,1 | P1,1, . . . , P4,4)P(P1,1, . . . , P4,4) (Do it this way to get P(Effect|Cause).) First term: 1 if pits are adjacent to breezes, 0 otherwise Second term: pits are placed randomly, probability 0.2 per square:

Paolo Turrini Intro to AI (2nd Part)

slide-85
SLIDE 85

Intro to AI (2nd Part)

Specifying the probability model

Include only B1,1, B1,2, B2,1 in the probability model! The full joint distribution is P(P1,1, . . . , P4,4, B1,1, B1,2, B2,1) Apply product rule: P(B1,1, B1,2, B2,1 | P1,1, . . . , P4,4)P(P1,1, . . . , P4,4) (Do it this way to get P(Effect|Cause).) First term: 1 if pits are adjacent to breezes, 0 otherwise Second term: pits are placed randomly, probability 0.2 per square: P(P1,1, . . . , P4,4) = Π

4,4 i,j = 1,1P(Pi,j) = 0.2n × 0.816−n

for n pits.

Paolo Turrini Intro to AI (2nd Part)

slide-86
SLIDE 86

Intro to AI (2nd Part)

Observations and query

We know the following facts: b = ¬b1,1 ∧ b1,2 ∧ b2,1

Paolo Turrini Intro to AI (2nd Part)

slide-87
SLIDE 87

Intro to AI (2nd Part)

Observations and query

We know the following facts: b = ¬b1,1 ∧ b1,2 ∧ b2,1 explored = ¬p1,1 ∧ ¬p1,2 ∧ ¬p2,1

Paolo Turrini Intro to AI (2nd Part)

slide-88
SLIDE 88

Intro to AI (2nd Part)

Observations and query

We know the following facts: b = ¬b1,1 ∧ b1,2 ∧ b2,1 explored = ¬p1,1 ∧ ¬p1,2 ∧ ¬p2,1 Query is P(P1,3|explored, b)

Paolo Turrini Intro to AI (2nd Part)

slide-89
SLIDE 89

Intro to AI (2nd Part)

Observations and query

We know the following facts: b = ¬b1,1 ∧ b1,2 ∧ b2,1 explored = ¬p1,1 ∧ ¬p1,2 ∧ ¬p2,1 Query is P(P1,3|explored, b) Define Unexplored = Pijs other than P1,3 and Explored

Paolo Turrini Intro to AI (2nd Part)

slide-90
SLIDE 90

Intro to AI (2nd Part)

Observations and query

We know the following facts: b = ¬b1,1 ∧ b1,2 ∧ b2,1 explored = ¬p1,1 ∧ ¬p1,2 ∧ ¬p2,1 Query is P(P1,3|explored, b) Define Unexplored = Pijs other than P1,3 and Explored

Paolo Turrini Intro to AI (2nd Part)

slide-91
SLIDE 91

Intro to AI (2nd Part)

Complexity

For inference by enumeration, we have P(P1,3|explored, b) = αΣunexploredP(P1,3, unexplored, explored, b)

Paolo Turrini Intro to AI (2nd Part)

slide-92
SLIDE 92

Intro to AI (2nd Part)

Complexity

For inference by enumeration, we have P(P1,3|explored, b) = αΣunexploredP(P1,3, unexplored, explored, b) There are 12 unknown squares

Paolo Turrini Intro to AI (2nd Part)

slide-93
SLIDE 93

Intro to AI (2nd Part)

Complexity

For inference by enumeration, we have P(P1,3|explored, b) = αΣunexploredP(P1,3, unexplored, explored, b) There are 12 unknown squares The summation contains 212 = 4096 terms

Paolo Turrini Intro to AI (2nd Part)

slide-94
SLIDE 94

Intro to AI (2nd Part)

Complexity

For inference by enumeration, we have P(P1,3|explored, b) = αΣunexploredP(P1,3, unexplored, explored, b) There are 12 unknown squares The summation contains 212 = 4096 terms In general the summation grows exponentiatlly with the number of squares!

Paolo Turrini Intro to AI (2nd Part)

slide-95
SLIDE 95

Intro to AI (2nd Part)

Complexity

For inference by enumeration, we have P(P1,3|explored, b) = αΣunexploredP(P1,3, unexplored, explored, b) There are 12 unknown squares The summation contains 212 = 4096 terms In general the summation grows exponentiatlly with the number of squares! And now?

Paolo Turrini Intro to AI (2nd Part)

slide-96
SLIDE 96

Intro to AI (2nd Part)

Using conditional independence

Basic insight: observations are conditionally independent of other hidden squares given neighbouring hidden squares

Paolo Turrini Intro to AI (2nd Part)

slide-97
SLIDE 97

Intro to AI (2nd Part)

Using conditional independence

Basic insight: observations are conditionally independent of other hidden squares given neighbouring hidden squares

Paolo Turrini Intro to AI (2nd Part)

slide-98
SLIDE 98

Intro to AI (2nd Part)

Using conditional independence

Basic insight: observations are conditionally independent of other hidden squares given neighbouring hidden squares Define Unexplored = Fringe ∪ Other

Paolo Turrini Intro to AI (2nd Part)

slide-99
SLIDE 99

Intro to AI (2nd Part)

Using conditional independence

Basic insight: observations are conditionally independent of other hidden squares given neighbouring hidden squares Define Unexplored = Fringe ∪ Other P(b|P1,3, Explored, Unexplored) = P(b|P1,3, Explored, Fringe)

Paolo Turrini Intro to AI (2nd Part)

slide-100
SLIDE 100

Intro to AI (2nd Part)

Using conditional independence

Basic insight: observations are conditionally independent of other hidden squares given neighbouring hidden squares Define Unexplored = Fringe ∪ Other P(b|P1,3, Explored, Unexplored) = P(b|P1,3, Explored, Fringe) Manipulate query into a form where we can use this!

Paolo Turrini Intro to AI (2nd Part)

slide-101
SLIDE 101

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

P(P1,3|explored, b)

slide-102
SLIDE 102

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

P(P1,3|explored, b) = α

unexplored P(P1,3, unexplored, explored, b)

slide-103
SLIDE 103

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

Inference by enumeration P(P1,3|explored, b) = α

unexplored P(P1,3, unexplored, explored, b)

slide-104
SLIDE 104

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

α

unexplored P(P1,3, unexplored, explored, b)

slide-105
SLIDE 105

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

α

unexplored P(P1,3, unexplored, explored, b)

= α

unexplored P(b|explored, P1,3, unexplored)×

×P(P1,3, explored, unexplored)

slide-106
SLIDE 106

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

Product rule

α

unexplored P(P1,3, unexplored, explored, b)

= α

unexplored P(b|explored, P1,3, unexplored)×

×P(P1,3, explored, unexplored)

slide-107
SLIDE 107

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

α

unexplored P(b|P1,3, unexplored, explored)P(P1,3, unexplored, explored)

slide-108
SLIDE 108

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

α

unexplored P(b|P1,3, unexplored, explored)P(P1,3, unexplored, explored)

= α

fringe

  • ther P(b|explored, P1,3, fringe, other)×

×P(P1,3, explored, fringe, other)

slide-109
SLIDE 109

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

Distinguishing the unknown

α

unexplored P(b|P1,3, unexplored, explored)P(P1,3, unexplored, explored)

= α

fringe

  • ther P(b|explored, P1,3, fringe, other)×

×P(P1,3, explored, fringe, other)

slide-110
SLIDE 110

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

α

fringe

  • ther P(b|explored, P1,3, fringe, other)×

×P(P1,3, explored, fringe, other)

slide-111
SLIDE 111

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

α

fringe

  • ther P(b|explored, P1,3, fringe, other)×

×P(P1,3, explored, fringe, other) = α

fringe

  • ther P(b|explored, P1,3, fringe)×

×P(P1,3, explored, fringe, other)

slide-112
SLIDE 112

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

Conditional Independence

α

fringe

  • ther P(b|explored, P1,3, fringe, other)×

×P(P1,3, explored, fringe, other) = α

fringe

  • ther P(b|explored, P1,3, fringe)×

×P(P1,3, explored, fringe, other)

slide-113
SLIDE 113

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

α

fringe

  • ther P(b|explored, P1,3, fringe)×

×P(P1,3, explored, fringe, other)

slide-114
SLIDE 114

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

α

fringe

  • ther P(b|explored, P1,3, fringe)×

×P(P1,3, explored, fringe, other) = α

fringeP(b|explored, P1,3, fringe)×

×

  • therP(P1,3, explored, fringe, other)
slide-115
SLIDE 115

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

Pushing the sums inwards

α

fringe

  • ther P(b|explored, P1,3, fringe)×

×P(P1,3, explored, fringe, other) = α

fringeP(b|explored, P1,3, fringe)×

×

  • therP(P1,3, explored, fringe, other)
slide-116
SLIDE 116

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

α

fringeP(b|explored, P1,3, fringe)×

  • therP(P1,3, explored, fringe, other)
slide-117
SLIDE 117

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

α

fringeP(b|explored, P1,3, fringe)×

  • therP(P1,3, explored, fringe, other)

= α

fringe P(b|explored, P1,3, fringe)×

  • ther P(P1,3)P(explored)P(fringe)P(other)
slide-118
SLIDE 118

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

Independence

α

fringeP(b|explored, P1,3, fringe)×

  • therP(P1,3, explored, fringe, other)

= α

fringe P(b|explored, P1,3, fringe)×

  • ther P(P1,3)P(explored)P(fringe)P(other)
slide-119
SLIDE 119

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

α

fringe P(b|explored, P1,3, fringe)×

×

  • ther P(P1,3)P(explored)P(fringe)P(other)
slide-120
SLIDE 120

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

α

fringe P(b|explored, P1,3, fringe)×

×

  • ther P(P1,3)P(explored)P(fringe)P(other)

= α P(explored)P(P1,3)× ×

fringe P(b|explored, P1,3, fringe)P(fringe)

  • ther P(other)
slide-121
SLIDE 121

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

Reordering and pushing sums inwards

α

fringe P(b|explored, P1,3, fringe)×

×

  • ther P(P1,3)P(explored)P(fringe)P(other)

= α P(explored)P(P1,3)× ×

fringe P(b|explored, P1,3, fringe)P(fringe)

  • ther P(other)
slide-122
SLIDE 122

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

α P(explored)P(P1,3)× ×

fringe P(b|explored, P1,3, fringe)P(fringe)

  • ther P(other)
slide-123
SLIDE 123

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

α P(explored)P(P1,3)× ×

fringe P(b|explored, P1,3, fringe)P(fringe)

  • ther P(other)

= α′ P(P1,3)

fringe P(b|explored, P1,3, fringe)P(fringe)

slide-124
SLIDE 124

Intro to AI (2nd Part)

Using conditional independence

Paolo Turrini Intro to AI (2nd Part)

Simplifying

α P(explored)P(P1,3)× ×

fringe P(b|explored, P1,3, fringe)P(fringe)

  • ther P(other)

= α′ P(P1,3)

fringe P(b|explored, P1,3, fringe)P(fringe)

slide-125
SLIDE 125

Intro to AI (2nd Part)

Using conditional independence contd.

Paolo Turrini Intro to AI (2nd Part)

P(b|explored, P1,3, fringe)

slide-126
SLIDE 126

Intro to AI (2nd Part)

Using conditional independence contd.

Paolo Turrini Intro to AI (2nd Part)

P(b|explored, P1,3, fringe) = 1 when the frontier is consistent with the observations = 0 otherwise

slide-127
SLIDE 127

Intro to AI (2nd Part)

Using conditional independence contd.

Paolo Turrini Intro to AI (2nd Part)

P(b|explored, P1,3, fringe) = 1 when the frontier is consistent with the observations = 0 otherwise We can sum over the possible configurations for the frontier variables that are consistent with the known facts.

slide-128
SLIDE 128

Intro to AI (2nd Part)

Using conditional independence contd.

Paolo Turrini Intro to AI (2nd Part)

P(P1,3|explored, b)=

slide-129
SLIDE 129

Intro to AI (2nd Part)

Using conditional independence contd.

Paolo Turrini Intro to AI (2nd Part)

P(P1,3|explored, b)= α′ 0.2(0.04 + 0.16 + 0.16), 0.8(0.04 + 0.16)

slide-130
SLIDE 130

Intro to AI (2nd Part)

Using conditional independence contd.

Paolo Turrini Intro to AI (2nd Part)

P(P1,3|explored, b)= α′ 0.2(0.04 + 0.16 + 0.16), 0.8(0.04 + 0.16) ≈ 0.31, 0.69

slide-131
SLIDE 131

Intro to AI (2nd Part)

Using conditional independence contd.

Paolo Turrini Intro to AI (2nd Part)

P(P1,3|explored, b)= α′ 0.2(0.04 + 0.16 + 0.16), 0.8(0.04 + 0.16) ≈ 0.31, 0.69 P(P2,2|explored, b) ≈ 0.86, 0.14

slide-132
SLIDE 132

Intro to AI (2nd Part)

Using conditional independence contd.

Paolo Turrini Intro to AI (2nd Part)

P(P1,3|explored, b)= α′ 0.2(0.04 + 0.16 + 0.16), 0.8(0.04 + 0.16) ≈ 0.31, 0.69 P(P2,2|explored, b) ≈ 0.86, 0.14