If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content
Current time:0:00Total duration:10:44

Conditional probability tree diagram example

AP.STATS:
VAR‑4 (EU)
,
VAR‑4.D (LO)
,
VAR‑4.D.1 (EK)
,
VAR‑4.D.2 (EK)

Video transcript

accompany screens job applicants for illegal drug use at a certain stage in their hiring process the specific test they use has a false positive rate of 2% and a false negative rate of 1% suppose that 5% of all their applicants are actually using illegal drugs and we randomly select an applicant given the applicant test positive what is the probability that they are actually on drugs so let's work through this together so first let's make sure we understand what they're telling us so there is this drug test for the job applicants and then the test has a false positive rate of 2% what does that mean that means that in 2% of the cases when it should have read negative that the person didn't do the drugs it actually read positive it is a false positive it should have read negative but it read positive another way to think about it if someone did not do drugs and you take this test there's a 2% chance saying that you did do the illegal drugs they also say that there is a false negative rate of 1% what does that mean that means that 1% of the time if someone did actually take the illegal drugs it'll say that they didn't it is falsely giving a negative result when it should have given a positive one and then they say that 5% of all their applicants are actually using illegal drugs so there's several ways that we can think about it one of the easiest ways to conceptualize is just let's just make up a large number of applicants and I'll use a numbers where it's fairly straightforward to do the mathematics so let's say that we start off with 10,000 applicants and so I will both talk in absolute numbers and I just made this umber up it could have been 1,000 it could have been a hundred thousand but I like this number because it's easy to do the math that have been saying nine thousand seven hundred and eighty-five and so this is also going to be one hundred percent of the applicants now they give us some crucial information here they tell us that 5% of all their applicants are actually using illegal drugs so we can immediately break this 10,000 group into the ones that are doing the drugs and the ones that are not so 5% are actually on the drugs 95% are not on the drugs so what 5% of 10,000 so that would be 500 so 500 on drugs on drugs and so once again this is 5% of our original population and then how many are not on drugs well 9,500 not not on drugs and once again this is 95 percent of our group of applicants so now let's administer the test so what is going to happen when we administer the test to the people who are on drugs well the test ideally would give a positive result it would say positive for all of them but we know that it's not a perfect test it's going to give negative for some of them it will falsely give a negative result for some of them and we know that because it has a false negative rate of 1% and so of these 500 99% is going to get the correct result in that they're going to test positive so what is 99 percent of 500 let's see that would be 495 495 are going to test positive I will just use a positive right over there and then we're going to have 5 1% 1% which is 5 are going to test negative they are going to falsely test negative this is the false negative rate and so if we say what percent of our original applicant pool is on drugs and tests positive well 495 over 10,000 this is four point nine five percent what percent is of the original applicant pool that is on drugs but tests negative for drugs it's it the test says inane they're not taking drugs well this is going to be five out of ten thousand which is 0.05 percent another way that you could get these percentages if you take five percent and multiply by one percent you're going to get 0.05 percent five hundredths of a percent if you take five percent and multiply by 99% you're going to get four point nine five percent now let's keep going now let's go to the folks who aren't taking the drugs and this is where the false positive rate is going to come into effect so we have a false positive rate of two percent so two percent are going to test positive what's two percent of ninety five hundred it's one hundred and ninety would test positive even though they're not on drugs this is the false positive rate so they are testing positive and then the other 98 percent will correctly come out negative and so the other 98 percent so ninety five hundred minus 190 that's going to be nine thousand three hundred and ten will correctly test negative now what percent of the original applicant pool is this well 190 is one point nine percent and we could calculate it by 190 over 10,000 or you could just say two percent of ninety five percent is one point nine percent once again multiply the path along the tree what percent is nine thousand three hundred and ten well that is going to be ninety 3.10% you could say this is nine thousand three hundred ten over ten thousand or you can multiply by the path on our probability tree here ninety five percent times ninety eight percent gets us to ninety three point ten percent but now I think we are ready to answer the question given that the applicant tests positive what is the probability that they are actually on drugs so let's look at the first part given the applicant test positive so which applicants actually tested positive you have these 495 here tested positive correctly tested positive and then you have these 190 right over here incorrectly tested positive what they did test positive so how many tested positive well we have 495 Plus 190 tested positive that's the total number that tested positive and then which of them were actually on the drugs well of the ones that tested positive 495 were actually on the drugs we have 495 divided by 495 + 190 is equal to 0.7 - 2 6 so we could say approximately 72% approximately 72% now this is really interesting given the applicant test positive what is the probability that they are actually on drugs when you look at these false positive and false negative rates they seem quite low but now when you actually did the calculation the probability that someone's actually on drugs is it's high but it's not that high it's not like if someone were to test positive that you say oh they are definitely taking the drugs and you could also get to this result just by using the percentages for example you could think in terms of what percentage of the original applicants end up testing positive well that's four point nine five percent plus one point nine percent four point nine five and we'll just do it in terms of percent plus one point nine percent and of them what percentage were actually on the drugs well that was the four point nine five percent and notice this would give you the exact same result now there's an interesting takeaway here because this is saying of the people that test positive 72 percent are actually on the drugs you could think about it the other way around of the people who test positive for 95 plus 190 what percentage aren't on drugs well that was 190 and this comes out to be approximately 28% 100% minus 72% and so if we were in a court of law and let's say the prosecuting attorney let's say I got tested positive for drugs and the prosecuting attorney says look this this test is very good it only has a false positive rate of 2% Sal and Sal tested positive he is probably taking drugs a jury who doesn't really understand this well or go through the trouble that we just did might say oh yeah Sal probably took the drugs but when we look at this even if I test positive using this test there's a twenty eight percent chance that I'm not taking drugs that I was just in this false positive group and the reason why this number is a good bit larger than this number is because when we looked at the original division between those who take drugs and don't take drugs most don't take the illegal drugs and so two percent of this larger group of the ones that don't take the drugs well this is actually a fairly large number relative to the percentage that do take the drugs and test positive so I will leave you there this is fascinating not just for this particular case but you will see analysis like this all the time when we're looking at whether a certain medication is effective or a certain procedure is effective it's important to be able to do this analysis
AP® is a registered trademark of the College Board, which has not reviewed this resource.