28
1

Lect_6

Embed Size (px)

Citation preview

Page 1: Lect_6

1

Page 2: Lect_6

2

LECTURE 6 OF 6

CONDITIONAL PROBABILITY

& BAYES’ THEOREM

Page 3: Lect_6

3

At the end of the lesson, students should be able to:

(a) understand and use Bayes’ Theorem to solve

probability problems

Page 4: Lect_6

4

REMEMBER – THE PREVIOUS LECTURE

• the conditional probability of A given B is written as

P(A | B)

The event that has already occurredThe event whose

probability is to bedetermined

P(A B)

P(B)

Page 5: Lect_6

5

P(B | A) = 0.2

P(A | B) = ?

When the condition is reversed , Bayes’ Theorem is used to solve

such problems.

If you are given

How do you find ?

Page 6: Lect_6

6

A

B

B

B’

B’

A’

P( B | A’ )

P( A)

P( B | A )

P( A’)

P( B ) = P(A) x P( B | A ) + P(A’) x P( B | A’ )

TOTAL PROBABILITY OF EVENT B = P(B)

Page 7: Lect_6

7

In general, if events A1 ,A2, .……., An aremutually 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 )

TOTAL PROBABILITY OF EVENT B = P(B)

THE TOTAL PROBABILITY THEOREM

Page 8: Lect_6

8

P( A B)P( A|B )

P(B)

P(B A )P(B|A )

P(A)

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

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

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

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

Page 9: Lect_6

9

P( A B )P( A|B )

P(B)

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

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

P(B)

Since P A B P(B A)

BAYES’ THEOREM

(2)

(1)

Substitute (2) into (1) , we get :

Page 10: Lect_6

10

BAYES’ THEOREM

i i

i

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

P(B)

where A1 , A2 , ….. , An are n mutuallyexclusive and exhaustive events so thatA1 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 haveto ‘ reverse the conditions ’ in a problem.

Page 11: Lect_6

11

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

(e) the first one is red if the second is red

Page 12: Lect_6

12

Solution:

1st draw

R1

G1820

1220

1119

2nd draw

819 1219

719

G2

R2

G2

R2

R ~ red ball G ~ green ball

Page 13: Lect_6

13

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

20 5

(b) P( R2 | R1 ) 11

19 Direct from the

tree diagram

Or using the formula of conditional probability

P( R2 | R1 )1 2

1

P( R R )

P(R )

12 1120 19

1220

11

19

Page 14: Lect_6

14

(c) P( R2 | G1 )1219

Direct from the tree diagram

(d) P( R2)

8 1220 19

12 11

20 19

3

5

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

Page 15: Lect_6

15

(e) P(R1 | R2 ) = 2 1 1

2

P( R R ) P(R )

P(R )

11 1219 20

35

11

19

‘Reverse condition’use Bayes’ Theorem

|

Page 16: Lect_6

16

Example 2

I travel to work by route A or route B. The probability that I choose route A is .

The probability that I am late for work if I go via

route A is and the corresponding probability ifI go via route B is .

(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 ?

14

13

23

Page 17: Lect_6

17

Solution:

ROUTE

B34

14

23

13 13

23

A L’ (not late)

L (late)

L’ (not late)

L (late)

ARRIVE AT WORK

P(A) x P(L|A)

P(B) x P(L|B)

Page 18: Lect_6

18

P(A) x P( L | A )

(a) P ( L ) = + P(B) x P( L | B) 1 2 3 1

4 3 4 3

512

(b)

P(L|B) P(B)P(B|L )

P(L)

1 333 4

5 512

BAYES’ THEOREM

Page 19: Lect_6

19

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 Munaare 0.2 and 0.1. What is the probabilitythat a packet with broken biscuits found bythe checker was packed by Aishah ?

Page 20: Lect_6

20

Solution:

A

B

B

B’

B’

S

M

0.3

0.55

0.7

B

B’

0.15

A – Aishah, S – Siti , M - MunaB – Broken Biscuits

0.3

0.2

0.80.1

0.9

P( A|B )

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

Page 21: Lect_6

21

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.550.837

0.46

BAYES’ THEOREM

Page 22: Lect_6

22

Example 4

According to a firm’s internal survey, ofthose employees living more than 2 milesfrom work , 90% travel to work by car. Of the remaining employees, only 50% travelto 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 2 miles from work.

Page 23: Lect_6

23

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 exclusiveand exhaustive.P(B1) = 0.75 , P(B2) = 0.25

P( C | B1 ) = 0.9 and P( C | B2 ) = 0.5

Solution:

Page 24: Lect_6

24

B20.25

0.75

0.9

0.1

0.5

B1C’

C

C

C’0.5

(i) P(C) =

P(B1) x P( C | B1 ) + P(B2) x P( C | B2 )

= ( 0.75 x 0.9 ) + ( 0.25 x 0.5 )

= 0.8

P( C | B1 ) = 0.9 P( C | B2 ) = 0.5

P(B1) = 0.75,P(B2) = 0.25

Solution:

80% of employeestravel to work by car.

Page 25: Lect_6

25

1 1

1

P(C|B ) P(B )P(B |C )

P(C)

0.9 0.750.8

0.84375

BAYES’ THEOREM(ii)

Page 26: Lect_6

26

BAYES’ THEOREM

i i

i

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

P(B)

THE TOTAL PROBABILITY THEOREM

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 )

TOTAL PROBABILITY OF EVENT B = P(B)

Page 27: Lect_6

27

Exercise :

1.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 flowerif she chooses a flower at random from the gardenignoring the boundaries.(b) Find the probability that she picks a red flowerif she first chooses a plot at random.

Page 28: Lect_6

28

(c) If she picks a red flower by the method described in (b), find the probability that it comes from Mariam’s plot.

Answer :

(a) 0.5 (b) (c) 1635

516