Sunteți pe pagina 1din 28

1

LECTURE 6 OF 6

CONDITIONAL
PROBABILITY
&
BAYES’ THEOREM
2
At the end of the lesson, students
should be able to:

(a) understand and use


Bayes’ Theorem to solve
probability problems

3
REMEMBER – THE PREVIOUS LECTURE

• the conditional probability of A given B


is written as
P(A ∩B)
P(A | B) =
P(B)
The event that has
The event whose already occurred
probability is to be
determined 4
If you are given

How do you find ?


P(B | A) = 0.2
P(A | B) = ?
When the condition is reversed ,
Bayes’ Theorem is used to solve
such problems.

5
TOTAL PROBABILITY OF EVENT B = P(B)

P( B | A ) B

A B’
P( A)

P( B | A’ )
B
P( A’) A’
B’

P( B ) = P(A) x P( B | A ) + P(A’) x P( B | A’ ) 6
THE TOTAL PROBABILITY THEOREM

TOTAL PROBABILITY OF EVENT B = P(B)

In general, if events A1 ,A2, .……., An are


mutually exclusive and exhaustive events,
then the probability of event B is given by :

P( B ) = P(A1) x P( B | A1 ) + P(A2) x P( B | A2 )
+ P(A3) x P( B | A3 ) +…..+ P(An) x P( B | An )
7
P (A|B) : “the probability of A given B”
P( A∩B)
P ( A|B ) =
P (B)
P ( A|B ) × P(B) = P(A ∩ B)

P (B|A) : “the probability of B given A”


P( B ∩ A )
P( B|A ) =
P(A)
P( B|A ) ×P(A) = P(B ∩ A) 8
P( A∩B)
P ( A|B ) = (1)
P (B)
P( B|A ) ×P(A) = P(B ∩ A) (2)

Since P ( A ∩B ) =P(B ∩ A)
Substitute (2) into (1) , we get :
BAYES’
THEOREM
P ( B|A) × P(A)
P ( A|B ) =
P (B) 9
BAYES’ THEOREM

P ( B|A i ) × P(A i )
P( A i |B ) =
P (B)
where A1 , A2 , ….. , An are n mutually
exclusive and exhaustive events so that
A1 ∪A2 ∪ ……. ∪An = S ,
the possibility space, and B is an arbitrary
event of S ( i = 1,2,3,…..,n ) .
P(B) is the total probability of event B.
Bayes’ Theorem is useful when we have
10
to ‘ reverse the conditions ’ in a problem.
Example 1
There are 12 red balls and 8 green balls
in a bucket. Two balls are taken out in
sequence without replacement. By using
a tree diagram , find the probability that
(a) the first ball is red
(b) the second one is red if the first is red
(c) the second one is red if the first is
green
(d) the second one is red
11
Solution: R ~ red ball
11
R2 G ~ green ball
19
12
R1 8 G2
20
19 12
19 R2
8 G1
20 7
G2
19

1st draw 2nd draw 12


12 3
(a) P( first ball is red) = P(R1) = =
20 5

11 Direct from the


(b) P( R2 | R1 ) =
19 tree diagram
Or using the formula of
conditional probability
 12   11 
P( R1 ∩ R2 )  20   19 
P( R2 | R1 ) = =
P(R1 ) 12
11 20
= 13
19
(c) P( R2 | G1 ) =
12 Direct from the
19 tree diagram

(d) P( R2) = P( R1 ∩ R2) + P(G1 ∩ R2)

 12  11 +  8   12
=      20   19
 20  19 
3
=
5
14
P( R 2|R 1) ×
P(R 1)
(e) P(R1 | R2 ) =
P(R 2)
 11 12
 19 20
‘Reverse =   
condition’ 3
use 5
Bayes’
Theorem 11
=
19
15
Example 2

I travel to work by route A or route B. 1


The probability that I choose route A is .
4
The probability that I am late for work if I go via
2
route A is and the corresponding probability if
3
I go via route B is 1 .
3
(a) What is the probability that I am late for work
on Monday ?
(b) Given that I am late for work, what is the
probability that I went via route B ?
16
Solution:

2 L (late) P(A) x P(L|A)


3
1
4 A 1 L’ (not late)
3 1
3 L (late) P(B) x P(L|B)
3 B
4 2
L’ (not late)
3
ROUTE ARRIVE AT WORK
17
(a) P ( L ) = P(A) x P( L | A ) + P(B) x P( L | B)
 1 2   3 1  5
=  × + ×  =
 4 3   4 3  12
BAYES’
P ( L|B) × P(B) THEOREM
(b) P( B|L ) =
P (L)
 1 3
 3 4 3
=   =
5 5
18
12
Example 3

Aishah, Siti and Muna pack biscuits in a


factory. Aishah packs 55%, Siti 30% and
Muna 15% from the batch allotted to them.
The probability that Aishah breaks some
biscuits in a packet is 0.7, and the
respective probabilities for Siti and Muna
are 0.2 and 0.1. What is the probability
that a packet with broken biscuits found by
the checker was packed by Aishah ?

19
Solution: A – Aishah, S – Siti , M - Muna
B – Broken Biscuits
0.7 B

B’ P ( A|B )
0.55 A 0.3
P ( B|A) × P(A)
0.3 0.2 B =
S P (B)
0.8 B’
0.15 M 0.1
B

0.9 B’ 20
BAYES’
THEOREM
P ( B|A) × P(A)
P ( A|B ) =
P (B)

0.7 × 0.55
=
(0.55 × 0.7) + (0.3 × 0.2) + (0.15 × 0.1)

0.7 × 0.55
= = 0.837
0.46 21
Example 4

According to a firm’s internal survey, of


those employees living more than 2 miles
from work , 90% travel to work by car. Of
the remaining employees, only 50% travel
to work by car. It is known that 75% of
employees live more than 2 miles from
work. Determine :
(i) the overall proportion of employees
who travel to work by car.
(ii) the probability that an employee who
travels to work by car lives more than
22
2 miles from work.
Solution:
Define the events C , B1 , B2 as follows :
C : Travels to work by car
B1 : Lives more than 2 miles from work
B2 : Lives not more than 2 miles from work

The events B1 and B2 are mutually exclusive


and exhaustive.
P(B1) = 0.75 , P(B2) = 0.25
P( C | B1 ) = 0.9 and P( C | B2 ) = 0.5
23
Solution:

C (i) P(C) =
0.9
P(B1) x P( C | B1 )
0.75 B1 0.1 C’
+ P(B2) x P( C | B2 )

0.5 = ( 0.75 x 0.9 ) +


C
0.25 ( 0.25 x 0.5 )
B2
0.5 C’ = 0.8

P( C | B1 ) = 0.9 P( C | B2 ) = 0.5 80% of employees


travel to work
P(B1) = 0.75,P(B2) = 0.25 24
by car.
BAYES’
(ii) THEOREM
P (C|B1 ) × P(B1 )
P ( B1 |C ) =
P (C)

0.9 × 0.75
=
0.8

= 0.84375
25
THE TOTAL PROBABILITY THEOREM
TOTAL PROBABILITY OF EVENT B = P(B)

P( B ) = P(A1) x P( B | A1 ) + P(A2) x P( B | A2 )
+ P(A3) x P( B | A3 ) +…..+ P(An) x P( B | An )

BAYES’ THEOREM
P ( B|A i ) × P(A i )
P( A i |B ) =
P (B) 26
Exercise :
. Three children, Azman, Mariam and Nasir, have
equal plots in a circular patch of garden. The
boundaries are marked out by pebbles, Azman has
80 red and 20 white flowers in her patch, Mariam
has 30 red and 40 white flowers and Nasir has
10 red and 60 white flowers. Their young sister,
Mumtaz, wants to pick a flower for her teacher.

(a) Find the probability that she picks a red flower


if she chooses a flower at random from the garden
ignoring the boundaries.
(b) Find the probability that she picks a red flower
if she first chooses a plot at random.
27
(c) If she picks a red flower by the method described
in (b), find the probability that it comes from
Mariam’s plot.

Answer :
16 5
(a) 0.5 (b) (c)
35 16

28

S-ar putea să vă placă și