# Writing the Conditional probability correctly

I was reading the book statistical rethinking chapter 3. There is the following example:

To repeat the structure of common examples, suppose there is a blood test that correctly detects vampirism 95% of the time.

Writing this in probability notation I would write:
$$P(\text{vampire}|\text{positive test result}) = 0.95$$

But the author writes: $$P\text{(positive test result}|\text{vampire}) = 0.95$$ Am I wrong? Are both of them possible? To me, both appear to be equal intuitively.

UPDATE: The author mentioned this sentence:

To repeat the structure of common examples, suppose there is a blood test that correctly detects vampirism 95% of the time.

How should this sentence be changed, so that the probability notation would be: $$P(\text{vampire}|\text{positive test result}) = 0.95$$

Firstly, in general $$P(A \mid B ) \neq P(B \mid A)$$.

I will note $$V$$ the event for "vampire", $$\bar{V}$$ for "non-vampire" and $$T \in \{0,1\}$$ the result of the blood test.

In your example we need to carefully understand the meaning of

the blood test correctly detects vampirism 95% of the time.

The blood test correctly detects vampirism 95% of the time, that is if you take a vampire, the test will detect that he is a vampire 95% of the time. That is $$P(T=1 \mid V) = 0.95$$.

But what is the meaning of $$P(V \mid T=1)$$?

It's the "frequency" of vampires among the subjects who were declared as such.

Suppose your test is such that $$P(T=1 \mid \bar{V}) = 0$$, i.e. the test is always negative for non-vampires. Then only vampires have a positive blood test and thus $$P(V \mid T=1)=1$$.

But now suppose that $$P(T=1 \mid \bar{V}) = 1$$ i.e. all non-vampires have a positive blood test.

Let $$P(V) = P(\bar{V}) = \frac{1}{2}$$, i.e. there are as much vampires as non-vampires. Thus among those who have a positive blood test you have all non-vampires and 95% of the vampires. Thus the frenquency of vampires among subject who have a positive test is much less than 1.

It is actually

\begin{align*} P( V \mid T=1) &= \frac{P(T=1 \mid V) P(V)}{P(T=1)} \\ &= \frac{0.95 \times 0.5}{\frac{1}{2} + \frac{0.95}{2}} \\ &\approx 0.487 \end{align*}

To conclude, the blood test can correctly detect vampirism 95% of the time, but if there are much more non-vampires and if the test is positive for them with a high probability then the probability of being a vampire knowing the test is positive will be very small. Conversely, $$P(V \mid T=1)$$ can be very high even with $$P(T=1 \mid V)$$ small.

• Thanks for the explanation. You said $P(V|T=1)$ is the frequency of vampires in positive tests. Thus, $P(T=1|V)$ would be the frequency of positive tests among vampires. I have added an update to the question. Could see whether you can answer it? Jul 19, 2019 at 11:38
• It would be something like "there is a test such that 95% of positive subjects are vampires" which does not mean the same as "there is a test such that 95% vampires are positive". Jul 19, 2019 at 12:22