Bayes theorem and conditional probability example.

547 views

Greetings to all.
I started an MSc that includes a course in statistics. Full disclosure: my bachelor’s had no courses of statics and it is in biology.

So, the professor was trying to explain the Bayes theorem and conditional probability through the following example.
“A friend of yours invites you over. He says he has 2 children. When you go over, a child opens the door for you and it is a boy. What is the probability that the other child is a boy as well.”

The math say the probability the other child is a boy is increased the moment we learn that one of the kids is a boy. Which i cannot wrap my head around, assuming that each birth is a separate event (the fact that a boy was born does not affect the result of the other birth), and the result of each birth can be a boy or a girl with 50/50 chance.
I get that “math says so” but… Could someone please explain? thank you

In: 77

24 Answers

Anonymous 0 Comments

The example you give is difficult to understand because the language makes it ambiguous what is being asked.

Imagine two classrooms, A and B. Both have men and women attending class. Let’s say that there’s the same number of people in both classes, so if you picked as student at random there’s an equal chance that they came from room A or B (P(A) = P(B) = ½).

The classes differ in the fraction of the class that are women. Let’s says class A is ⅔ female, or in other words the probability that a person is female given that they are in class A (P(F|A)) is ⅔. In class B, women make up ½ the class, or the probability of a person being female given that they are from class B (P(F|B)) is ½.

If we know these facts, can we answer the question: if I selected a random student from the two classes, what’s the probability that they are from class A if the selected student were female (P(A|F)).

Bayes’ Rule tells us

P(A|F) = P(F|A) x P(A) / [P(F|A) x P(A) + P(F|B) x P(B)]

since we said that there’s the same number of students in each room, the P(A) and P(B) terms cancel out:

P(A|F) = P(F|A) / [P(F|A) + P(F|B)] = ⅔ / [⅔ + ½] = 4/7

… a bit more than half. Fair enough, there’s more women in room A than room B, right? Intuitively, you’ve you got two possibilities: the woman is from class A or class B, and we know there’s more women in A than in B.

As a matter of fact, if we multiplied the fraction of class that’s female by the size of the class, we get the number of women. Let’s just say the size of each class is 12 students: ⅔ of a class of 12 is 8. ½ of a class of 12 is 6. There are 14 women out of 24 students.

So, let’s use the actual count of students rather than the probabilities: P(F|A) -> 8 women, P(F|B) -> 6 women

P(A|F) = 8 / [8+6] = 8/14 … The chance that a woman is from class A is 8/14 because there are 8 women in class A out of a total of 14 across all the classes.

The reason for the P(A) and P(B) in Bayes’ formula is to weight the probabilities in case class A and class B are different sizes. It can also be extended to more class rooms by adding (P(F|…) x P(…)) in the denominator.

The probability of something, given a certain condition, is equal to the frequency of the condition divided by the sum of all the possibilities.

You are viewing 1 out of 24 answers, click here to view all answers.