# Help with conditional probabilty

1. Sep 14, 2009

### BlueScreenOD

I've been struggling for a good couple hours on the below, and I was hoping someone might be able to push me in the right direction...

"A" represents the event "the breath analyzer indicates the suspect is drunk" and "B" represents the event "the suspect is drunk." On a given Saturday night, about 5% of drivers are known to be drunk.

P(A | B) = P(compliment of A | complement of B) = p

a.) determine P(compliment of B | A) if p = .95
b.) how big should p be so that P(B | A) = 0.9?

---

From the problem I can deduce that P(B) is .05 and P(compliment of A | B) = (A | compliment of B) = .05, but how can I put P(compliment of B | A) in terms of P(A | B)? Any help would be greatly appreciated.

2. Sep 14, 2009

### Mapes

Hi BlueScreenOD, welcome to PF. Are you familiar with Bayes' Theorem?

(And it's "complement" )

3. Sep 14, 2009

### BlueScreenOD

This is what I have so far, could be kind enough to tell me if this looks right? I'll use ^ for the intersection operator.

P(A | B) = 1 - P(A | complement B)
because P(complement A | complement B) = 1 - P(A | complement B)
P(A ^ B) / P(B) = 1 - P(A ^ complement B)
because P(A | B) = P(A ^ B) P(B)
P(A ^ B) / .05 + P(A ^ complement B) / .95 = 1
19 * P(A ^ B) + P (A ^ complement B) = .95
P(A ^ B) + P (A ^ complement B) = .95 - 18 * P(A ^ B)
P(A) = .95 - 18 * P(A ^ B)
because (A ^ B) + P (A ^ complement B) is P(A)
P(A) = .95 - 18 * [P(A | B) * P(B)]
P(A) = 0.095

The value strikes me as high, though.... am i screwing something up?

4. Sep 14, 2009

### Mapes

Nope, looks good. The breathalyzer comes up positive nearly all the time for the 5% drunk people, and 5% for the general population. So it comes up positive about 10% of the time.

Note, though, that P(A) = P(A|B)P(B) + P(A|notB)P(notB), so you can get to this result a bit easier.

5. Sep 14, 2009

### BlueScreenOD

Wow, that's a much simpler calculation. Thanks for your help!

6. Sep 14, 2009

### Elucidus

I've done the work for the two questions and I'm getting different values than in earlier posts.

Note for reference that P(A|B) is the sensitivity of the test and P(A'|B') is the specificity of the test, both of which are frequently thought of as measures of accuracy. P(B|A) is the positive predictive value and P(B'|A') is the negative predictive value.

If one creates a tree diagram with initial branches to B and B' (the complement of B) and then from each of those, branches to A and A' we get four terminals and probabilities:

P(BA) = 0.05p
P(BA') = 0.05(1 - p)
P(B'A) = 0.95(1 - p)
P(B'A') = 0.95p

This gives

P(A) = 0.05p + 0.95(1 - p) = 0.95 - 0.9p
P(A') = 0.05(1 - p) + 0.95p = 0.05 + 0.9p

Q1) Find P(B'|A) if p = 0.95

P(B'|A) = P(B'A)/P(A) = (0.95 - 0.95p)/(0.95 - 0.9p)

When p = 0.95 this equals 0.5. This says that the likelihood that a person with a positve breathalyzer test actually being drunk is 50%, assuming an accuracy of 95%.

Q2) Find p if P(B|A) = 0.9.

P(B|A) = P(BA)/P(A) = (0.05p)/(0.95 - 0.9p)

Solving this against 0.9 gives p = 0.994186...

So in order for the test to have a positive predictive value of at least 90%, the accuracy of the test needs to be at least 99.4% accurate.

In general when the rate of incidence of a particular condition is low, tests need to be very accurate in order to have high positive predictive value.

--Elucidus

7. Sep 15, 2009

### Mapes

Your P(A) is 0.095, which is the same as BlueScreenOD got and was as far as BlueScreenOD got. It's more helpful if you help the poster figure out the homework problem rather than just posting the answer.

8. Sep 15, 2009

### Elucidus

When I first read through BlueScreenOD's attempt, I thought I saw errors - which would lead to erroneous answers. (BlueScreenOD's value for P(A) is correct for part 1 as you say - I missed that.)

In general P(A|B) does not equal 1 - P(A|B'), but as it turns out, for this particular situation it does since the sensitivity and specificity are equal. Some of the other equations are also generally false. This is what lead me to reexamine the problem.

I also thought that a full solution had been attempted and was in error (which is not the case). I did not intend to spoil the opportunity and I apologize (at 11:30pm I probably wasn't as sharp as I should've been :)

As a final helpful hint though: these problems are often be easily solved with a tree diagram, but Bayes' Rule works as well.

--Elucidus

9. Sep 15, 2009

### BlueScreenOD

I ended up with the same answers. Thank you both for your help!

I haven't learned that technique yet, but I'll have to look into it.