P( ) 1 conditional probability where P(F) > 0 Conditional - - PowerPoint PPT Presentation

p
SMART_READER_LITE
LIVE PREVIEW

P( ) 1 conditional probability where P(F) > 0 Conditional - - PowerPoint PPT Presentation

Conditional Probability P( ) 1 conditional probability where P(F) > 0 Conditional probability of E given F: probability that E occurs given that F has occurred. Ehf F FE Conditioning on F Written as P(E|F) Ser Means P(E,


slide-1
SLIDE 1 1

Conditional Probability

P( )

slide-2
SLIDE 2 2

conditional probability

where P(F) > 0

Conditional probability of E given F: probability that E occurs given that F has occurred. “Conditioning on F” Written as P(E|F) Means “P(E, given F observed)” Sample space S reduced to those elements consistent with F (i.e. S ∩ F) Event space E reduced to those elements consistent with F (i.e. E ∩ F)

With equally likely outcomes,

F FE

Ehf

Ser

slide-3
SLIDE 3

Examples 2 random cards are selected from a deck of cards:

  • What is the probability that both cards are aces given

that one of the cards is the ace of spades?

  • What is the probability that both cards are aces given

that at least one of the cards is an ace?

3

Irk

E

Prf bothAces cregeads Afd

Pr

bothAces doneisAE bothAcesGoneAspacdest

P

AQ

tEFb

Pr

bothAces

atleast one.is f lbohAasRatceastaeisAa

Y

42

lateestoneisal

aE

slide-4
SLIDE 4

Gambler’s fallacy Flip a fair coin 51 times A = “first 50 flips are heads” B = “the 51st flip is heads” Pr (B | A) = ?

4

I

51

Irl

2

51 11,31

lEH

H31

K

t HHg If
slide-5
SLIDE 5 5

conditional probability: the chain rule

General defn: where P(F) > 0 Implies: P(E and F) = P(E|F) P(F) (“the chain rule”) General definition of Chain Rule:

Pr

MEGREZ

PrfezfENEDPRLE.AE

FE

PrLEzlE hFz

PrfEalE PRIED

slide-6
SLIDE 6

Chain rule example Alice and Bob play a game as follows: A die is thrown, and each time it is thrown, regardless of the history, it is equally likely to show any of the six numbers. If it shows 5, Alice wins. If it shows 1, 2 or 6, Bob wins. Otherwise, they play a second round and so on. What is P(Alice wins on nth round)?

6 nobody wins

3,4

An

Ai

Alice wins
  • n 9thround
Ni nobody wins on in round PrfAn Pr N

AI

Prfw PrWa w

prfwzlnpwjnprfwn.INn nah

a

PrfAnfN

Nut

I If

slide-7
SLIDE 7 7

law of total probability

E and F are events in the sample space S

E = EF ∪ EFc

EF ∩ EFc = ∅ ⇒ P(E) = P(EF) + P(EFc) S E F

slide-8
SLIDE 8 8

law of total probability P(E) = P(E and F) + P(E and Fc) = P(E|F) P(F) + P(E|Fc) P(Fc) = P(E|F) P(F) + P(E|Fc) (1-P(F)) More generally, if F1, F2, ..., Fn partition S (mutually exclusive, ∪i Fi = S, P(Fi)>0), then P(E) = ∑i P(E and Fi) =∑i P(E|Fi) P(Fi)

(Analogous to reasoning by cases; both are very handy.) weighted average, conditioned on event F happening or not. weighted average, conditioned on events Fi happening or not.

iH

slide-9
SLIDE 9 9

total probability Sally has 1 elective left to take: either Phys or Chem. She will get A with probability 3/4 in Phys, with prob 3/5 in

  • Chem. She flips a coin to decide which to take.

What is the probability that she gets an A? P(A) = P(A|Phys)P(Phys) + P(A|Chem)P(Chem) = (3/4)(1/2)+(3/5)(1/2) = 27/40

Note that conditional probability was a means to an end in this example, not the goal itself. One reason conditional probability is important is that this is a common scenario.
slide-10
SLIDE 10

The Monty Hall Problem

Suppose you’re on a game show, and you’re given the choice of three
  • doors. Behind one door is a car, behind the other, goats. You pick a
door, say number 1, and the host, who knows what’s behind the doors, opens another door, say number 3, which has a goat. He says to you, “Do you want to switch to door number 2?” Is it to your advantage to switch your choice of doors? Assumptions: The car is equally likely to be behind each of the doors. The player is equally likely to pick each of the three doors, regardless of the car’s location After the player picks a door, the host must open a different door with a goat behind it and offer the player the choice of staying with the original door or switching If the host has a choice of which door to open, then he is equally likely to select each of them.

ftp.umr

Ich

Y

slide-11
SLIDE 11 11

Switch

43

Alwin

Mwm

dqbe grl bhar

t Prewitt

yprc

a

wY

DPrcs

is

slide-12
SLIDE 12

Independence

[ | ]

slide-13
SLIDE 13

Independence of events Intuition: E is independent of F if the chance of E occurring is not affected by whether F occurs. Formally:

  • r
13

Pr(E|F) = Pr(E) Pr(E ∩ F) = Pr(E)Pr(F)

These two definitions are equivalent.

PreenFyprCF
slide-14
SLIDE 14

Independence Draw a card from a shuffled deck of 52 cards. E: card is a spade F: card is an Ace Are E and F independent?

14

111

52

PRE

BTz

k

Pree

E

73

Prf Ehf

PMA

gl z

PrCE Prof
slide-15
SLIDE 15

Independence Toss a coin 3 times. Each of 8 outcomes equally likely. Define A = {at most one T} = {HHH, HHT, HTH, THH} B = {at most 2 Heads}= {HHH}c Are A and B independent?

15 Prc A

ta

Pr B

Ig

Prf

AAB

Prf

HHT Hht tht

Z f PriA PrcB

slide-16
SLIDE 16

Independence as an assumption It is often convenient to assume independence. People often assume it without noticing. Example: A sky diver has two chutes. Let E = {main chute doesn’t open} Pr (E) = 0.02 F = {backup doesn’t open} Pr (F) = 0.1 What is the chance that at least one opens assuming independence?

16

Pr at least

  • ne opus

I

Prfnoneopen

Ehf

I

0.02 O 998
slide-17
SLIDE 17

Independence as an assumption It is often convenient to assume independence. People often assume it without noticing. Example: A sky diver has two chutes. Let E = {main chute doesn’t open} Pr (E) = 0.02 F = {backup doesn’t open} Pr (F) = 0.1 What is the chance that at least one opens assuming independence? Note: Assuming independence doesn’t justify the assumption! Both chutes could fail because of the same rare event, e.g. freezing rain.

17
slide-18
SLIDE 18

Using independence to define a probabilistic model We can define our probability model via independence. Example: suppose a biased coin comes up heads with probability 2/3, independent of other flips. Sample space: sequences of 3 coin tosses. Pr (3 heads)=? Pr (3 tails) = ? Pr (2 heads) = ?

18

I

It 133 Pr HHH

Pr Hi Prats Prats

P

Prf

HAT HA THA

3 Fs

at
slide-19
SLIDE 19 19

Bayes Theorem

P( )

EEE

slide-20
SLIDE 20

Is your coin loaded? Your coin is fair (Pr(H) = 0.5) with probability ½ or “unfair” (Pr(H) = 0.6) otherwise. You flip the coin and it comes up Heads. What is the probability that it is fair given that it came up Heads?

20

Pr fair

L

Pr unfair

L

Affair

PrlHunfairka6prTtg_PrHErhCfa.rgfPrcH

PrfHffaurJPrCfa.r

Prettyunfair Prcunfair

slide-21
SLIDE 21 21

Most common form: Expanded form (using law of total probability):

Bayes Theorem

Why it’s important: Reverse conditioning P( model | data ) ~ P( data | model ) Combine new evidence (E) with prior belief (P(F)) Posterior vs prior

  • Rev. Thomas Bayes c.
1701-1761 prca E

Prhp E J

Prt

Tring

slide-22
SLIDE 22 22

HIV testing

Suppose an HIV test is 98% effective in detecting HIV, i.e., its “false negative” rate = 2%. Suppose furthermore, the test’s “false positive” rate = 1%. 0.5% of population has HIV Let E = you test positive for HIV Let F = you actually have HIV What is P(F|E) ? HIV+ HIV- Test + 0.98 = P(E|F) 0.01 = P(E|Fc) Test - 0.02 = P(Ec|F) 0.99 = P(Ec|Fc)

PNF

0.005 beposing

00

PMHut lest'J prfltwtn.es y

false negative p

y

PMtesttlttwtjprq.eu

PrfTtHrvtPrCHwt tPrCTtfHN PrfHN

09800.005098

0.005 t 0.01 O 995
slide-23
SLIDE 23 23

HIV testing

Suppose an HIV test is 98% effective in detecting HIV, i.e., its “false negative” rate = 2%. Suppose furthermore, the test’s “false positive” rate = 1%. 0.5% of population has HIV Let E = you test positive for HIV Let F = you actually have HIV What is P(F|E) ? Solution:
slide-24
SLIDE 24

Why do you have a fever? Pr (flu | high fever)?

24 w

prffwfhighfveyz.PH

euen fIu PrCfw

T

KChighfan

Prffeouffla Pr flu

Prffever Ebola PrfEbda

Prawn loin Pr other

slide-25
SLIDE 25 25
slide-26
SLIDE 26 A lie detector is known to be 80% reliable when the person is guilty and 95% reliable when the person is innocent. If a suspect is chosen from a group of suspects of which only 2% have ever committed a crime, and the test indicates that the person is guilty, what is the probability that he is innocent? 26

Everyonesays they

are innocent
slide-27
SLIDE 27

A lie detector is known to be 80% reliable when the person is guilty and 95% reliable when the person is innocent. If a suspect is chosen from a group of suspects of which only 2% have ever committed a crime, and the test indicates that the person is guilty, what is the probability that he is innocent?

27

I : event that he is innocent G : event that the test indicates guilty Pr(I|G) = Pr(G|I)Pr(I) Pr(G) = Pr(G|I)Pr(I) Pr(G|I)Pr(I) + Pr(G|Ic)Pr(Ic) = 0.05 · 0.98 0.05 · 0.98 + 0.8 · 0.02

slide-28
SLIDE 28

Problem There is a population of N people. The number of good guys among these people is i with probability pi Take a sample of n people from the population. Each subset

  • f n is equally likely. What is the probability that there are

j good guys in the population conditioned on the fact that there are k good guys in the sample.

28 Ei

p

F good guys inpep is Good
  • 1,2
N Po

Epi

l
slide-29
SLIDE 29 good ways to sample n people out of N people guys

L

ways g choosing subset gsiun k good I ig Mawle

ME.gl E g

TNn

Nsiugpop

ing

E

Pray.rseEnsem

EtIYPrfkgoodgysmsample

g.NfoPr k goodin sample N

j goodin pep

qP

PrcjgqfL

E fight

pi

K

q

Pi

slide-30
SLIDE 30

Problem There is a population of N people. The number of good guys among these people is i with probability pi Take a sample of n people from the population. What is the probability that there are j good guys in the population conditioned on the fact that there are k good guys in the sample.

29

Ei = event that there are i good guys among N Si = event that there are i good guys in sample Pr(Ej|Sk) = Pr(Sk|Ej)Pr(Ej) Pr(Sk) Pr(Sk|Ej) = j

k

N−j

n−k
  • N
k
  • Pr(Sk) =

X

j

Pr(Sk|Ej)Pr(Ej) = X

j

j

k

N−j

n−k
  • N
k
  • pj
slide-31
SLIDE 31

Conditional Probability Satisfies usual axioms of probability Example: Pr( E | F ) = 1- Pr (Ec | F)

31

Pretty

preEyre Mp I

t

fF

I
slide-32
SLIDE 32

Conditional Probabilities yield a probability space Suppose that is a probability space. Then is a probability space for with

32

Pr(F) > 0 0 ≤ Pr(w|F) ≤ 1 Pr(∪n

i=1Ei|F) = n

X

i=1

Pr(Ei|F) E1, E2, . . . , En disjoint implies

Prew IF

  • wtf
slide-33
SLIDE 33

summary

33
slide-34
SLIDE 34 34

PrfAn

I

PreAnB MII

possible

by

B

Op

slide-35
SLIDE 35 35

more HIV testing Let Ec = you test negative for HIV Let F = you actually have HIV What is P(F|Ec) ?

HIV+ HIV- T est + 0.98 = P(E|F) 0.01 = P(E|Fc) T est - 0.02 = P(Ec|F) 0.99 = P(Ec|Fc)