A little math problem 1 comment
I was catching up on a developer blog this morning when I came across a post about probability of girls and boys. The problem that was asked is:
Let’s say, hypothetically speaking, you met someone who told you they had two children, and one of them is a girl. What are the odds that person has a boy and a girl?
The correct answer is 2/3 but initially I fell into the trap of thinking it was 1/2. I want to clarify why this is the case in an attempt to convince my own brain why it was wrong.
The explanation and comments over on Coding Horror say a lot of things but what I’m going to do is explain how I convinced myself of the correct answer.
—–
Let’s start some basic probability.
The probability of a mother giving birth to a girl is 1/2, and the probability of a boy is 1/2.
The probability of a mother giving birth to a girl and then a girl is 1/2 * 1/2 = 1/4.
The probability of a mother having two children of the same sex is 1/4 (two girls) + 1/4 (two boys) = 1/2.
—–
Now let’s think about the question.
The mother can give birth to two children in 4 different ways, BB, BG, GB, GG (B = Boy, G = Girl).
We’ve been given the information that one of the children is a girl. Three of the states where at least one of the children is a girl and two of those also contain a boy. Hence we can say the probability of the other child being a boy is 2/3.
At least that’s how I understand it.
One Response to 'A little math problem'
Subscribe to comments with RSS or TrackBack to 'A little math problem'.
Pfft/ You coders always overlook the biological element – and the fact that the woman was Tim’s mum.