Bayes' Theorem, Posterior Probability

Click to open the link from Baidu Encyclopedia

Suppose a school has 60% boys and 40% girls. The number of girls wearing trousers is equal to the number of wearing skirts, and all boys wearing trousers. A person randomly saw a student in pants in the distance. So what is the probability that this student is a girl?
Using Bayes' theorem , event A is seeing a girl and event B is seeing a student in pants. What we want to calculate is P(A|B).
P(A) is the probability of ignoring other factors and seeing a girl, here is 40%
P(A') is the probability of ignoring other factors and seeing that it is not a girl (that is, seeing a boy), here is 60%
P(B|A) is the probability that a girl wears pants, here it is 50%
P(B|A') is the probability that a boy wears pants, which is 100% here
P(B) is the probability of students wearing pants, ignoring other factors, P( B ) = P( B | A )P( A ) + P( B | A ')P( A '), here is 0.5×0.4 + 1 × 0.6 = 0.8.
According to Bayes' theorem, we calculate the posterior probability P(A|B)
P(A|B)=P(B|A)*P(A)/P(B)=0.25
It can be seen that the posterior probability is actually the conditional probability

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326218961&siteId=291194637