# OpenStax_CNX

You are here: Home » Content » Applied Probability » Problems on Conditional Independence

• Preface to Pfeiffer Applied Probability

### Lenses

What is a lens?

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

#### Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
• Rice Digital Scholarship

This collection is included in aLens by: Digital Scholarship at Rice University

Click the "Rice Digital Scholarship" link to see all content affiliated with them.

#### Also in these lenses

• UniqU content

This collection is included inLens: UniqU's lens
By: UniqU, LLC

Click the "UniqU content" link to see all content selected in this lens.

### Recently Viewed

This feature requires Javascript to be enabled.

Inside Collection:

Collection by: Paul E Pfeiffer. E-mail the author

# Problems on Conditional Independence

Module by: Paul E Pfeiffer. E-mail the author

## Exercise 1

Suppose {A,B} ci |C{A,B} ci |C and {A,B} ci |Cc{A,B} ci |Cc, P(C)=0.7P(C)=0.7, and

P ( A | C ) = 0 . 4 P ( B | C ) = 0 . 6 P ( A | C c ) = 0 . 3 P ( B | C c ) = 0 . 2 P ( A | C ) = 0 . 4 P ( B | C ) = 0 . 6 P ( A | C c ) = 0 . 3 P ( B | C c ) = 0 . 2
(1)

Show whether or not the pair {A,B}{A,B} is independent.

### Solution

P(A)=P(A|C)P(C)+P(A|Cc)P(Cc),P(B)=P(B|C)P(C)+P(B|Cc)P(Cc)P(A)=P(A|C)P(C)+P(A|Cc)P(Cc),P(B)=P(B|C)P(C)+P(B|Cc)P(Cc), and P(AB)=P(A|C)P(B|C)P(C)+P(A|Cc)P(B|Cc)P(Cc)P(AB)=P(A|C)P(B|C)P(C)+P(A|Cc)P(B|Cc)P(Cc).

PA = 0.4*0.7 + 0.3*0.3
PA =  0.3700
PB = 0.6*0.7 + 0.2*0.3
PB =  0.4800
PA*PB
ans = 0.1776
PAB = 0.4*0.6*0.7 + 0.3*0.2*0.3
PAB = 0.1860       % PAB not equal PA*PB;  not independent


## Exercise 2

Suppose {A1,A2,A3} ci |C{A1,A2,A3} ci |C and ci |Cc ci |Cc, with P(C)=0.4P(C)=0.4, and

P ( A i | C ) = 0 . 90 , 0 . 85 , 0 . 80 P ( A i | C c ) = 0 . 20 , 0 . 15 , 0 . 20 for i = 1 , 2 , 3 , respectively P ( A i | C ) = 0 . 90 , 0 . 85 , 0 . 80 P ( A i | C c ) = 0 . 20 , 0 . 15 , 0 . 20 for i = 1 , 2 , 3 , respectively
(2)

Determine the posterior odds P(C|A1A2cA3)/P(Cc|A1A2cA3)P(C|A1A2cA3)/P(Cc|A1A2cA3).

### Solution

P ( C | A 1 A 2 c A 3 ) P ( C c | A 1 A 2 c A 3 ) = P ( C ) P ( C c ) P ( A 1 | C ) P ( A 2 c | C ) P ( A 3 | C ) P ( A 1 | C c ) P ( A 2 c | C c ) P ( A 3 | C c ) P ( C | A 1 A 2 c A 3 ) P ( C c | A 1 A 2 c A 3 ) = P ( C ) P ( C c ) P ( A 1 | C ) P ( A 2 c | C ) P ( A 3 | C ) P ( A 1 | C c ) P ( A 2 c | C c ) P ( A 3 | C c )
(3)
= 0 . 4 0 . 6 0 . 9 0 . 15 0 . 80 0 . 20 0 . 85 0 . 20 = 108 51 = 2 . 12 = 0 . 4 0 . 6 0 . 9 0 . 15 0 . 80 0 . 20 0 . 85 0 . 20 = 108 51 = 2 . 12
(4)

## Exercise 3

Five world class sprinters are entered in a 200 meter dash. Each has a good chance to break the current track record. There is a thirty percent chance a late cold front will move in, bringing conditions that adversely affect the runners. Otherwise, conditions are expected to be favorable for an outstanding race. Their respective probabilities of breaking the record are:

• Good weather (no front): 0.75, 0.80, 0.65, 0.70, 0.85
• Poor weather (front in): 0.60, 0.65, 0.50, 0.55, 0.70

The performances are (conditionally) independent, given good weather, and also, given poor weather. What is the probability that three or more will break the track record?

Hint. If B3 is the event of three or more, P(B3)=P(B3|W)P(W)+P(B3|Wc)P(Wc)P(B3)=P(B3|W)P(W)+P(B3|Wc)P(Wc).

### Solution

PW = 0.01*[75 80 65 70 85];
PWc = 0.01*[60 65 50 55 70];
P = ckn(PW,3)*0.7 + ckn(PWc,3)*0.3
P =  0.8353


## Exercise 4

A device has five sensors connected to an alarm system. The alarm is given if three or more of the sensors trigger a switch. If a dangerous condition is present, each of the switches has high (but not unit) probability of activating; if the dangerous condition does not exist, each of the switches has low (but not zero) probability of activating (falsely). Suppose D=D= the event of the dangerous condition and A=A= the event the alarm is activated. Proper operation consists of ADAcDcADAcDc. Suppose Ei=Ei= the event the ith unit is activated. Since the switches operate independently, we suppose

{ E 1 , E 2 , E 3 , E 4 , E 5 } ci | D and ci | D c { E 1 , E 2 , E 3 , E 4 , E 5 } ci | D and ci | D c
(5)

Assume the conditional probabilities of the E1, given D, are 0.91, 0.93, 0.96, 0.87, 0.97, and given Dc, are 0.03, 0.02, 0.07, 0.04, 0.01, respectively. If P(D)=0.02P(D)=0.02, what is the probability the alarm system acts properly? Suggestion. Use the conditional independence and the procedure ckn.

### Solution

P1 = 0.01*[91 93 96 87 97];
P2 = 0.01*[3 2 7 4 1];
P  = ckn(P1,3)*0.02 + (1 - ckn(P2,3))*0.98
P =  0.9997


## Exercise 5

Seven students plan to complete a term paper over the Thanksgiving recess. They work independently; however, the likelihood of completion depends upon the weather. If the weather is very pleasant, they are more likely to engage in outdoor activities and put off work on the paper. Let Ei be the event the ith student completes his or her paper, Ak be the event that k or more complete during the recess, and W be the event the weather is highly conducive to outdoor activity. It is reasonable to suppose {Ei:1i7} ci |W{Ei:1i7} ci |W and ci |Wc ci |Wc. Suppose

P ( E i | W ) = 0 . 4 , 0 . 5 , 0 . 3 , 0 . 7 , 0 . 5 , 0 . 6 , 0 . 2 P ( E i | W ) = 0 . 4 , 0 . 5 , 0 . 3 , 0 . 7 , 0 . 5 , 0 . 6 , 0 . 2
(6)
P ( E i | W c ) = 0 . 7 , 0 . 8 , 0 . 5 , 0 . 9 , 0 . 7 , 0 . 8 , 0 . 5 P ( E i | W c ) = 0 . 7 , 0 . 8 , 0 . 5 , 0 . 9 , 0 . 7 , 0 . 8 , 0 . 5
(7)

respectively, and P(W)=0.8P(W)=0.8. Determine the probability P(A4)P(A4) that four our more complete their papers and P(A5)P(A5) that five or more finish.

### Solution

PW = 0.1*[4 5 3 7 5 6 2];
PWc = 0.1*[7 8 5 9 7 8 5];
PA4 = ckn(PW,4)*0.8 + ckn(PWc,4)*0.2
PA4 =  0.4993
PA5 = ckn(PW,5)*0.8 + ckn(PWc,5)*0.2
PA5 =  0.2482


## Exercise 6

A manufacturer claims to have improved the reliability of his product. Formerly, the product had probability 0.65 of operating 1000 hours without failure. The manufacturer claims this probability is now 0.80. A sample of size 20 is tested. Determine the odds favoring the new probability for various numbers of surviving units under the assumption the prior odds are 1 to 1. How many survivors would be required to make the claim creditable?

### Solution

Let E1 be the event the probability is 0.80 and E2 be the event the probability is 0.65. Assume P(E1)/P(E2)=1P(E1)/P(E2)=1.

P ( E 1 | S n = k ) P ( E 2 | S n = k ) = P ( E 1 ) P ( E 2 ) P ( S n = k | E 1 ) P ( S n = k | E 2 ) P ( E 1 | S n = k ) P ( E 2 | S n = k ) = P ( E 1 ) P ( E 2 ) P ( S n = k | E 1 ) P ( S n = k | E 2 )
(8)
k = 1:20;
odds = ibinom(20,0.80,k)./ibinom(20,0.65,k);
disp([k;odds]')
- - - - - - - - - - - -
13.0000    0.2958
14.0000    0.6372
15.0000    1.3723   % Need at least 15 or 16 successes
16.0000    2.9558
17.0000    6.3663
18.0000   13.7121
19.0000   29.5337
20.0000   63.6111


## Exercise 7

A real estate agent in a neighborhood heavily populated by affluent professional persons is working with a customer. The agent is trying to assess the likelihood the customer will actually buy. His experience indicates the following: if H is the event the customer buys, S is the event the customer is a professional with good income, and E is the event the customer drives a prestigious car, then

P ( S ) = 0 . 7 P ( S | H ) = 0 . 90 P ( S | H c ) = 0 . 2 P ( E | S ) = 0 . 95 P ( E | S c ) = 0 . 25 P ( S ) = 0 . 7 P ( S | H ) = 0 . 90 P ( S | H c ) = 0 . 2 P ( E | S ) = 0 . 95 P ( E | S c ) = 0 . 25
(9)

Since buying a house and owning a prestigious car are not related for a given owner, it seems reasonable to suppose P(E|HS)=P(E|HcS)P(E|HS)=P(E|HcS) and P(E|HSc)=P(E|HcSc)P(E|HSc)=P(E|HcSc). The customer drives a Cadillac. What are the odds he will buy a house?

### Solution

Assumptions amount to {H,E} ci |S{H,E} ci |S and ci |Sc ci |Sc.

P ( H | S ) P ( H c | S ) = P ( H ) P ( S | H ) P ( H c ) P ( S | H c ) P ( H | S ) P ( H c | S ) = P ( H ) P ( S | H ) P ( H c ) P ( S | H c )
(10)
P ( S ) = P ( H ) P ( S | H ) + [ 1 - P ( H ) ] P ( S | H c ) which implies P ( S ) = P ( H ) P ( S | H ) + [ 1 - P ( H ) ] P ( S | H c ) which implies
(11)
P ( H ) = P ( S ) - P ( S | H c ) P ( S | H ) - P ( S | H c ) = 5 / 7 so that P ( H | S ) P ( H c | S ) = 5 2 0 . 9 0 . 2 = 45 4 P ( H ) = P ( S ) - P ( S | H c ) P ( S | H ) - P ( S | H c ) = 5 / 7 so that P ( H | S ) P ( H c | S ) = 5 2 0 . 9 0 . 2 = 45 4
(12)

## Exercise 8

In deciding whether or not to drill an oil well in a certain location, a company undertakes a geophysical survey. On the basis of past experience, the decision makers feel the odds are about four to one favoring success. Various other probabilities can be assigned on the basis of past experience. Let

• H be the event that a well would be successful
• S be the event the geological conditions are favorable
• E be the event the results of the geophysical survey are positive

The initial, or prior, odds are P(H)/P(Hc)=4P(H)/P(Hc)=4. Previous experience indicates

P ( S | H ) = 0 . 9 P ( S | H c ) = 0 . 20 P ( E | S ) = 0 . 95 P ( E | S c ) = 0 . 10 P ( S | H ) = 0 . 9 P ( S | H c ) = 0 . 20 P ( E | S ) = 0 . 95 P ( E | S c ) = 0 . 10
(13)

Make reasonable assumptions based on the fact that the result of the geophysical survey depends upon the geological formations and not on the presence or absence of oil. The result of the survey is favorable. Determine the posterior odds P(H|E)/P(Hc|E)P(H|E)/P(Hc|E).

### Solution

P ( H | E ) P ( H c | E ) = P ( H ) P ( H c ) P ( S | H ) P ( E | S ) + P ( S c | H ) P ( E | S c ) P ( S | H c ) P ( E | S ) + P ( S c | H c ) P ( E | S c ) P ( H | E ) P ( H c | E ) = P ( H ) P ( H c ) P ( S | H ) P ( E | S ) + P ( S c | H ) P ( E | S c ) P ( S | H c ) P ( E | S ) + P ( S c | H c ) P ( E | S c )
(14)
= 4 0 . 90 0 . 95 + 0 . 10 0 . 10 0 . 20 0 . 95 + 0 . 80 0 . 10 = 12 . 8148 = 4 0 . 90 0 . 95 + 0 . 10 0 . 10 0 . 20 0 . 95 + 0 . 80 0 . 10 = 12 . 8148
(15)

## Exercise 9

A software firm is planning to deliver a custom package. Past experience indicates the odds are at least four to one that it will pass customer acceptance tests. As a check, the program is subjected to two different benchmark runs. Both are successful. Given the following data, what are the odds favoring successful operation in practice? Let

• H be the event the performance is satisfactory
• S be the event the system satisfies customer acceptance tests
• E1 be the event the first benchmark tests are satisfactory.
• E2 be the event the second benchmark test is ok.

Under the usual conditions, we may assume {H,E1,E2} ci |S{H,E1,E2} ci |S and ci |Sc ci |Sc. Reliability data show

P ( H | S ) = 0 . 95 , P ( H | S c ) = 0 . 45 P ( H | S ) = 0 . 95 , P ( H | S c ) = 0 . 45
(16)
P ( E 1 | S ) = 0 . 90 P ( E 1 | S c ) = 0 . 25 P ( E 2 | S ) = 0 . 95 P ( E 2 | S c ) = 0 . 20 P ( E 1 | S ) = 0 . 90 P ( E 1 | S c ) = 0 . 25 P ( E 2 | S ) = 0 . 95 P ( E 2 | S c ) = 0 . 20
(17)

Determine the posterior odds P(H|E1E2)/P(Hc|E1E2)P(H|E1E2)/P(Hc|E1E2).

### Solution

P ( H | E 1 E 2 ) P ( H c | E 1 E 2 ) = P ( H E 1 E 2 S ) + P ( H E 1 E 2 S c ) P ( H c E 1 E 2 S ) + P ( H c E 1 E 2 S c ) P ( H | E 1 E 2 ) P ( H c | E 1 E 2 ) = P ( H E 1 E 2 S ) + P ( H E 1 E 2 S c ) P ( H c E 1 E 2 S ) + P ( H c E 1 E 2 S c )
(18)
= P ( S ) P ( H | S ) P ( E 1 | S ) P ( E 2 | S ) + P ( S c ) P ( H | S c ) P ( E 1 | S c ) P ( E 2 | S c ) P ( S ) P ( H c | S ) P ( E 1 | S ) P ( E 2 | S ) + P ( S c ) P ( H c | S c ) P ( E 1 | S c ) P ( E 2 | S c ) = P ( S ) P ( H | S ) P ( E 1 | S ) P ( E 2 | S ) + P ( S c ) P ( H | S c ) P ( E 1 | S c ) P ( E 2 | S c ) P ( S ) P ( H c | S ) P ( E 1 | S ) P ( E 2 | S ) + P ( S c ) P ( H c | S c ) P ( E 1 | S c ) P ( E 2 | S c )
(19)
= 0 . 80 0 . 95 0 . 90 0 . 95 + 0 . 20 0 . 45 0 . 25 0 . 20 0 . 80 0 . 05 0 . 90 0 . 95 + 0 . 20 0 . 55 0 . 25 0 . 20 = 16 . 64811 = 0 . 80 0 . 95 0 . 90 0 . 95 + 0 . 20 0 . 45 0 . 25 0 . 20 0 . 80 0 . 05 0 . 90 0 . 95 + 0 . 20 0 . 55 0 . 25 0 . 20 = 16 . 64811
(20)

## Exercise 10

A research group is contemplating purchase of a new software package to perform some specialized calculations. The systems manager decides to do two sets of diagnostic tests for significant bugs that might hamper operation in the intended application. The tests are carried out in an operationally independent manner. The following analysis of the results is made.

• H=H= the event the program is satisfactory for the intended application
• S=S= the event the program is free of significant bugs
• E1=E1= the event the first diagnostic tests are satisfactory
• E2=E2= the event the second diagnostic tests are satisfactory

Since the tests are for the presence of bugs, and are operationally independent, it seems reasonable to assume {H,E1,E2} ci |S{H,E1,E2} ci |S and {H,E1,E2} ci |Sc{H,E1,E2} ci |Sc. Because of the reliability of the software company, the manager thinks P(S)=0.85P(S)=0.85. Also, experience suggests

 P ( H | S ) = 0 . 95 P ( H | S ) = 0 . 95 P ( E 1 | S ) = 0 . 90 P ( E 1 | S ) = 0 . 90 P ( E 2 | S ) = 0 . 95 P ( E 2 | S ) = 0 . 95 P ( H | S c ) = 0 . 30 P ( H | S c ) = 0 . 30 P ( E 1 | S c ) = 0 . 20 P ( E 1 | S c ) = 0 . 20 P ( E 2 | S c ) = 0 . 25 P ( E 2 | S c ) = 0 . 25

Determine the posterior odds favoring H if results of both diagnostic tests are satisfactory.

### Solution

P ( H | E 1 E 2 ) P ( H c | E 1 E 2 ) = P ( H E 1 E 2 S ) + P ( H E 1 E 2 S c ) P ( H c E 1 E 2 S ) + P ( H c E 1 E 2 S c ) P ( H | E 1 E 2 ) P ( H c | E 1 E 2 ) = P ( H E 1 E 2 S ) + P ( H E 1 E 2 S c ) P ( H c E 1 E 2 S ) + P ( H c E 1 E 2 S c )
(21)
P ( H E 1 E 2 S ) = P ( S ) P ( H | S ) P ( E 1 | S H ) P ( E 2 | S H E 1 ) = P ( S ) P ( H | S ) P ( E 1 | S ) P ( E 2 | S ) P ( H E 1 E 2 S ) = P ( S ) P ( H | S ) P ( E 1 | S H ) P ( E 2 | S H E 1 ) = P ( S ) P ( H | S ) P ( E 1 | S ) P ( E 2 | S )
(22)

with similar expressions for the other terms.

P ( H | E 1 E 2 ) P ( H c | E 1 E 2 ) = 0 . 85 0 . 95 0 . 90 0 . 95 + 0 . 15 0 . 30 0 . 25 0 . 20 0 . 85 0 . 05 0 . 90 0 . 95 + 0 . 15 0 . 70 0 . 25 * 0 . 20 = 16 . 6555 P ( H | E 1 E 2 ) P ( H c | E 1 E 2 ) = 0 . 85 0 . 95 0 . 90 0 . 95 + 0 . 15 0 . 30 0 . 25 0 . 20 0 . 85 0 . 05 0 . 90 0 . 95 + 0 . 15 0 . 70 0 . 25 * 0 . 20 = 16 . 6555
(23)

## Exercise 11

A company is considering a new product now undergoing field testing. Let

• H be the event the product is introduced and successful
• S be the event the R&D group produces a product with the desired characteristics.
• E be the event the testing program indicates the product is satisfactory

The company assumes P(S)=0.9P(S)=0.9 and the conditional probabilities

P ( H | S ) = 0 . 90 P ( H | S c ) = 0 . 10 P ( E | S ) = 0 . 95 P ( E | S c ) = 0 . 15 P ( H | S ) = 0 . 90 P ( H | S c ) = 0 . 10 P ( E | S ) = 0 . 95 P ( E | S c ) = 0 . 15
(24)

Since the testing of the merchandise is not affected by market success or failure, it seems reasonable to suppose {H,E} ci |S{H,E} ci |S and ci |Sc ci |Sc. The field tests are favorable. Determine P(H|E)/P(Hc|E)P(H|E)/P(Hc|E).

### Solution

P ( H | E ) P ( H c | E ) = P ( S ) P ( H | S ) P ( E | S ) + P ( S c ) P ( H | S c ) P ( E | S c ) P ( S ) P ( H c | S ) P ( E | S ) + P ( S c ) P ( H c | S c ) P ( E | S c ) P ( H | E ) P ( H c | E ) = P ( S ) P ( H | S ) P ( E | S ) + P ( S c ) P ( H | S c ) P ( E | S c ) P ( S ) P ( H c | S ) P ( E | S ) + P ( S c ) P ( H c | S c ) P ( E | S c )
(25)
= 0 . 90 0 . 90 0 . 95 + 0 . 10 0 . 10 0 . 15 0 . 90 0 . 10 0 . 95 + 0 . 10 0 . 90 0 . 15 = 7 . 7879 = 0 . 90 0 . 90 0 . 95 + 0 . 10 0 . 10 0 . 15 0 . 90 0 . 10 0 . 95 + 0 . 10 0 . 90 0 . 15 = 7 . 7879
(26)

## Exercise 12

Martha is wondering if she will get a five percent annual raise at the end of the fiscal year. She understands this is more likely if the company's net profits increase by ten percent or more. These will be influenced by company sales volume. Let

• H=H= the event she will get the raise
• S=S= the event company profits increase by ten percent or more
• E=E= the event sales volume is up by fifteen percent or more

Since the prospect of a raise depends upon profits, not directly on sales, she supposes {H,E} ci |S{H,E} ci |S and {H,E} ci |Sc{H,E} ci |Sc. She thinks the prior odds favoring suitable profit increase is about three to one. Also, it seems reasonable to suppose

P ( H | S ) = 0 . 80 P ( H | S c ) = 0 . 10 P ( E | S ) = 0 . 95 P ( E | S c ) = 0 . 10 P ( H | S ) = 0 . 80 P ( H | S c ) = 0 . 10 P ( E | S ) = 0 . 95 P ( E | S c ) = 0 . 10
(27)

End of the year records show that sales increased by eighteen percent. What is the probability Martha will get her raise?

### Solution

P ( H | E ) P ( H c | E ) = P ( S ) P ( H | S ) P ( E | S ) + P ( S c ) P ( H | S c ) P ( E | S c ) P ( S ) P ( H c | S ) P ( E | S ) + P ( S c ) P ( H c | S c ) P ( E | S c ) P ( H | E ) P ( H c | E ) = P ( S ) P ( H | S ) P ( E | S ) + P ( S c ) P ( H | S c ) P ( E | S c ) P ( S ) P ( H c | S ) P ( E | S ) + P ( S c ) P ( H c | S c ) P ( E | S c )
(28)
= 0 . 75 0 . 80 0 . 95 + 0 . 25 0 . 10 0 . 10 0 . 75 0 . 20 0 . 95 + 0 . 25 0 . 90 0 . 10 = 3 . 4697 = 0 . 75 0 . 80 0 . 95 + 0 . 25 0 . 10 0 . 10 0 . 75 0 . 20 0 . 95 + 0 . 25 0 . 90 0 . 10 = 3 . 4697
(29)

## Exercise 13

A physician thinks the odds are about 2 to 1 that a patient has a certain disease. He seeks the “independent” advice of three specialists. Let H be the event the disease is present, and A,B,CA,B,C be the events the respective consultants agree this is the case. The physician decides to go with the majority. Since the advisers act in an operationally independent manner, it seems reasonable to suppose {A,B,C} ci |H{A,B,C} ci |H and ci |Hc ci |Hc. Experience indicates

P ( A | H ) = 0 . 8 , P ( B | H ) = 0 . 7 , P ( C | H ) = 0 . 75 P ( A | H ) = 0 . 8 , P ( B | H ) = 0 . 7 , P ( C | H ) = 0 . 75
(30)
P ( A c | H c ) = 0 . 85 , P ( B c | H c ) = 0 . 8 , P ( C c | H c ) = 0 . 7 P ( A c | H c ) = 0 . 85 , P ( B c | H c ) = 0 . 8 , P ( C c | H c ) = 0 . 7
(31)

What is the probability of the right decision (i.e., he treats the disease if two or more think it is present, and does not if two or more think the disease is not present)?

### Solution

PH = 0.01*[80 70 75];
PHc = 0.01*[85 80 70];
pH = 2/3;
P  = ckn(PH,2)*pH + ckn(PHc,2)*(1 - pH)
P =  0.8577


## Exercise 14

A software company has developed a new computer game designed to appeal to teenagers and young adults. It is felt that there is good probability it will appeal to college students, and that if it appeals to college students it will appeal to a general youth market. To check the likelihood of appeal to college students, it is decided to test first by a sales campaign at Rice and University of Texas, Austin. The following analysis of the situation is made.

• H=H= the event the sales to the general market will be good
• S=S= the event the game appeals to college students
• E1=E1= the event the sales are good at Rice
• E2=E2= the event the sales are good at UT, Austin

Since the tests are for the reception are at two separate universities and are operationally independent, it seems reasonable to assume {H,E1,E2} ci |S{H,E1,E2} ci |S and {H,E1,E2} ci |Sc{H,E1,E2} ci |Sc. Because of its previous experience in game sales, the managers think P(S)=0.80P(S)=0.80. Also, experience suggests

 P ( H | S ) = 0 . 95 P ( H | S ) = 0 . 95 P ( E 1 | S ) = 0 . 90 P ( E 1 | S ) = 0 . 90 P ( E 2 | S ) = 0 . 95 P ( E 2 | S ) = 0 . 95 P ( H | S c ) = 0 . 30 P ( H | S c ) = 0 . 30 P ( E 1 | S c ) = 0 . 20 P ( E 1 | S c ) = 0 . 20 P ( E 2 | S c ) = 0 . 25 P ( E 2 | S c ) = 0 . 25

Determine the posterior odds favoring H if sales results are satisfactory at both schools.

### Solution

P ( H | E 1 E 2 ) P ( H c | E 1 E 2 ) = P ( H E 1 E 2 S ) + P ( H E 1 E 2 S c ) P ( H c E 1 E 2 S ) + P ( H c E 1 E 2 S c ) P ( H | E 1 E 2 ) P ( H c | E 1 E 2 ) = P ( H E 1 E 2 S ) + P ( H E 1 E 2 S c ) P ( H c E 1 E 2 S ) + P ( H c E 1 E 2 S c )
(32)
= P ( S ) P ( H | S ) P ( E 1 | S ) P ( E 2 | S ) + P ( S c ) P ( H | S c ) P ( E 1 | S c ) P ( E 2 | S c ) P ( S ) P ( H c | S ) P ( E 1 | S ) P ( E 2 | S ) + P ( S c ) P ( H c | S c ) P ( E 1 | S c ) P ( E 2 | S c ) = P ( S ) P ( H | S ) P ( E 1 | S ) P ( E 2 | S ) + P ( S c ) P ( H | S c ) P ( E 1 | S c ) P ( E 2 | S c ) P ( S ) P ( H c | S ) P ( E 1 | S ) P ( E 2 | S ) + P ( S c ) P ( H c | S c ) P ( E 1 | S c ) P ( E 2 | S c )
(33)
= 0 . 80 0 . 95 0 . 90 0 . 95 + 0 . 20 0 . 30 0 . 20 0 . 25 0 . 80 0 . 05 0 . 90 0 . 95 + 0 . 20 0 . 70 0 . 20 0 . 25 = 15 . 8447 = 0 . 80 0 . 95 0 . 90 0 . 95 + 0 . 20 0 . 30 0 . 20 0 . 25 0 . 80 0 . 05 0 . 90 0 . 95 + 0 . 20 0 . 70 0 . 20 0 . 25 = 15 . 8447
(34)

## Exercise 15

In a region in the Gulf Coast area, oil deposits are highly likely to be associated with underground salt domes. If H is the event that an oil deposit is present in an area, and S is the event of a salt dome in the area, experience indicates P(S|H)=0.9P(S|H)=0.9 and P(S|Hc)=0.1P(S|Hc)=0.1. Company executives believe the odds favoring oil in the area is at least 1 in 10. It decides to conduct two independent geophysical surveys for the presence of a salt dome. Let E1,E2E1,E2 be the events the surveys indicate a salt dome. Because the surveys are tests for the geological structure, not the presence of oil, and the tests are carried out in an operationally independent manner, it seems reasonable to assume {H,E1,E2} ci |S{H,E1,E2} ci |S and ci |Sc ci |Sc. Data on the reliability of the surveys yield the following probabilities

P ( E 1 | S ) = 0 . 95 P ( E 1 | S c ) = 0 . 05 P ( E 2 | S ) = 0 . 90 P ( E 2 | S c ) = 0 . 10 P ( E 1 | S ) = 0 . 95 P ( E 1 | S c ) = 0 . 05 P ( E 2 | S ) = 0 . 90 P ( E 2 | S c ) = 0 . 10
(35)

Determine the posterior odds P(H|E1E2)P(Hc|E1E2)P(H|E1E2)P(Hc|E1E2). Should the well be drilled?

### Solution

P ( H | E 1 E 2 ) P ( H c | E 1 E 2 ) = P ( H E 1 E 2 S ) + P ( H E 1 E 2 S c ) P ( H c E 1 E 2 S ) + P ( H c E 1 E 2 S c ) P ( H | E 1 E 2 ) P ( H c | E 1 E 2 ) = P ( H E 1 E 2 S ) + P ( H E 1 E 2 S c ) P ( H c E 1 E 2 S ) + P ( H c E 1 E 2 S c )
(36)
P ( H E 1 E 2 S ) = P ( H ) P ( S | H ) P ( E 1 | S H ) P ( E 2 | S H E 1 ) = P ( H ) P ( S | H ) P ( E 1 | S ) P ( E 2 | S ) P ( H E 1 E 2 S ) = P ( H ) P ( S | H ) P ( E 1 | S H ) P ( E 2 | S H E 1 ) = P ( H ) P ( S | H ) P ( E 1 | S ) P ( E 2 | S )
(37)

with similar expressions for the other terms.

P ( H | E 1 E 2 ) P ( H c | E 1 E 2 ) = 1 10 0 . 9 0 . 95 0 . 90 + 0 . 10 0 . 05 0 . 10 0 . 1 0 . 95 0 . 90 + 0 . 90 0 . 05 0 . 10 = 0 . 8556 P ( H | E 1 E 2 ) P ( H c | E 1 E 2 ) = 1 10 0 . 9 0 . 95 0 . 90 + 0 . 10 0 . 05 0 . 10 0 . 1 0 . 95 0 . 90 + 0 . 90 0 . 05 0 . 10 = 0 . 8556
(38)

## Exercise 16

A sample of 150 subjects is taken from a population which has two subgroups. The subgroup membership of each subject in the sample is known. Each individual is asked a battery of ten questions designed to be independent, in the sense that the answer to any one is not affected by the answer to any other. The subjects answer independently. Data on the results are summarized in the following table:

 GROUP 1 (84 members) GROUP 2 (66 members) Q Yes No Unc Yes No Unc 1 51 26 7 27 34 5 2 42 32 10 19 43 4 3 19 54 11 39 22 5 4 24 53 7 38 19 9 5 27 52 5 28 33 5 6 49 19 16 19 41 6 7 16 59 9 37 21 8 8 47 32 5 19 42 5 9 55 17 12 27 33 6 10 24 53 7 39 21 6

Assume the data represent the general population consisting of these two groups, so that the data may be used to calculate probabilities and conditional probabilities.

Several persons are interviewed. The result of each interview is a “profile” of answers to the questions. The goal is to classify the person in one of the two subgroups

For the following profiles, classify each individual in one of the subgroups

1. y, n, y, n, y, u, n, u, y. u
2. n, n, u, n, y, y, u, n, n, y
3. y, y, n, y, u, u, n, n, y, y

### Solution

% file npr05_16.m
% Data for Exercise 16
A = [51 26  7; 42 32 10; 19 54 11; 24 53  7; 27 52  5;
49 19 16; 16 59  9; 47 32  5; 55 17 12; 24 53  7];
B = [27 34  5; 19 43  4; 39 22  5; 38 19  9; 28 33  5;
19 41  6; 37 21  8; 19 42  5; 27 33  6; 39 21  6];
disp('Call for oddsdf')
npr05_16
Call for oddsdf
oddsdf
Enter matrix A of frequencies for calibration group 1  A
Enter matrix B of frequencies for calibration group 2  B
Number of questions = 10
Enter code for answers and call for procedure "odds"
y = 1;
n = 2;
u = 3;
odds
Enter profile matrix E  [y n y n y u n u y u]
Odds favoring Group 1:   3.743
Classify in Group 1
odds
Enter profile matrix E  [n n u n y y u n n y]
Odds favoring Group 1:   0.2693
Classify in Group 2
odds
Enter profile matrix E  [y y n y u u n n y y]
Odds favoring Group 1:   5.286
Classify in Group 1


## Exercise 17

The data of Exercise 16, above, are converted to conditional probabilities and probabilities, as follows (probabilities are rounded to two decimal places).

 GROUP 1 P(G1)=0.56P(G1)=0.56 GROUP 2 P(G2)=0.44P(G2)=0.44 Q Yes No Unc Yes No Unc 1 0.61 0.31 0.08 0.41 0.51 0.08 2 0.50 0.38 0.12 0.29 0.65 0.06 3 0.23 0.64 0.13 0.59 0.33 0.08 4 0.29 0.63 0.08 0.57 0.29 0.14 5 0.32 0.62 0.06 0.42 0.50 0.08 6 0.58 0.23 0.19 0.29 0.62 0.09 7 0.19 0.70 0.11 0.56 0.32 0.12 8 0.56 0.38 0.06 0.29 0.63 0.08 9 0.65 0.20 0.15 0.41 0.50 0.09 10 0.29 0.63 0.08 0.59 0.32 0.09

For the following profiles classify each individual in one of the subgroups.

1. y, n, y, n, y, u, n, u, y, u
2. n, n, u, n, y, y, u, n, n, y
3. y, y, n, y, u, u, n, n, y, y

### Solution

npr05_17
% file npr05_17.m
% Data for Exercise 17
PG1 = 84/150;
PG2 = 66/125;
A = [0.61 0.31 0.08
0.50 0.38 0.12
0.23 0.64 0.13
0.29 0.63 0.08
0.32 0.62 0.06
0.58 0.23 0.19
0.19 0.70 0.11
0.56 0.38 0.06
0.65 0.20 0.15
0.29 0.63 0.08];

B = [0.41 0.51 0.08
0.29 0.65 0.06
0.59 0.33 0.08
0.57 0.29 0.14
0.42 0.50 0.08
0.29 0.62 0.09
0.56 0.32 0.12
0.29 0.64 0.08
0.41 0.50 0.09
0.59 0.32 0.09];
disp('Call for oddsdp')
Call for oddsdp
oddsdp
Enter matrix A of conditional probabilities for Group 1  A
Enter matrix B of conditional probabilities for Group 2  B
Probability p1 an individual is from Group 1  PG1
Number of questions = 10
Enter code for answers and call for procedure "odds"
y = 1;
n = 2;
u = 3;
odds
Enter profile matrix E  [y n y n y u n u y u]
Odds favoring Group 1:   3.486
Classify in Group 1
odds
Enter profile matrix E  [n n u n y y u n n y]
Odds favoring Group 1:   0.2603
Classify in Group 2
odds
Enter profile matrix E  [y y n y u u n n y y]
Odds favoring Group 1:   5.162
Classify in Group 1


## Content actions

PDF | EPUB (?)

### What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

PDF | EPUB (?)

### What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

#### Collection to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks

#### Module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks