Total Probability and Bayes` Rule

advertisement

Law of Total Probability and Bayes’ Rule

“Event-composition method”

• Understand the experiment and sample points.

• Using set notation, express the event of interest in terms of events for which the probability is known.

• Applying probability rules, combine the known probabilities to determine the probability of the specified event.

Problem 2.86

• In a factory, 40% of items produced come from Line 1 and others from Line 2.

• Line 1 has a defect rate of 8%.

Line 2 has a defect rate of 10%.

• For randomly selected item, find probability the item is not defective.

A : the selected item is not defective

Problem 2.86

A : the selected item is not defective.

S

A

B

1

B

2

A

( A

B

1

)

( A

B

2

)

B

1

: item came from Line 1.

B

2

: item came from Line 2.

Problem 2.86

• So we may write

A

( A

B

1

)

( A

B

2

)

• Since this is the union of disjoint sets, the Additive Law yields

( )

(

B

1

)

(

B

2

)

• Or, in terms of conditional probabilities

P A

P A B P B

1 1

)

P A B P B

2

) (

2

)

( )

(0.08)(0.40)

(0.10)(0.60)

0.092

Line 1

The Decision Tree

defective not defective

Line 2 defective not defective

Problem 2.94

• Must find blood donor for an accident victim in the next 8 minutes or else…

• Checking blood types of potential donors requires

2 minutes each and may only be tested one at a time.

• 40% of the potential donors have the required blood type.

• What is the probability a satisfactory blood donor is identified in time to save the victim?

Finding a Donor

A: blood donor is found within 8 minutes

• Some sample points: “B bad, G good”

A = { (G), (B,G), (B,B,G), (B,B,B,G) }

• Let

A i

: i th donor has correct blood type

A

( A

1

)

( A

1

A

2

)

( A

1

A

2

A

3

)

( A

1

A

2

A

3

A

4

)

4 mutually exclusive events

Finding a Donor

A

( )

1

( A

1

A

2

)

( A

1

A

2

A

3

)

( A

1

A

2

A

3

A

4

)

• Trials are independent and each

P ( A i

) = 0.40, and so

( )

(

1

)

(

1

) (

2

)

(

1

) (

2

) (

3

)

P A P A P A P A

1 2 3 4

)

( )

0.4

(0.6)(0.4)

(0.6)(0.6)(0.4)

(0.6)(0.6)(0.6)(0.4)

.8704

Finding a Donor

A

1 saved!

A

2 saved!

A

1

A

3

A

2

Or, more simply,

 

P (donor is not found)

 

P A P A P A P A

1 2 3 4

)

 

6)

4

A

3 saved!

A

4

A

4 saved!

too late!

Problem 2.96

• Of 6 refrigerators, 2 don’t work.

• The refrigerators are tested one at a time.

• When tested, it’s clear whether it works!

A. What is the probability the last defective refrigerator is found on the 4 th test?

B. What is the probability no more than 4 need to be tested to identify both defective refrigerators?

Problem 2.96

C. Given that exactly one defective refrigerator was found during the first 2 tests, what is the probability the other one is found on the 3 rd or 4 th test?

Partition of the Sample Space

S

B

1

B

2

B k

A collection of sets { ,

1 2

, , B k

} such that

1. S

B

1

B

2

 

B k

, and

2. B i

B j

 

, for i

 j ,

Union of Disjoint Sets

S

A

B

1

B

2

B k

B B

1 2

, , B k

S we may write A

( A

B

1

)

( A

B

2

)

 

( A

B k

) and so

( )

(

B

1

)

(

B

2

)

 

(

B k

).

Recall Problem 2.86

A : the selected item is not defective.

B

1

A

Not defective

B

2

S

A

( A

B

1

)

( A

B

2

)

B

1

: item came from Line 1.

B

2

: item came from Line 2.

Law of Total Probability

B

1

A

B

2

B k

S

P B i

0, then

(

B i

)

( | i

) ( ) i

B B

1 2

, , B k

S we have ( )

(

B

1

)

P A

B

2

)

 

(

B k

) or equivalently,

P A

P A B P B

1 1

)

P A B P B

2

) (

2

)

 

( | k

) ( k

).

Total Probability

A P ( A | B

1

) P ( B

1

)

B

1

A

A P ( A | B

2

) P ( B

2

)

B

2

B

3

A

A P ( A | B

3

) P ( B

3

)

A

( |

1

) (

1

)

( |

2

) (

2

)

( |

3

) (

3

).

Bayes’ Theorem follows…

Since ( )

( |

1

) (

1

)

 

( | k

) ( k

), we also have

P B j

A

(

B j

)

P A B P B

1 1

)

(

B j

 

)

( | k

) ( k

) or simply,

P B j

A

 i k 

1

(

B j

)

( | i

) ( i

)

Bayes’

A P ( A | B

1

) P ( B

1

)

B

1

A

A P ( A | B

2

) P ( B

2

)

B

2

B

3

A

A P ( A | B

3

) P ( B

3

)

A

P B

2

A

(

B

2

)

P A B P B

1

)

P A B P B

2

)

P A B P B

3

)

Making Resistors

• Three machines M

1 ohm” resistors.

, M

2

, and M

3 produce “1000-

• M

1 produces 80% of resistors accurate to within

50 ohms, M

2 produces 90% to within 50 ohms, and M

3 produces 60% to within 50 ohms.

• Each hour, M

1 produces 3000 resistors, M

2 produces 4000, and M

3 produces 3000.

• If all of the resistors are mixed together and shipped in a single container, what is the probability a selected resistor is accurate to within 50 ohms?

Making Resistors

• Define A: resistor is accurate to within 50 ohms.

• M

1 produces 80% of resistors accurate to within

50 ohms, M

2 produces 90% to within 50 ohms, and M

3 produces 60% to within 50 ohms.

P A M

1

)

0.80, P A M

2

)

0.90,

P A M

3

)

0.60

• Each hour, M

1 produces 3000 resistors, M

2 produces 4000, and M

3 produces 3000.

P M

1

)

0.3, P M

2

)

P M

3

)

0.30.

Using Total Probability

Since

P A

P A M P M

1

)

P A M P M

2

)

P A M P M

3

) we have

( )

(0.8)(0.3)

(0.9)(0.4)

(0.6)(0.3)

0.78

That is,

78 % are expected to be accurate to within 50 ohms.

M

1

M

2

M

3

A

A

A

A

A

A

The Tree

(0.8)(0.3)

(0.9)(0.4)

(0.6)(0.3)

( )

(0.8)(0.3)

(0.9)(0.4)

(0.6)(0.3)

0.78

…given it’s within 50 ohms…

• Determine the probability that, given a selected resistor is accurate to within 50 ohms, it was produced by M

1

. P( M

1

| A) = ?

• Determine the probability that, given a selected resistor is accurate to within 50 ohms, it was produced by M

3

. P( M

3

| A) = ?

M

1

M

2

M

3

A

A

A

A

A

A

Given A…

(0.8)(0.3)

(0.9)(0.4)

P (M | )

1

A

P(M

1

A )

(0.6)(0.3)

(0.8)(0.3)

0.78

Arthritis

• A test detects a particular type of arthritis for individuals over 50 years old.

• 10% of this age group suffers from this arthritis.

• For individuals in this age group known to have the arthritis, the test is correct 85% of the time.

• For individuals in this age group known to NOT have the arthritis, the test indicates arthritis

(incorrectly!) 4% of the time.

P ( has arthritis | tests positive ) = ?

Arthritis

• 10% of this age group suffers from this arthritis.

P (have arthritis) = 0.10

• For individuals in this age group known to have the arthritis, the test is correct 85% of the time.

P ( tests positive | have arthritis ) = 0.85

• For individuals in this age group known to NOT have the arthritis, the test indicates arthritis

(incorrectly!) 4% of the time.

P (tests positive | no arthritis ) = 0.04

P ( have arthritis | tests positive ) = ?

P (has arthritis | tests positive ) = ?

Has arthritis

0.1

No arthritis

0.9

positive

0.85

negative positive

0.04

negative

The 3 Urns

• Three urns contain colored balls.

Urn

1

2

3

Red White Blue

3 4 1

1 2

4 3

3

2

• An urn is selected at random and one ball is randomly selected from the urn.

• Given that the ball is red, what is the probability it came from urn #2 ?

The Lost Labels

• A large stockpile of cases of light bulbs, 100 bulbs to a box, have lost their labels.

• The boxes of bulbs come in 3 levels of quality: high, medium, and low.

• It’s known 50% of the boxes were high quality, 25% medium, and 25% low.

• Two bulbs will be tested from a box to check if they’re defective.

Lost Labels…

• The likelihood of finding defective bulbs is dependent on the bulb quality:

Number of defects Low Medium High

0

1

2

.49

.42

.09

.64

.32

.04

.81

.18

.01

• Given neither bulb is found to be defective, what is the probability the bulbs came from a box of high quality bulbs?

Download