[Mathematical concepts] Bayes' theorem

A class, there are 50 students, 30 were women and 20 man-boys. 20-year-old total of 35 people, 20-year-old girl 25 people.
Event X: girls.
Event Y: is 20 years old.

Pick one student, the probability girls:
\ [P (X-) = \ FRAC {30} {50} = 0.6 \ Tag. 1} {\]

Pick one student, 20 years old probability is:
\ [P (the Y) = \ FRAC {35} {50} = 0.7 \ Tag {2} \]

Pick one student, the probability of 20-year-old girl:
\ [P (the XY) = \ FRAC {25} {50} = 0.5 \ Tag. 3} {\]

Just pick a female student, 20-year-old whose probability is:

\[ p(Y|X) = \frac{p(XY)}{p(X)} = \frac{0.5}{0.6}=0.833 = \frac{25}{30} \tag{4} \]

Just pick a 20-year-old student, whose probability for girls:

\[ p(X|Y) = \frac{p(XY)}{p(Y)} = \frac{0.5}{0.7}=0.714 = \frac{25}{35} \tag{5} \]

Bayes' theorem:

\[ p(X|Y)=\frac{p(X)p(Y|X)}{p(Y)} \tag{6} \]

Values ​​derived:

\[ p(X|Y) = \frac{p(X)p(Y|X)}{p(Y)} = \frac{0.6 \times 0.833}{0.7} = 0.714 \tag{7} \]

Equation 7 and Equation 5 is the same as the calculation result proved the correctness of the formula 6.

Guess you like

Origin www.cnblogs.com/woodyh5/p/11972626.html