11
Hackernotes © Wayne Hacker 2007. All rights reserved. Mathematics for Business Decisions, Part I Problem Set 7: Law of Total Probability and Bayes’ Theorem Solutions NOTE: For more practice problems with solutions, see my class notes handout. Elementary-Level Problems Problems 1-4. (Law of Total Probability and Bayes’ Theorem) Let and partition the sample space . 1 B 2 B Suppose we are given the following information: 3 2 ) ( 1 = B P , 3 1 ) ( 2 = B P , 3 2 ) | ( 1 = B A P , and 2 1 ) | ( 2 = B A P . 1. Find . ) ( A P Solution: 18 11 6 1 9 4 2 1 3 1 3 2 3 2 ) | ( ) ( ) | ( ) ( ) ( 2 2 1 1 = + = + = + = B A P B P B A P B P A P 2. Find . ) | ( 1 A B P Solution: 11 8 18 11 9 4 ) | ( ) ( ) | ( ) ( ) | ( ) ( ) | ( 2 2 1 1 1 1 1 = = + = B A P B P B A P B P B A P B P A B P Suppose we are given the following information: 5 1 ) ( 1 = B P , 5 4 ) ( 2 = B P , 3 1 ) | ( 1 = B A P , and 2 1 ) | ( 2 = B A P . 3. Find . ) ( A P Solution: 15 7 30 14 2 3 5 3 4 2 3 5 2 2 1 5 4 3 1 5 1 ) | ( ) ( ) | ( ) ( ) ( 2 2 1 1 = = + = + = + = B A P B P B A P B P A P 4. Find . ) | ( 1 A B P Solution: 7 1 15 7 15 1 ) | ( ) ( ) | ( ) ( ) | ( ) ( ) | ( 2 2 1 1 1 1 1 = = + = B A P B P B A P B P B A P B P A B P

problem-set7-ltp-bayes-theorem-sols.pdf

Embed Size (px)

DESCRIPTION

Problem set for Bayes Theorem

Citation preview

Page 1: problem-set7-ltp-bayes-theorem-sols.pdf

Hackernotes © Wayne Hacker 2007. All rights reserved.

Mathematics for Business Decisions, Part I Problem Set 7: Law of Total Probability and Bayes’ Theorem Solutions NOTE: For more practice problems with solutions, see my class notes handout. Elementary-Level Problems Problems 1-4. (Law of Total Probability and Bayes’ Theorem) Let and partition the sample space Ω.

1B 2B

Suppose we are given the following information:

32)( 1 =BP ,

31)( 2 =BP ,

32)|( 1 =BAP , and

21)|( 2 =BAP .

1. Find . )(AP

Solution: 1811

61

94

21

31

32

32)|()()|()()( 2211 =+=⋅+⋅=+= BAPBPBAPBPAP

2. Find . )|( 1 ABP

Solution: 118

181194

)|()()|()()|()(

)|(2211

111 ==

+=

BAPBPBAPBPBAPBP

ABP

Suppose we are given the following information:

51)( 1 =BP ,

54)( 2 =BP ,

31)|( 1 =BAP , and

21)|( 2 =BAP .

3. Find . )(AP

Solution: 157

3014

23534

2352

21

54

31

51)|()()|()()( 2211 ==

⋅⋅⋅

+⋅⋅

=⋅+⋅=+= BAPBPBAPBPAP

4. Find . )|( 1 ABP

Solution: 71

157

151

)|()()|()()|()(

)|(2211

111 ==

+=

BAPBPBAPBPBAPBP

ABP

Page 2: problem-set7-ltp-bayes-theorem-sols.pdf

Hackernotes © Wayne Hacker 2007. All rights reserved. 5-6. Suppose that we have two identical boxes: box 1 and box 2. Box 1 contains 5 red balls and 3 blue balls. Box 2 contains 2 red balls and 4 blue balls. A box is selected at random and exactly one ball is drawn from the box. 5. (Law of Total Probability) What is the probability that the ball is blue? Solution: Use the law of total probability. Step 1: Define the events: let

⎪⎪⎪

⎪⎪⎪

=====Ω

ball blue aselect you event ball red aselect you event 2box select you event 1box select you event

balls all

2

1

BRBB

Step 2: Write down the given information: First, notice that the events and partition the sample space Ω. 1B 2B Given:

,21)( 1 =BP ,

21)( 2 =BP

83)|( 1 =BBP ,

32

64)|( 2 ==BBP

. Step 3: Write down what you are trying to solve for:

21

4825

48169

31

163

32

21

83

21)|()()|()()( 2211 ≈=

+=+=⋅+⋅=+= BBPBPBBPBPBP

6. (Bayes’ Theorem) Given that the selected ball is blue, what’s the probability that it came from box 2? Solution: Use Bayes’ theorem.

2516

482531

)|()()|()()|()(

)|(2211

222 ==

+=

BBPBPBBPBPBBPBP

BBP

Page 3: problem-set7-ltp-bayes-theorem-sols.pdf

Hackernotes © Wayne Hacker 2007. All rights reserved. Intermediate-Level Problems 7-9. You are selling a product in an area where 30% of the people live in the city; the rest live in the suburbs. 20% of the city dwellers (urbanites) use your product; and 10% of the suburbanites use your product. 7. (Law of Total Probability) What fraction of the people in the area use your product? Solution: Step 1: Define the events: let Ω = all of the potential customers in your area U = the person is an urbanite S = the person is a suburbanite C = the person is a customer

CC = the person is not a customer Step 2: Write down the given information: First, notice that the events U and S partition the sample space Ω. The events C and CC

also partition the set Ω; however, as shown below, the given information suggests that we take U and S as our partition for this problem. Given:

,30.0)( =UP 70.030.01)(1)( =−=−= UPSP (since U and S partition Ω),

20.0)|( =UCP , (since the events U and S have occurred, they should be the partitions of Ω) 10.0)|( =SCP .

Step 3: Write down what you are trying to solve for: Want We can compute this term using the law of total probability with U and S as our partition.

).(CP

13.07.06.)1)(.7(.)2)(.3(.)|()()|()()( =+=+=+= SCPSPUCPUPCP

Page 4: problem-set7-ltp-bayes-theorem-sols.pdf

Hackernotes © Wayne Hacker 2007. All rights reserved. 8. (Law of Total Probability) You must choose between one of two sales strategies. The first will increase the fraction of city dwellers using your product from 20% to 25%; the second will increase the fraction of suburbanites using your product from 10% to 15%. Which strategy would produce a greater increase in the total number of people using the product? Solution: Step 1: Define the events: let Ω = all of the potential customers in your area U = the person is an urbanite S = the person is a suburbanite C = the person is a customer

CC = the person is not a customer Step 2: Write down the given information: First, notice that the events U and S partition the sample space Ω. The events C and CC

also partition the set Ω; however, as shown below, the given information suggests that we take U and S as our partition for this problem. Given:

,30.0)( =UP 70.030.01)(1)( =−=−= UPSP (since U and S partition Ω),

Sales strategies do not change the demographics of the area: the number of people living in the city and suburbs does not change because of a change in sales strategy. Hence P(U) and P(S) remain the same under both plans. However, a change in sales strategy will change the number of customers by a prescribed amount. To distinguish between the two plans, let and denote the customers under plans 1 and 2 respectively.

1C 2C

Step 3: Write down what you are trying to solve for: Plan 1: (the number of city dweller customers increases) 25.0)|( 1 =UCP (the number of suburbanite customers remains the same) 10.0)|( 1 =SCPThe fraction of customers under plan 1 is: 1C

145.07.075.)1)(.7(.)25)(.3(.)|()()|()()( 111 =+=+=+= SCPSPUCPUPCP Plan 2: (the number of city dweller customers remains the same) 20.0)|( 2 =UCP (the number of suburbanite customers increases) 15.0)|( 2 =SCP The fraction of customers under plan 2 is: 2C

165.105.06.)15)(.7(.)2)(.3(.)|()()|()()( 222 =+=+=+= SCPSPUCPUPCP Thus plan B will produce more customers.

Page 5: problem-set7-ltp-bayes-theorem-sols.pdf

Hackernotes © Wayne Hacker 2007. All rights reserved. 9. (Bayes’ Theorem) What percentage of the people currently using your product are city dwellers?

Solution: We are not given data that can directly answer the question. We are given the data (the probability that a person is a customer, given that he is a city dweller). But

we want to reverse the order of the conditional probability from its given form. This requires Bayes’ Theorem.

20.0)|( =UCP

Step 1: Define the events: let Ω = all of the potential customers in your area U = the person is an urbanite S = the person is a suburbanite C = the person is a customer

CC = the person is not a customer Step 2: Write down the given information: First, notice that the events U and S partition the sample space Ω. The events C and CC

also partition the set Ω; however, as shown below, the given information suggests that we take U and S as our partition for this problem. Given:

,30.0)( =UP 70.030.01)(1)( =−=−= UPSP (since U and S partition Ω),

20.0)|( =UCP , (since the events U and S have occurred, they should be the partitions of Ω) 10.0)|( =SCP .

Step 3: Write down what you are trying to solve for: Want We can compute this using Bayes’ theorem. We can also use the result from the law of total probability with U and S as our partition.

).|( CUP

136

13.06.

)1)(.7(.)2)(.3(.)2)(.3(.

)|()()|()()|()()|( ==

+=

+=

SCPSPUCPUPUCPUPCUP .

Page 6: problem-set7-ltp-bayes-theorem-sols.pdf

Hackernotes © Wayne Hacker 2007. All rights reserved. 10. (Law of Total Probability) A high school conducts random drug tests on its students. Of the student body, it is known that 8% use marijuana regularly; 17% use it occasionally; and 75% never use it. The testing regime is not perfect: regular marijuana users falsely test negative 5% of the time; occasional users falsely test negative 13% of the time; and non-users falsely test positive 11% of the time. What percentage of the student body will test positive for marijuana use?

Solution: Step 1: Define the events: let Ω = all of the students in the high school (the entire student body) R = the person uses marijuana regularly O = the person uses marijuana occasionally N = the person never uses marijuana

+T = the person tests positive for marijuana use −T = the person tests negative for marijuana use

Notice that . If we assume that there were no inclusive tests, and if all of the students were tested, then

−+ = TT C)(+T and −T would partition Ω. However, the data suggests that we use a

different partition. The sets R, O, and N, also partition the sample space, since Ω=∪∪ NOR , Ø, Ø, and =∩OR =∩ NR =∩ NO Ø. We will use these sets as our partition.

Step 2: Write down the given information: Given:

,08.0)( =RP 17.0)( =OP , 75.0)( =NP ,

From the data we are given the probability of testing positive or negative given that the events R, O, and N have occurred. Thus based on the data, we should use R, O, and N to partition Ω. From the problem description we can infer the following:

05.0)|( =− RTP ⇒ , 95.05.01)|(1)|( =−=−= −+ RTPRTP13.0)|( =− OTP ⇒ , 87.17.01)|(1)|( =−=−= −+ OTPOTP11.0)|( =+ NTP . ⇒ 89.11.01)|(1)|( =−=−= +− NTPNTP

Step 3: Write down what you are trying to solve for: Want . We can compute this term using the law of total probability with R, O, and N as our partition.

)( +TP

3064.)11)(.75(.)87)(.17(.)95)(.08(.)|()()|()()|()()(

=++=++= ++++ NTPNPOTPOPRTPRPTP

Page 7: problem-set7-ltp-bayes-theorem-sols.pdf

Hackernotes © Wayne Hacker 2007. All rights reserved. 11-12. (Bayes’ Theorem) An inexpensive blood test can be used to test whether or not a person has a certain type of cancer. The test is not perfect: there is a 12% chance that a person who has the cancer will falsely test negative, and a 15% chance that a person who does not have the cancer will falsely test positive. More accurate (and more expensive) testing has shown that the cancer is present in 8% of the tested population. 11. What is the probability that a person who tests negative has this type of cancer?

Solution:

Step 1: Define the events: let Ω = all people C = the person has cancer

CC = the person does not have cancer +T = the person tests positive for cancer −T = the person tests negative for cancer

Notice that . If we assume that there were no inclusive tests, and if all of the population were tested, then

−+ = TT C)(+T and −T would partition Ω. However, the data suggests that we

use a different partition. The sets C and also partition the sample space. Because of the form of the given information, we will use these sets as our partition.

CC

Step 2: Write down the given information: Given: . 08.0)( =CP ⇒ 92.08.01)( =−=CCP From the data, we know the probability of testing positive or negative given that the events C and have occurred. Thus based on the data, we should use C and to partition Ω. CC CC

12.0)|( =− CTP , ⇒ 88.12.01)|(1)|( =−=−= −+ CTPCTP15.0)|( =+ CCTP , ⇒ 85.15.01)|(1)|( =−=−= +− CC CTPCTP

Step 3: Write down what you are trying to solve for: Want . We can compute this term using Bayes’ theorem with C and as our partition.

)|( −TCP CC

01213.)85)(.92(.)12)(.08(.

)12)(.08(.)|()()|()(

)|()()|( =+

=+

= −−

−−

CC CTPCPCTPCPCTPCPTCP

12. What is the probability that a person who tests positive has this type of cancer?

3378.)15)(.92(.)88)(.08(.

)88)(.08(.)|()()|()(

)|()()|( =+

=+

= ++

++

CC CTPCPCTPCPCTPCPTCP

Page 8: problem-set7-ltp-bayes-theorem-sols.pdf

Hackernotes © Wayne Hacker 2007. All rights reserved. 13. (Bayes’ Theorem) A box contains 3 coins. One coin has 2 heads and the other two are fair. A coin is chosen at random from the box and flipped. If the coin turns up heads, what is the probability that it is the two-headed coin? Is the answer 1/3? Solution:

Step 1: Define the events: let Ω = all of the heads and tails of each coin. Mathematically we can express this as

,,,,, )3(1

)3(1

)2(1

)2(1

)1(2

)1(1 THTHHH=Ω , where denotes the head of the coin. )( j

iH thi thjFor example, denotes the head on the second side of the first coin. )1(

2H We shall number the coins in the order that they are introduced in the problem:

1C = coin 1 (the double-headed coin)

2C = coin 2 (the first fair coin)

3C = coin 3 (the second fair coin) H = the event the coin toss results in heads T = the event that the coin toss results in tails Step 2: Write down the given information: Since each coin is equally likely to be selected, the probability of selecting any of the three coins

is the same. Thus31)()()( 321 === CPCPCP . Notice that the coins naturally partition the

sample space Ω: is the event , is the event , and is the event .

1C , )1(2

)1(11 HHC = 2C , )2(

1)2(

12 THC = 3C, )3(

1)3(

13 THC = From the problem we can easily compute the conditional probabilities:

1)|( 1 =CHP ⇒ 011)|(1)|( 11 =−=−= CHPCTP ,

21)|( 2 =CHP ⇒

21

211)|(1)|( 22 =−=−= CHPCTP

21)|( 3 =CHP ⇒

21

211)|(1)|( 33 =−=−= CHPCTP .

In these computations we have use the fact that when the fair coin is tossed, the events of heads and tails are equally likely. Step 3: Write down what you are trying to solve for: We want the probability of selecting the double-headed coin (coin 1) given that the flip came up heads. That is, we want P(coin 1 given that the toss results in heads) = P(coin 1 | heads).

31

21

21

31

21

311

31

131

)|()()|()()|()()|()(

)|(332211

111 ≠=

⋅+⋅+⋅

⋅=

++=

CHPCPCHPCPCHPCPCHPCP

HCP

Notice that the result is somewhat counterintuitive.

Page 9: problem-set7-ltp-bayes-theorem-sols.pdf

Hackernotes © Wayne Hacker 2007. All rights reserved. 14. (Bayes’ Theorem) An insurance company divides its policy holders into three categories: low risk, moderate risk, and high risk. The low-risk policy holders account for 60% of the total number of people insured by the company. The moderate-risk policy holders account for 30%, and the high-risk policy holders account for 10%. The probabilities that a low-risk, moderate-risk, and high-risk policy holder will file a claim within a given year are respectively .01, .10, and .50. Given that a policy holder files a claim this year, what is the probability that the person is a high-risk policy holder? Solution:

Step 1: Define the events: let Ω = all of policy holders L = low-risk policy holders M = moderate-risk policy holders H = high-risk policy holders C = a policy holder will file a claim this year

CC = a policy holder will not file a claim this year

Notice that C and partition Ω. We also see that L, M, and H partition Ω, since

CCΩ=∪∪ HML , =∩ ML Ø, =∩ HL Ø, and =∩ HM Ø. We will use the given

information (the data) to choose the correct partition for this problem.

Step 2: Write down the given information:

,6.0)( =LP 3.0)( =MP , 1.0)( =HP .

From the data, we know the probability that a policy holder will file a claim given their risk group. From the problem statement we can infer:

01.0)|( =LCP , ⇒ 99.01.01)|(1)|( =−=−= LCPLCP C

10.0)|( =MCP , ⇒ 90.10.01)|(1)|( =−=−= MCPMCP C

50.0)|( =HCP ⇒ . 50.50.01)|(1)|( =−=−= HCPHCP C

Since the data are conditioned upon L, M, and H, we must use these sets as our partition for Ω.

Step 3: Write down what you are trying to solve for: Want . We can compute this using Bayes’ theorem with L, M, and H as our partition. )|( CHP

58.086.05.

)5)(.1(.)1)(.3(.)01)(.6(.)5)(.1(.

)|()()|()()|()()|()()|( ≈=

++=

++=

HCPHPMCPMPLCPLPHCPHPCHP

Page 10: problem-set7-ltp-bayes-theorem-sols.pdf

Hackernotes © Wayne Hacker 2007. All rights reserved. 15. (Law of Total Probability) A card is drawn from a standard deck of 52 cards and discarded (i.e. not replaced). A second card is drawn from the remaining deck of 51 cards. What is the probability that the second card is a spade? Solution: Step 1: Define the events: let Ω = all 52 cards in the standard deck of cards

1S = the first card drawn is a spade CS1 = the first card drawn is not a spade

2S = the second card drawn is a spade CS2 = the second card drawn is not a spade

Note: In this problem, the order that the cards are drawn in is important! Step 2: Write down the given information: First, notice that the events and partition the sample space Ω. 1S CS1

Given:

5213)( 1 =SP ,

5239

52131)(1)( 11 =−=−= SPSP C ,

5112)|( 12 =SSP ,

5113)|( 12 =CSSP .

Step 3: Write down what you are trying to solve for: Want We can compute this using the law of total probability with and as our partition.

).( 2SP 1S CS1

41

2652507156

5113

5239

5112

5213)|()()|()()( 1211212 =

+=⋅+⋅=+= CC SSPSPSSPSPSP

Page 11: problem-set7-ltp-bayes-theorem-sols.pdf

Hackernotes © Wayne Hacker 2007. All rights reserved. 16. (Bayes’ Theorem) A card is drawn from a standard deck of 52 cards and discarded (i.e. not replaced). A second card is drawn from the remaining deck of 51 cards. Given that the second card was a spade, what is the probability that the first card was also a spade? Solution: Step 1: Define the events: let Ω = all 52 cards in the standard deck of cards

1S = the first card drawn is a spade CS1 = the first card drawn is not a spade

2S = the second card drawn is a spade CS2 = the second card drawn is not a spade

Note: In this problem the order that the cards are drawn in is important! Step 2: Write down the given information: First, notice that the events and partition the sample space Ω. 1S CS1

Given:

5213)( 1 =SP ,

5239

52131)(1)( 11 =−=−= SPSP C ,

5112)|( 12 =SSP ,

5113)|( 12 =CSSP .

Step 3: Write down what you are trying to solve for: Want We can reverse the order of the conditional probability using Bayes’ theorem with and as our partition.

).|( 21 SSP

1S CS1

41

174

41

171

41

5112

5213

)|()()|()()|()(

)|(121121

12121 ≈==

⋅=

+= CC SSPSPSSPSP

SSPSPSSP