Very basic confusion about probability and Bayes theorem

70 Views Asked by At

I have this (very trivial but very insidious) doubt about probability. Suppose I have two categories A and B, whose individuals can have two properties, P and Q. Consider the following table:

  A  B
P 2  5
Q 12 15

This table tells us, for example, that 2 individuals in A have property P. Now the question is: what is the probability that an individual from group A has property P?

My doubt is: do I have to use a Bayes theorem

$Pr(P|A) = \frac{Pr(A|P)Pr(P)}{Pr(A)}$

or the basic definition of probability

$P(P|A) = \frac{2}{2+12}$

Thank you for helping.

2

There are 2 best solutions below

1
On BEST ANSWER

Either is fine. Note that Bayes' Theorem would give $$\frac{\frac 2 7 \cdot \frac{7}{34}}{\frac {14}{34}} = \frac{2}{14}$$ just like your other answer. (Personally, I think your second solution is much simpler, but it should be comforting that the two methods agree.)

0
On

The result is right: $P(P|A)=\frac2{14}$. But you used the frequencies $n(X)$ rather than the probabilities, which is right as well.

The Bayes theorem with frequencies is

$$Pr(P|A)=\frac{n(A|P)\cdot n(P)}{n(A)}=\frac{n(P\cap A)}{n(A)}=\frac{n(P\cap A)}{n(P \cap A)+n(Q \cap A)}=\frac{2}{2+12}$$

with your contingency table

\begin{array}{c|c|c} & A&B&\sum \\ \hline P & n(P \cap A)&n(P \cap B)& n(P)\\ \hline Q&n(Q \cap A)&n(Q \cap B)&n(Q) \\ \hline \sum&n(A) &n(B)& N\\ \end{array}

$n(X)$ are the frequencies of event $X$ and $N$ is the total number of frequencies.