Monday, January 05, 2009
1/2 of a 2/3 spherical cow …
Today's post is a simple question.
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?
Consider your answer carefully, without doing a web search, or reading the comments to this post. Don't cheat—but be prepared to explain your reasoning, because the solution might surprise you.
It's almost like some kind of conspiracy or something.
Coding Horror: The Problem of the Unfinished Game
That, and the follow-up post, plus a few threads on various commentary sites can be summed up with the following result:
The odds are 1/2, except, of course, when it's 2/3.
A lot of virtual ink has been spilled over this, but I think I have this down now. I wrote a program to simulate this problem and doing so has clarified the result (nothing like picking a few million pairs of virtual kids and seeing actual numbers).
It goes like this. Assume a spherical cow … oh wait, wrong problem. Assume an even 50% chance of having a boy or a girl. Take 100 families with two kids. There are four cases to contend with, boy/boy (25%, or 25 out of a 100 families), boy/girl (25%, or again, 25 out of 100 families), girl/boy (25%) and girl/girl (the remaining 25%). But in three of the four cases (75%) there is at least one girl. And out of those 75 families, 50 of them (or 66% of 75, or 2/3) will have a boy.
And thus, that's how we end up with 1/2 of a 2/3 spherical cow.