Introductory Example
Suppose someone told you they had a nice conversation with someone on the train. Not knowing anything else about this conversation, the probability that they were speaking to a woman is 50%. Now suppose they also told you that this person had long hair. It is now more likely they were speaking to a woman, since most long-haired people are women. Bayes' theorem can be used to calculate the probability that the person is a woman.
To see how this is done, let
- represent the event that the conversation was held with a woman, and
- denote the event that the conversation was held with a long-haired person.
It can be assumed that women constitute half the population for this example. So, not knowing anything else, the probability that occurs is
Suppose it is also known that 75% of women have long hair, which we denote as
(read: the probability of event given event is 0.75).
Likewise, suppose it is known that 30% of men have long hair, or
- ,
where is the complementary event of, i.e., the event that the conversation was held with a man (assuming that every human is either a man or a woman).
Our goal is to calculate the probability that the conversation was held with a woman, given the fact that the person had long hair, or, in our notation, . Using the formula for Bayes' theorem, we have:
where we have used the law of total probability. The numeric answer can be obtained by substituting the above values into this formula. This yields
i.e., the probability that the conversation was held with a woman, given that the person had long hair, is about 71%.
Read more about this topic: Bayes' Theorem