Bayes' Theorem¶
Conditional probability describes the likelihood of an event occurring given that another event has already occurred. Bayes Theorem is the "inverse" of this relationship, allowing us to update the probability of an event based on new evidence.
By substituting \(P(A)\) from the laws of total probability, the equation becomes :
I took examples from this blog.
Given information :
- Total people: 100
- Men: 40
- Not men: 60
- Men who wear pink: 5
- Men who do not wear pink: 35
- Not men who wear pink: 20
- Not men who do not wear pink: 40
Thus, the probability of a person being a man is \(P(\text{man}) = \frac{40}{100} = 0.4\) and the probability of a person wearing pink is \(P(\text{pink}) = \frac{25}{100} = 0.25\). To calculate the conditional probability that a man wears pink, note that \(P(\text{man} \cap \text{pink}) \neq P(\text{man}) \times P(\text{text})\) because the events are not independent event. Then,
Bayes' theorem provides the "inverse" of the conditional probability \(P(A|B)\), allowing us to find \(P(B|A)\). In this case, \(P(\text{man}|\text{pink})\) represents the probability that a person who wears pink is a man: