When completing practice problems for Bayes Theorem, I came across this question:
A diagnostic test has a probability 0.95 of giving a positive result when applied to a person suffering from a certain disease, and a probability 0.10 of giving a (false) positive when applied to a non-sufferer. It is estimated that 0.5 % of the population are sufferers. Suppose that the test is now administered to a person about whom we have no relevant information relating to the disease (apart from the fact that he/she comes from this population).
Calculate the probability that the test result will be positive
The solution was:
If T = Test positive and S = Sufferer, then P(T) = P(T|S)P(S) + P(T|S')P(S')
While this answer makes sense to me, I thought that the answer would be P(T) = P(T|S) + P(T|S'), as this way you would also get P(T) for all patients, those who are suffering and those who are not.
I can't understand the difference between P(T) = P(T|S)P(S) + P(T|S')P(S') and my answer, P(T) = P(T|S) + P(T|S')
There is a difference between $P(T \cap S)$ and $P(T| S) = \frac{P(T \cap S)}{P(S)}$.
We have \begin{align} P(T) &= P(T \cap S) + P(T \cap S') \\ &= \frac{P(T\cap S)}{P(S)}\cdot P(S) + \frac{P(T\cap S')}{P(S')}\cdot P(S')\\ &=P(T|S)P(S) + P(T|S')P(S') \end{align}