KEMBAR78
Bayes Theorem | PDF | Probability | Probability And Statistics
0% found this document useful (0 votes)
27 views34 pages

Bayes Theorem

Bayes theorem

Uploaded by

bns14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views34 pages

Bayes Theorem

Bayes theorem

Uploaded by

bns14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

CHAPTER 2

Introduction to Probability

PART 3 Conditional Probability


I Conditional Probability

How does the information that event B occurred affect the likelihood of
event A Example Pick an individual atrandom from the Lebanese
population and
consider the event A the individual goes to college If told that the individual
is aged 18 23 the probability of the event A increases significantly The
probability is now the number of people whogo to college out of the
population of 18 to 23 olds
year

Def For any 2 events A and B S T P B 0 the conditional probability of


A B is defined
given by
PLAIBT PLANB
PCB
Motivating the Definition

Computing the probability of A given B is done by reducing the sample

space to B PCAIB is the weighted measure of outcomes in A that occur


within the outcomes pertaining to B
EBB s

A B
MY B

Example Roll a die let B rolling an even number and A rolling


a
primenumber
B 2,4 6 and A 12,3 51 PCB Yz and ANB 2 PLANB Ye

PLAI B Plan B 43
PCB
Exercise We draw 8 cards at random from an deck of 52 cards
ordinary
Given that 3 of them are
spades what is the probability that the
remainin 5 are also soades
Exercise We draw 8 cards at random from an deck of 52 cards
ordinary
of them are
Given that 3
spades what is the probability that the
remaining 5 are also spades
Solution
A All 8 cards are spades
B At least 3 cards are spades Notice A EB AN B A

PLANB and B lg Ei when Ei i cards are spades

8 all disjoint

so PCB Ig Y 8 The denominators cancel out so that


y

PLA IB
PLAN B 1 5.44 106
PCB
Eg p 3g
Theorem Let r be the sample space let Ber st PIB o The following
holds
1 YA er PLA IB O
2 PER I B L
3 If Anti is a sequence of mutually exclusive events then

IP
E An B En Plan B

Proof of 3

IP
E An B IP I An NB PCB IP
I CANNB PCB

É Pl Ann B PCB
E PLAn I B D

The usual axioms of probability hold for conditional probability


This means the following properties all hold

s PLO IB O

PLA IB 1 IPL AIB

For Ce A PLAIC I B IPL AIB PCC IB

For CEA IPCC IB e IPL AIB

PC AUC IB PCA IB PIC IB PL ANC IB

For a finite sequence of disjoint events Ai ti we have

IPL Ai I B IE PLAi IB
I Multiplication Rule
A very direct consequence of the definition gives the following

PLANB PIA I B x PCB

The best to illustrate this is using a tree


way

Example A bag contains 6green beads and 4yellow beads Two beads are
taken successively at random without replacement Consider the events
G 1st bead is green Y I bead is yellow

62 2nd bead is Yz 2nd bead is


green yellow

If G occurs 1st bead is there are 5 beads left in the


green green
bag out of 9 so

IPL GI G 519
The following tree represents the situation
59 62
G MY G
u

619 62
410
Ys
3 42
9
Hence
using the multiplication rule the probability that both beads are
yellow is
ply ny 11142142 x PLY
3 x

Given that both beads are of the same colour the probability that both areyellow

PLY NY same colour PLYNY 2115


47
1PMNY U NG 415 4 5
Prop Generalization of the Multiplication Rule
Consider a finite collection of events Ai then the following holds

PC A PCA PLA IAD PLA AzNA PLAn An in NA

Exercise A firm is awarded 43 of the contracts it bids on Matt


consulting
works for a division of the firm that handles 15 of the projects contracted
for Matt directs 35 of the contracts submitted to his division A bit
submitted to the firm is chosen at random What is the probabilitythat it
will result in a project directed by Matt

Solution let A firm awarded the contract Az contract sent to Matt's

division As Matt directs the project

PLA A A PLA PLAz IA PLA A AD 10.43 0.15 0.351 0 0226


III Law of Total Probability

Def A finite collection of events Bili is said to be a partition of the


universe r if
Bi t O f it in

They are mutually exclusive Hi


j Bi n Bj 0
We have A Bi

Example The simplest example of a partition


is the following for event 0g Aer the
any
collection A AS is a partition r

Sometimes it is impossible to compute PLA directly butis possible to


compute IPLAl B and P AIB for some Ber or the conditional

probabilities of A on some other partition This is when the following


theorem is useful
Thin Law of
Total Probability let Ba Ba Bns be a partition of the
sample space ns.t Pl Bil o fi l n Then for
any
event A er

PLA IF PLAI BIJ PLBi

Is Proof
We can write A the following union
using

A A n r A n Bi
I CAN Bi By Bs

An Bi A AMB in Bj An 0 0
They are
Axiom 3
disjoint fig CAN
B
By
PLA PL Y CANB E PLAN Bi

É PLAI Bi x PL Bi D
Exercise In a certain environment an unvaccinated individual has a 60
chance of contracting a certain virus It is known that being vaccinated
against the virus makes one3 times less likely to contract it If
only
37 of the population is vaccinated what is the probability that a
randomly picked individual from this population will
contract the virus
Exercise In a certain environment an unvaccinated individual has a 60
chance of contracting a certain virus It is known that being vaccinated
against the virus makes one3 times less likely to contract it If
only
37 of the population is vaccinated what is the probability that a
randomly picked individual from this population will
contract the virus

Solution It helps to draw a tree


let U be the event that the individual is vaccinated The collection LV Tl
is partition of r
a We have IPL v 0.37
let c be the event that the person will contract the virus
PLC IT 0.6 and PLC IV 08 0.2

Bythe law of total probability

IPCC PIC ID PLUS PIC IT PLT


0.2 0.37 0.6 1 0.37 0 452
Exercise An urn contains 10 white and
12 red chips 2 chips are
drawn at random and discarded without looking at their colours What is
the probability that a 3rd chip drawn is red

Solution Before solving can the answer


you guess
Exercise An urn contains 10 white and
12 red chips 2 chips are
drawn at random and discarded without looking at their colours What is
the probability that a 3rd chip drawn is red

Solution Before solving can the answer


you guess

Let Ri ith chip drawn is red and Wi ithchip drawn is white


We want to condition the first 2 draws The collection
on

R NW R N Wa Ra NW Ren Wa
We compute the probabilities of these events
partitions the sample space r

12 21 20 77
IPLRaw IP Ra W IP W 10
22
10 12 20 77
IP WaR PLWa IR PCR 21 22
12
IP R2R PER IR PCR 11
21 22 22
77
IP W W P Wz I W IP W 10 15
9121 22 77
We now compute IPLRs using the law of total probability

P R PER I Raw PLR W PL RS We R IP We R


PER IR R PCR2 R IP Rs W W J P We W
11 20 11 20 10 22 12 15
20 77 70 77 20 77 70 77
12 22

Exercise Bill has 6 guns The probability of hitting a target when


these
guns
are fired is 0.5 0.6 0.7 0.7 0.8 0.9 respectively What is the

probability of hitting a
target if the gun is
selected at random

Solution IP hit target Es DChit l gun i IPL


gun
i

0.5 6 0.7 0.7 8 0.9


I
0 0

O 7
I Bayes theorem

Question Suppose events occur in a


sequential way
whether
logically or
temporally How do we compute the probability of events occurring
earlier in time given new information occurrence of future events

Thm Bayes Theorem


let Bili be a partition of the universe r s t.PL Bi o ti h in
Then for any event A s t PLA o for all k l i n we have

IP BRIA PLAI BI PL BI
IE PLAI BI PLBi
Pl Bi are the prior probabilities
P Bil A are the posterior probabilities
A represents new information that updates our prior beliefs on the Bi's
Special Case For B s t P B PCB 0 we have

PCBIA PLAIBT PCB


PLAIBT PCB PLAI BT PCB

Exercise Consider a
regular deck of 52 cards Pick a card at random and
toss it without looking at it What is the probability that the
heart
given that the drawn card is
tossed cold was a a heart
Special Case For B s t P B PCB 0 we have

PCBIA PLAID PCB


PLAIBT PCB PLAI BT PCB

Exercise Consider a
regular deck of 52 cards Pick card at random and
a

toss it without looking at it What is the probability that the


heart
given that the drawn card is
tossed cold was a a heart
Solution
let T the tossed card is a heart and It the drawn card is a heart

PCT I H PCH IT PCT f


IPCHITS PIT PCH IFJ PCF
E t
O 235
Exercise Consider 10 biased coins When the ith coin is tossed the probability
of heads is it o f it 10 We randomly select a coin toss it
and get heads What is the probability that it was coin number 5
Exercise Consider 10 biased coins When the ith coin is tossed the probability
of heads is it o f it 10 We randomly select a coin toss it
and get heads What is the probability that it was coin number 5

Solution
let It be the event The tossyields heads
let In we selected the Kth coin We want IP Is H
Since the coin is selected at random the are
prior probabilities
IPL In
I Kk l 10

PCH Is IPC Is E E
P Is H
EY PCH In IPC In
IE I to
5
1 2 10 55
I Independence

Suppose we are drawing chips from an urn with replacement let we be


the event the ithdraw is a white chip Since the chips are returned to
the urn the composition of the win before each draw is the same This
means that the occurrence of W does not modify in any way the probability
of the event w not the case of sampling
without replacement This is the
concept of independence

Def Two events A and B are said to be independent if

PLAN B PLAT PIB


Otherwise
they are said to be dependent

The following is an equivalent definition that formalizes the idea that the
occurrence of one event does not modify the probability of the other
Prop A and B are independent if and only if
PLAI B PLAT ift PLBI A PCB
Proof

Suppose PLA so and IPLB so for the conditional probabilities to be


well defined If A and B are independent

PCAIB PLAN B IPAD PCB PCA


PCB PCB

Conversely if PLA B PLA then

PLAN B PLAIBT PCB PLAT PCB D

Example Consider the of tossing a fair coin twice let A be the


experiment
event of getting It on the first toss and B the event of getting it on the2nd
toss Intuitively A and B are independent Let's
prove why this is
the
case mathematically
Since we are dealing with a fair coin PCA PCB 42
The sample space consists of 4 equally probable outcomes draw tree
HH TH HT TTS
Hence IP HH Yu Notice that ANB LAH

PCA IPLB Yz Yz Yy PK HHS PLAN B


Hence A and B are independent

We can generalize the definition of independence to a collection of sets

Def The events A An are mutually independent if Uk 2 in and

every subset
of indices i iz ik from 21 in we have

PCAi N Ai N N Ain PCAi IPCAi P Air


Example The events A Band C are independent iff the following 4 conditions hold

PCAB PCA PCB PLAT PLAT IC IEBC IPLB PIC


PLABCI PLA PCB IPCC

The definition means that pairwise independence is not enough to insure full
independence of a collection of events

Prop If Aand B are independent then so are the pairs AB1 A B RIA B

Proof 1 We start with proving A and B are independent


PLAT PLB I PCA I IPLBJ I PLAT P B PLAT PI B
It PLABI PLAT PI B
PC AB PL AUT L PCAUB I PLAT PCB IP AB

De Morgan PCAUB
Hence IPL A B PLA PCB AB independent

prove that A
2 Now we and B are independent same proof for B

PLA IPL B PLA I PCB PLAT PLAT PCB PLA MAB


Pl AB PC AIB PLAT PLAN B PLAT PLAB

PL AB PCA PCB AB independent D

Remark The concepts of independence and disjointness are not the same AandB
are independent if PLAN B PCA PCB They are disjoint mutually
exclusive if ANB O In fact given A and B st PLA o
IPCB so

then if A and B are disjoint we have

IPCANB O F PLAT PCB


so they are certainly dependent
Exercise The
figure below shows an electric circuit in which each of the 4
switches is independently closed or
open with probabilities p and
I p respectively If a signal is fed to the input prove that the
probability that it is transmitted to the output is p
2
p
Exercise The
figure below shows an electric circuit in which each of the 4
switches is independently closed or
open with probabilities p and
I p respectively If a signal is fed to the input prove that the

probability that it is transmitted to the output is p 2 p

Solution
let Ei switch i is closed The signal is transmitted if switches 1 and 2
are both closed or if switches 3 and 4 are both closed

IPL E E U E E PIE ED PIE Ey PL E E E Ey


2
p't p pl p p
Example Motivation for Chapter 3
Recall this setup where each switch is closed
with probability p and open with probability
I p independently of all the others

What is the probability that exactly 2 out the 4 switches are closed

If we have chosen 2 switches out of 4 to close we want 2 to be closed

and 4 2 2 to be open The 4 events are independent so the probability


is There are I to choose 2 switches out of 4
p'll p ways

IPlaactly 2 closed I p
l
p

If we had what is the probability that k are closed In


n switches

the next chapter we will see this is PLA k where X is a binomial


random variable with parameters X n Binom ni
p
Example It is important to know that independence does not mean that 2
events do not influence each other It simply means that the occurrence of
one does not influence the odds of the second occurring Consider this
experiment roll 2 fair dice and let
A the sum of the numbers that come is 7
up
B the first die shows 3

that PLA 6 36 46 and PCB 46


Recall from before
Also note that ANB first roll 3 and second roll 4 with
PLAN B V36
Ha
PLA PCB 46 Yo 436 PLANB

Aand B are independent are much connected


yet they very

We finish this chapter with an exercise that showcases the power of conditioning
Exercise We draw cards one at a time at random and successively from
anordinary deck of 52 cards with replacement What is the probability
that an ace appears before a face card

Solution We use 2 methods let E ace


appears
before a face card

MI For ne N define the events


An no face could or ace
appears on
the first n t trials and the
nth draw is an ace

Then the event E


ace
appears
before a face card is
L An Notice that
AnSE is a sequence of mutually exclusive events so axiom 3 will be used

Now we compute Plan The draws are all independent no replacement

For any single draw Place 413 and


IPL no face card and 9
no ace 13
Hence PLAn 9 13 413

Finally using axiom


3 and of geometric series
your knowledge

IPLE P InAn É PLAN


E 13 É E
43 11g

172 let As Ace appears in the first draw Fs Face card


appears
in
the first draw and N Neither ace nor face cand on first draw

the law of total probability since the collection As Fa Ns


By
is a partition of the universe r we condition on the 1stdraw and
get

ME PLEIN PLA PLEIF PIE PLEIND PEN

IP As 4 52 PLF 1452 and PLN 36152


Also notice that PIE A I and PLEI Fs 0

The outcomes of successive experiments are all independent of each other


so when the second experiment begins the whole probability process starts
all over again Hence if in the first experiment neither an ace nor a face
is drawn IP before and after the first experiment is the
E same

This translates mathematically to PLEIN PCE

We thus obtain an
equation for PIE

PCE PIE
I Ya x PIE Yu

Conclusion makes computations easier


Conditioning in an appropriate
way

Could we have Yes


guessed this intuitively The ratio of aces to face
cards in the deck is 1 3 so the probability Yy makes sense

You might also like