# Two coin toss probability with impossible combinations

How to calculate probability of combinations of not all possible combination is possible?

For example, given a test that determines the gender of a fetus with 90% accuracy. If somebody takes the test twice, and both said "a boy", what is the probability that it's actually a boy? Using naive coin toss calculation, the probability of both test being accurate is 0.9*0.9 = 0.81, but the possibility of both being false is 0.1*0.1 = 0.01, which doesn't add up to 1 because the outcome where only one of the tests is wrong is impossible in this case.

So, how to calculate probability in this case?

-
The question is missing a lot of vital information before it can be made precise and answered. For instance, the probability of both tests being accurate is 0.9*0.9 holds under the assumptions that the accuracy is independent. But this is not clear it should be the case. You will find that many problems with probability disappear once a question is made very very precise. –  Ittay Weiss Nov 25 '12 at 7:36
well, this is a homework question.. don't expect that it will be scientifically formulated? :p –  Borcasy Nov 25 '12 at 8:01
Let $H=$ "the question is homework" and $S=$" the question is scientifically formulated". You claim that $P(S\mid H)\lt P(S)$. Why? –  Did Nov 25 '12 at 8:55

Use conditional probability: $P(A|B) = P(A \& B)/P(B)$. In words: the probability of $A$, given that $B$ is true, is equal to the probability of both $A$ and $B$, divided by the probability of $B$. Here, $A$ is the event that the fetus is a boy and $B$ is the event that both tests predicts a boy. Do you know how to calculate the two probabilities $P(A \& B)$ and $P(B)$? You will need the a priori probability of the fetus being a boy, which you could approximate by 0.5.
That's correct. See mjqxxx's answer for $P(B)$, which appears there as $P[T_1=\text{boy}\wedge T_2=\text{boy}]$. –  TonyK Nov 25 '12 at 9:04
The tests aren't independent, because they both depend on the actual sex of the unborn child. Therefore, the probability that both tests are correct is not simply the square of the probability that a single test is correct. Instead, you need to use Bayes' theorem: $$\begin{eqnarray} P[\text{boy}\;|\;T_{1}=\text{boy}\wedge T_2=\text{boy}]&=&\frac{P[T_1=\text{boy}\wedge T_2=\text{boy} \;|\; \text{boy}]\cdot P[\text{boy}]}{P[T_1=\text{boy}\wedge T_2=\text{boy}]} \\ &=& \frac{0.9^{2}\cdot 0.5}{0.9^{2}\cdot 0.5 + 0.1^{2}\cdot 0.5} =\frac{81}{82}. \end{eqnarray}$$ The analogous calculation for the probability that the child is a girl yields $1/82$, so the two probabilities do add up to $1$.