Docsity

Probability & Bayesian Inference in AI - Univ. of San Francisco - Prof. Christopher H. Bro, Study notes of Computer Science

Partial preview of the text

Download Probability & Bayesian Inference in AI - Univ. of San Francisco - Prof. Christopher H. Bro and more Study notes Computer Science in PDF only on Docsity!

Artificial Intelligence

Programming Bayesian Inference

Chris Brooks Department of Computer Science University of San Francisco

Probability Review

Probability allows us to represent a belief about astatement, or a likelihood that a statement is true.

P

rain

means that we believe it is 60% likely

that it is currently raining.

Axioms:

P

a

The probability of

A

B

is

P

A

P

B

P

A

B

Tautologies have

P

Contradictions have

P

Department of Computer Science — University of San Francisco – p.1/

Conditional Probability

Example:

P

Cloudy

P

Rain

P

cloudy

rain

P

cloudy

Rain

P

cloudy

Rain

P

Cloudy

Rain

Initially,

P

Rain

. Once we see that it’s cloudy,

P

Rain

Cloudy

P

( Rain ∧ Cloudy ) P ( Cloudy )

0 . 15 0 . 3

Department of Computer Science — University of San Francisco – p.3/

Combinations of events

The probability of

A

B

is

P

A

B

P

B

What if

A

and

B

are independent?

Then

P

A

B

is

P

A

, and

P

A

B

is

P

A

P

B

Example:

What is the probability of “heads” five times in a row? What is the probability of at least one “head”?

Department of Computer Science — University of San Francisco – p.4/

Monty Hall Problem

From the game show “Let’s make a Deal”

Pick one of three doors. Fabulous prize behind onedoor, goats behind other 2 doors. Monty opens one of the doors you did not pick, shows agoat Monty then offers you the chance to switch doors, to theother unopened door Should you switch?

Department of Computer Science — University of San Francisco – p.6/

Monty Hall Problem

Problem Clarification:

Prize location selected randomly Monty always opens a door, allows contestants to switch When Monty has a choice about which door to open, hechooses randomly.

Variables

Prize:

P

p A

p B

p C

Choose:

C

c A

c B

c C

Monty:

M

m A

m B

m C Department of Computer Science — University of San Francisco – p.7/

Monty Hall Problem

Without loss of generality, assume:

Choose door A Monty opens door B

P

p A

c A , m B

P

m B

c A , p A

P ( p A | c A ) P ( m B | c A ) Department of Computer Science — University of San Francisco – p.9/

Monty Hall Problem

P

p A

c A , m B

P

m B

c A , p A

P ( p A | c A ) P ( m B | c A ) P

m B

c A , p A

Department of Computer Science — University of San Francisco – p.10/

Monty Hall Problem

P

p A

c A , m B

P

m B

c A , p A

P ( p A | c A ) P ( m B | c A ) P

m B

c A , p A

P

p A

c A

P

m B

c A

Department of Computer Science — University of San Francisco – p.12/

Monty Hall Problem

P

p A

c A , m B

P

m B

c A , p A

P ( p A | c A ) P ( m B | c A ) P

m B

c A , p A

P

p A

c A

P

m B

c A

P

m b

c A , p A

P

p A

P

m b

c A , p B

P

p B

P

m b

c A , p C

P

p C

Department of Computer Science — University of San Francisco – p.13/

Monty Hall Problem

P

p A

c A , m B

P

m B

c A , p A

P ( p A | c A ) P ( m B | c A ) = 1

P

m B

c A , p A

P

p A

c A

P

m B

c A

P

m b

c A , p A

P

p A

P

m b

c A , p B

P

p B

P

m b

c A , p C

P

p C

P

p A

P

p B

P

p C

P

m b

c A , p A

P

m b

c A , p B

Won’t open prize door

P

m b

c A , p C

Monty has no choice

Department of Computer Science — University of San Francisco – p.15/

Monty Hall Problem

P

p C

c A , m B

P

m B

c A , p C

P ( p C | c A ) P ( m B | c A ) = 2

P

m B

c A , p C

P

p C

c A

P

m B

c A

P

m b

c A , p A

P

p A

P

m b

c A , p B

P

p B

P

m b

c A , p C

P

p C

P

p A

P

p B

P

p C

P

m b

c A , p A

P

m b

c A , p B

Won’t open prize door

P

m b

c A , p C

Monty has no choice

Department of Computer Science — University of San Francisco – p.16/

Probabilistic Inference

Problems in working with the joint probability distribution:

Exponentially large table.

We need a data structure that captures the fact thatmany variables do not influence each other.

For example, the color of Bart’s hat does notinfluence whether Homer is hungry.

We call this structure a

Bayesian network

(or a

belief

network

Department of Computer Science — University of San Francisco – p.18/

Bayesian Network

A Bayesian network is a directed graph in which eachnode is annotated with probability information. Anetwork has:

A set of random variables that correspond to thenodes in the network. A set of directed edges or arrows connecting nodes.These represent influence. In there is an arrow fromX to Y, then X is the parent of Y. Each node keeps a conditional probability distributionindicating the probability of each value it can take,conditional on its parents values. No cycles. (it is a directed acyclic graph)

The topology of the network specifies what variablesdirectly influence other variables. (conditionalindependence relationships).

Department of Computer Science — University of San Francisco – p.19/