Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Given the probability of being infected with AIDS is p = 0,3%, what is the probability that a person which has a positive test result, is indeed infected with AIDS?

The probability that an infected person is tested positively is s = 99.5% and the probability that a healthy person has a positive test result is r = 98%.

Also, according to my notes the general formulae would be $\frac{100*(p*s)}{(p*s)+((1-p)*(1-s))}$, is this derived from the formulae of total probability?

share|cite|improve this question

This is an application of Bayes' Theorem.

Let $A$ be the event that one is infected with AIDS, $T$ the event of getting a positive test result. You are given

$$P(A)=0.003$$ $$P(T|A)=0.995$$ $$P(T|\bar{A})=0.98$$

and you seek $P(A|T)$. By Bayes' Theorem:

$$P(A|T) = \frac{P(T|A) P(A)}{P(T|A) P(A) + P(T|\bar{A}) (1-P({A}))}$$

Note that $P(T|\bar{A}) \ne 1-P(T|A)$; rather, it must be given separately. The numerical result is then

$$P(A|T) \approx 0.305 \%$$

Does this make sense? Yes - your numbers indicate an awful, useless test which gives a positive result to nearly everyone who takes the exam.

share|cite|improve this answer
Sort of, after one test you can say that you are a hundred times as likely to have AIDS. Even with a 2% false positive rate you are much much more likely to be in the group of people who falsely tested positive then you are in the tiny population of people who actually have the virus. Even cutting the false positive percentage in half will do little to change that. – kleineg Jun 4 '14 at 20:13
Oh, read that wrong, think the OP did too. – kleineg Jun 4 '14 at 20:14

We will use a formula, but only a very basic one, namely the formula that defines conditional probability. Let $P$ be the event the person tests positive for AIDS, and let $A$ be the event that the person actually has AIDS. We want $\Pr(A|P)$. By the definition of conditional probability, we have $$\Pr(A|P)=\frac{\Pr(A\cap P)}{\Pr(P)}.$$ We need to find the two probabilities on the right.

Let us first tackle the harder one, namely $\Pr(P)$. We can test positive in two disjoint ways: (i) We actually have AIDS, and test positive or (ii) We don't have AIDS, yet test positive.

For (i), the probability we have AIDS is $0.003$. Given we have AIDS, the probability of testing positive is $0.995$. So the probability of (i) is $(0.003)(0.995)$.

For (ii), the probability we don't have AIDS is $0.997$. Given we don't have AIDS, the probability we test positive is $0.02$. Note: Here we are going against the wording of the problem. It says that if we don't have AIDS, the probability we still test positive is $0.98$. This is such a ridiculously implausible figure that surely what is intended is that the probability we test negative is $0.98$.

So, with this reinterpretation of the figures, the probability of (ii) is $(0.997)(0.02)$. Thus $$\Pr(P)=(0.003)(0.995)+(0.997)(0.02).\tag{$1$}$$ We can think of the above expression for $\Pr(P)$ as coming from the law of total probability. However, the formula that you quote is not correct for this problem. There is a general formula. I would prefer not to give it, since figuring out things each time from basics is better for you. You are much more likely to know what's going on, and, very importantly, you are much more likely to get the right answer.

OK, enough preaching. We still need $\Pr(A\cap P)$. But that's already done, it is the probability of (i). We conclude that $$\Pr(A|P)=\frac{(0.003)(0.995)}{(0.003)(0.995)+(0.997)(0.02)}.$$

Again, please remember that we have reinterpreted the given figures as saying that the AIDS test has probability $0.02$ of giving a false positive. The actual wording of the problem, surely wrong, seems to say that the probability of a false positive is $98\%$, a ridiculously implausible number.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.