# Different ways to calculate conditional probability of independent events

Say we have TWO tests for cancer. Each test has the same probabilities of being right/wrong for cancer/no cancer. What is the probability of getting two positive test results?

In what follows, I'll use C for "has cancer", "+" for a positive test result, "++" for two positives (I don't distinguish between the tests because they have the same probabilities).

### A. Use the formula for total probability:

P(++) = P(++|C) $\times$ P(C) $+$ P(++|$\neg$C) $\times$ P($\neg$C)

### Since each test is independent of the other, apply the formula for joint probability:

= P(+|C)$^2$ $\times$ P(C) $+$ P(+|$\neg$C)$^2$ $\times$ P($\neg$C)

### B. Since each test is independent of the other one, the joint probability is the product of the probability of each (which is the same):

P(++) = P(+)$^2$

### Then, apply the formula for total probability to each:

= [P(+|C) $\times$ P(C) $+$ P(+|$\neg$C) $\times$ P($\neg$C)]$^2$

Obviously, the two are not equal. Why not? And which one is correct?

Instead of + and ++, let's generalize this to events $A,B,C$. Your second calculation assumes $P(AB)=P(A)P(B)$, i.e. that $A$ and $B$ are marginally independent, which is in agreement with your assumption (although that assumption would not hold for cancer tests).
Your first calculation, however, assumes $P(AB|C) = P(A|C) P(B|C)$, i.e. that $A$ and $B$ are conditionally independent given $C$. These are NOT the same and in general one does not imply the other. This is easy to see in the Gaussian case: Gaussian r.v.s are independent if and only if their correlation is 0, but they are conditionally independent given another if and only if their partial correlation is 0. Setting up a correlation matrix with some zeros and inverting it to find the partial correlation matrix is a good way to see how these two quantities relate and that they are NOT interchangeable.