15-381: artificial intelligence€¦ · 15-381: artificial intelligence probabilistic reasoning and...

30
15-381: Artificial Intelligence Probabilistic Reasoning and Inference

Upload: others

Post on 18-Apr-2020

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

15-381: Artificial Intelligence

Probabilistic Reasoning and Inference

Page 2: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Advantages of probabilisticreasoning

• Appropriate for complex, uncertain, environments - Will it rain tomorrow?

• Applies naturally to many domains - Robot predicting the direction of road, biology, Word paper clip

• Allows to generalize acquired knowledge andincorporate prior belief

- Medical diagnosis

• Easy to integrate different information sources - Robot’s sensors

Page 3: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Examples• Unmanned vehicles

Page 4: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Examples: Speech processing

Page 5: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Example: Biological data

ATGAAGCTACTGTCTTCTATCGAACAAGCATGCGATATTTGCCGACTTAAAAAGCTCAAGTGCTCCAAAGAAAAACCGAAGTGCGCCAAGTGTCTGAAGAACAACTGGGAGTGTCGCTACTCTCCCAAAACCAAAAGGTCTCCGCTGACTAGGGCACATCTGACAGAAGTGGAATCAAGGCTAGAAAGACTGGAACAGCTATTTCTACTGATTTTTCCTCGAGAAGACCTTGACATGATT

Page 6: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Basic notations• Random variable - referring to an element / event whose status is unknown: A = “it will rain tomorrow”• Domain (usually denoted by Ω) - The set of values a random variable can take: - “A = The stock market will go up this year”: Binary - “A = Number of Steelers wins in 2007”: Discrete - “A = % change in Google stock in 2007”: Continuous

Page 7: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Axioms of probability(Kolmogorov’s axioms)

• A variety of useful facts can be derived from just threeaxioms:

1. 0 ≤ P(A) ≤ 12. P(true) = 1, P(false) = 03. P(A ∨ B) = P(A) + P(B) – P(A ∧ B)

Page 8: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Axioms of probability(Kolmogorov’s axioms)

• A variety of useful facts can be derived from just threeaxioms:

1. 0 ≤ P(A) ≤ 12. P(true) = 1, P(false) = 03. P(A ∨ B) = P(A) + P(B) – P(A ∧ B)

P(Steelers win the 05-06 season) = 1

Page 9: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Axioms of probability(Kolmogorov’s axioms)

• A variety of useful facts can be derived from just threeaxioms:

1. 0 ≤ P(A) ≤ 12. P(true) = 1, P(false) = 03. P(A ∨ B) = P(A) + P(B) – P(A ∧ B)

Page 10: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Axioms of probability(Kolmogorov’s axioms)

• A variety of useful facts can be derived from just threeaxioms:

1. 0 ≤ P(A) ≤ 12. P(true) = 1, P(false) = 03. P(A ∨ B) = P(A) + P(B) – P(A ∧ B)

Page 11: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Axioms of probability(Kolmogorov’s axioms)

• A variety of useful facts can be derived from just threeaxioms:

1. 0 ≤ P(A) ≤ 12. P(true) = 1, P(false) = 03. P(A ∨ B) = P(A) + P(B) – P(A ∧ B)

There have been severalother attempts to provide afoundation for probabilitytheory. Kolmogorov’saxioms are the most widelyused.

Page 12: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Example of using the axioms• Assume a probability for dice as

follows:P(1) = P(2) = P(3) = 0.2P(4) = P(5) = 0.1P(6) = ?• P({heads,tails}) = ?• P(heads)+(1-P(tails)) = ?

Page 13: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Using the axioms• How can we use the axioms to prove that: P(¬A) = 1 – P(A) ?

Page 14: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Priors

P(rain tomorrow) = 0.2

P(no rain tomorrow) = 0.8

Rain

No rainDegree of beliefin an event in theabsence of anyother information

Page 15: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Conditional probablity• What is the probability of an event given knowledge of

another event• Example: - P(raining | sunny) - P(raining | cloudy) - P(raining | cloudy, cold)

Page 16: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Conditional probability• P(A = 1 | B = 1): The fraction of cases where A is true if

B is true

P(A = 0.2) P(A|B = 0.5)

Page 17: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Conditional probability• In some cases, given knowledge of one or more

random variables we can improve upon our priorbelief of another random variable

• For example: p(slept in movie) = 0.5 p(slept in movie | liked movie) = 1/3 p(didn’t sleep in movie | liked movie) = 2/3

0.3100.1000.4010.211

PSleptLikedmovie

Page 18: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Joint distributions• The probability that a set of random

variables will take a specific value is theirjoint distribution.

• Notation: P(A ∧ B) or P(A,B)• Example: P(liked movie, slept)

0.310

0.100

0.401

0.211

PSleptLikedmovie

Page 19: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Joint distribution (cont)

1432

3131

2512

3152

1652

2121

3342

2101

Evaluation(1-3)

Class sizeTime (regular =2,summer =1)

P(class size > 20) = 0.5

P(summer) = 1/3

Evaluation of classesP(class size > 20, summer) = ?

Page 20: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Joint distribution (cont)

1432

3131

2512

3152

1652

2121

3342

2101

Evaluation(1-3)

Class sizeTime (regular =2,summer =1)

P(class size > 20) = 0.5

P(summer) = 1/3

Evaluation of classesP(class size > 20, summer) = 0

Page 21: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Joint distribution (cont)

1432

3131

2512

3152

1652

2121

3342

2101

Evaluation(1-3)

Class sizeTime (regular =2,summer =1)

P(class size > 20) = 0.5

P(eval = 1) = 2/9

P(class size > 20, eval = 1) = 2/9 Evaluation of classes

Page 22: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Chain rule• The joint distribution can be specified in terms of

conditional probability: P(A,B) = P(A|B)*P(B)• Together with Bayes rule (which is actually derived from

it) this is one of the most powerful rules in probabilisticreasoning

Page 23: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Bayes rule• One of the most important rules for AI usage.• Derived from the chain rule: P(A,B) = P(A | B)P(B) = P(B | A)P(A)• Thus,

Thomas Bayes wasan Englishclergyman who setout his theory ofprobability in 1764.

)(

)()|()|(

BP

APABPBAP =

Page 24: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Bayes rule (cont)Often it would be useful to derive the rule a bit

further:

!==

A

APABP

APABP

BP

APABPBAP

)()|(

)()|(

)(

)()|()|(

This results from:P(B) = ∑AP(B,A)

AB

AB

P(B,A=1) P(B,A=0)

Page 25: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Using Bayes rule• Cards game:

Place your bet on thelocation of the King!

Page 26: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Using Bayes rule• Cards game:

Do you want tochange your bet?

Page 27: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Using Bayes rule

)(

)()|()|(

selBP

kCPkCselBPselBkCP

====

Computing the (posterior) probability: P(C = k | selB)

A B C

)10()10|()()|(

)()|(

==+==

===

CPCselBPkCPkCselBP

kCPkCselBP

Bayes rule

Page 28: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Using Bayes rule

A B C

1/31/2

1/2 1/3 2/31/2

)10()10|()()|(

)()|(

==+==

===

CPCselBPkCPkCselBP

kCPkCselBP

= 1/3

P(C=k | selB) =

Page 29: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Important points• Random variables• Chain rule• Bayes rule• Joint distribution, independence, conditional

independence

Page 30: 15-381: Artificial Intelligence€¦ · 15-381: Artificial Intelligence Probabilistic Reasoning and Inference. Advantages of probabilistic reasoning •Appropriate for complex, uncertain,

Joint distributions• The probability that a set of random

variables will take a specific value is theirjoint distribution.

• Requires a joint probability table tospecify the possible assignments

• The table can grow very rapidly …

0.310

0.100

0.401

0.211

PSleptLikedmovie

How can we decrease the number of columns inthe table?