**NOTE**: Images with an icon next to them have been artificially shrunk to better fit your screen; click the icon to restore them, in place, to their regular size.

It's amazing how many people can talk themselves into believing something that's obviously wrong.

The other day the following question was posted on a widely-read programming blog by Jeff Atwood:

It quickly got almost 1,000 comments with people arguing about what the correct answer is.

Common sense tells us that gender of an unknown person is a 50/50 proposition. You strike up a conversation with someone who says “yeah, I've got two kids....” and you know that there's a 50/50 chance as to the gender of each kid. The person continuing “... and that's my daughter on the swing” has not revealed anything about the gender of the other kid. Thus, there's a 50/50 chance that the other kid is a boy, and hence a 50/50 chance that “the person has a boy and a girl.” This seems straightforward and common-sensical. 50% either way.

Yet, there were a lot of comments arguing that the answer is 67%. Consider all four ways someone could end up with two kids:

- girl then boy
- girl then girl
- boy then girl
- boy then boy

...and eliminate the “boy then boy” possibility because the question tells us that at least one of the kids is a girl, you end up with three remaining pairings that are possible in this situation. Two of the three involve both genders, so the odds are 2/3... about 67%... that the person “has a boy and a girl.”

Well, that seems pretty solid, and we all know that math can sometimes be counter-intuitive, so.... it must be true?

It seems that a lot of people are willing to let themselves be swayed by what they feel is a mathematical explanation, even when it flies in the face of the most simple, basic common sense. Common sense tells us that revealing the gender of one kid does not indicate anything about the other, so where is the flaw in the logic that leads to the 67% answer that otherwise (except for common sense) seems solid?

**The key point here** is whether the revelation about the girl gives
us information intrinsically about a single child, or intrinsically about
the pair:

- If the information is about one single child, it tells us everything about one kid and nothing about the other kid.
- If the information is about the pair, we know nothing specific about either kid, only one new datapoint about the pair.

**The difference manifests itself in what we include and exclude when
calculating the odds based on the new information.**

Let's look at the “information about the pair” situation first....

After finding out that they have two kids, if you specifically ask “is one of your kids a girl?” and get a yes answer, you know, every time, that at least one is a girl and that it's impossible for both to be boys. Likewise, if you get a “no” answer, you know every time that they have two boys. When the answer is yes and you move on to calculate the odds that the person “has a boy and a girl”, you specifically include every two-kid permutation that includes a girl:

Pairing | Initial Odds | Include/Exclude
when calculating new odds? | New Odds |

girl then boy | 25% | include all | 1/3 (25 of 75) |

girl then girl | 25% | include all | 1/3 (25 of 75) |

boy then girl | 25% | include all | 1/3 (25 of 75) |

boy then boy | 25% | exclude all |

The three equally-likely pairings we include are the same as highlighted near the top of this post. Two of the pairings include both genders, and so there's a 2/3 chance – about 67% – that they “have a boy and a girl” in this situation.

Now, on the other hand, if after finding out that the person has two
children and one of the kids randomly happens to be on the nearby swing and
has its gender revealed as a girl, this information is intrinsically only
about that one kid and tells us nothing *intrinsic* about the pair.
Yes, by finding out that the kid on the swing is a girl you *can* say
“this pair of kids includes at least one girl” and so when moving on to
calculate the odds, you can exclude all boy/boy pairings, but the part that most
people have missed is not in what you can *exclude*, but in what you can *include*....

In this case, you **can not** turn around and include *every*
two-kid permutation that includes a girl because if the gender revelation
is random, then on average, half of the mixed-kid pairings will have a
*boy* revealed. Since you're ignoring cases when a boy is revealed,
you have to ignore them when calculating the odds:

Pairing | Initial Odds | Include/Exclude
when calculating new odds? | New Odds |

girl then boy | 25% | include half, exclude half | 1/4 (12.5 of 50) |

girl then girl | 25% | include all | 1/2 (25 of 50) |

boy then girl | 25% | include half, exclude half | 1/4 (12.5 of 50) |

boy then boy | 25% | exclude all |

The “Include/Exclude” column in both tables is really “times you'll be informed about a girl among the pair”. In this latter situation where the revelation of gender is random, “exclude half” reflects that, on average, half the times the kid whose gender is revealed is a boy.

So, looking at what **is** included, we see that the pairings that
have a boy are ¼ and ¼ which sum up to ½, a 50-50
chance, just like common sense tells us.

The key to all this is to understand *exactly* what information we
are given, and what information we derive. Let's go back to look at the
words actually used in the question posed to us:

This is awkwardly worded... does the “told” apply to “had two children” only? Is “one of them is a girl” the result of the person telling you that exactly, or is it information summed up by the person posing the question?

Because the initial question is so poorly worded, we have no choice but to fall back to our real-world experience to try to parse its likely meaning. I can imagine it both ways:

**Me:**Hey, haven't seen you in ages!**Parent**: Yeah, I'm married and have two kids now... that's my daughter over there on the swing.**Me:**Hey, haven't seen you in ages!**Parent**: Yeah, I'm married and have two kids now.**Me:**Cool, I've got one. My sister just had a little girl.**Parent**: Heh, that'll be fun, I know what it's like to have a girl.

The answer to the posed question is “50%” for the first case, and “67%” for the second.

But that second case seems extremely contrived. The context of our real-world experience tells us that most people would say “I've got a girl, too”, implying that the other is a boy, or “I've got a pair of girls”. It just seems unlikely.

The first case – conversation somehow revealing the gender of one
of the kids – seems much more likely, so when faced with the question
*as written* the most reasonable interpretation results in an answer of
“**50%**”.

Still, if you explicitly decide to choose the other reading (that the parent told you “one of my kids is a girl”), I'd suggest your choice is the less reasonable of the two, but in the context of that choice, you're perfectly correct to answer “67%”. That's the reading that the initial question-asker, Jeff Atwood, took in his followup post that revealed his answer to be “67%”

What amazed me in reading the various reader comments on both posts is
how many people insisted that the answer was 67% in every possible
situation. “**The math is right there, are you stupid!?**” Common sense
screams that *something* is off here, yet flash a little math in
someone's face and odds are they'll blindly follow.

“Common sense tells us that revealing the gender of one kid does not indicate anything about the other”

This seems like a twist on the Monty Hall Problem. The Monty Hall Problem, in case you’re unfamiliar, says “There are three doors, one with a fabulous prize and two with goats. You pick a door. Monty reveals another door (behind which is a goat). What are your odds of winning if you [a] stick with your door you already picked, or [b] switch to the remaining unrevealed door?”

COMMON SENSE tells you that it makes no difference. “Revealing information about the location of one goat doesn’t tell us anything about the other one”. Except… hehe, EXCEPT, that it does.

If you stick with your door, you have a 50/50 chance of winning. If you switch you have a 66% chance of winning. It’s really true, I wrote a quick perl script to test it over 1,000,000 samples and it really does work.

The hypothetical problem you’re describing sounds a LOT like a variation on that same theme. With girls as cars and boys as goats (or vice versa as you see fit, don’t want to upset anyone there).

Common sense tells us that Monty will

chooseto not reveal the car. It’s not random; he knows where the car is, and so his choice of one door tells us something about the other door. —JeffreyWhen I first read the question I said to myself that mathematically it’s 50/50, but I think most people in a real world conversation would actually give more information.

Specifically, if someone actually has two girls then I think they would say something along the lines of “that’s one of my two girls”. I took that as an implication that the “real world” odds were actually higher that the second child was a boy. I didn’t bother to do the math on it…

You make a great argument, but I still think that people generally reveal more information about their situations than they need to, and that therefore you can read a lot more into situations than a purely hypothetical situation like this allows.

You are absolutely right. This is an old math problem that my math teacher in high school discussed at length as most kids were completely stumped by it. I’ve always heard it worded differently though as “at least one of the kids is a girl.” The wording of the current question is very ambigous. There is a third possible reading of the question that you didn’t discuss. The sentence “who told you they had two children, and one of them is a girl” might simply mean that ONLY one is a girl, otherwise the wording would be incorrect. It should say two of them are girls, or “at least one is a girl”. This then implies that the probability that this person has a boy and a girl is precisely 100% Of course all answers are implicitly excluding the possibility of sexually ambiguous children of which there is a probability of about 1% or so in humans.

Doh! Someone else got there with the Monty Hall reference before I did. I always THINK I understand it, then I try to explain it to somebody, then I realize I didn’t understand it so well after all. Lots of things are like that. 🙂

“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?”

For the sake of that persons sanity lets hope they have a boy and a girl…and not two girls!! 🙂

It seems like someone has introduced extraneous information into the argument (which is common and often why arguments are).

There are three pairings. Boy/boy, Girl/Girl, Girl/Boy. Period. By introducing the word “then” implies a time-line, which is extraneous to the conversation and has no bearing on the likely hood of the pairing being one or the other.

Boy

thengirl is no different (other than time) than girlthenboy.You’re right in that the ordering is not relevent to the question, but it is indirectly relevent to understanding the answer in that paying attention to ordering helps explain why a mixed pairing, in the general population, is twice as likely as a girl/girl pairing. Simply stating “girl/girl, mixed, boy/boy. Period” leads one to believe that you think each of the three is equally likely, which leads one to believe that you don’t understand the problem space at its most basic level. Not wanting others to think that about me, I chose to be verbose in describing how I arrived at the answers I presented. —Jeffrey

I’m looking for *this* post to garner 1000 comments about the right answer 🙂

My head hurts.

The question is one that appears in mathematics textbooks and mathematical puzzle books, but it isn’t mathematical in nature. The question is intentionally ambiguous, making it legal in nature. The answer depends on how the question is interpreted. Laws and contracts are written with deliberate ambiguity so that no matter which interpretation the less powerful party applies in reading it, the more powerful party can assert that the other interpretation applies and the less powerful party is always wrong.

Now even though Jeff has never been here and has little experience in these matters so no one should expect him to figure that out, Jeff has been here long enough and has lots of experience so he should have known.

Boy and girl, male and female are sexes, not genders, surely, or were when I was at school. Gender is a grammatical term (masculine, feminine, neuter), sex (male, female) is a biological one. I leave the maths to others!

According to one reference I checked, “gender” has been used to refer to the state of “being male or female” since the 14th century. Do your school years perhaps predate that? 🙂 —Jeffrey

Blimey – I read that Atwood post a couple of days ago on my “development RSS day” and my head hurt, today, I’m on my “photography RSS day” – and bang! my head hurts again….

I have one child (and only one) – a girl, anybody know what the next one will be 😉

Kevin

Yep. You’re right. It’s more about the inadequacies and imprecision of language and the near infinite, subtly different, potential interpretations of any statement by a diverse population.

Despite (or maybe because of) the verbosity, I still do not get what you’re trying to present as the problem space at its most basic level which would lead one to believe you’re incapable of presenting it or that I am incapable of grasping it. The truth I believe, as is often the case, somewhere in between. The result, again, as is often the case, simply one of failed communication between two people.

Either that or I can’t has got the cheezbergr upstairs to rekin it. Which I’m perfectly willing to accept as truth. Not knowing something is bad. Not knowing what you don’t know is worse. There’s allot I know I don’t know and I know I don’t know allot of what I don’t know. Every day I get a glimpse into what I don’t know. And it is humbling. This is another instance. It is a valuable new data point I shall keep and

tryto reference in the future when trying to present ideas and I find myself failing.Sorry for the long post. 🙁 I shall enter “Shut the H… up mode” now.

Some people have WAY too much time on their hands!

Took me a while to wrap my head around this. That was up until a friend whom I was discussing it with said, “It’s easier to think of it like this: suppose you have 1000 doors to choose from. You pick one, and then they’ll eliminate 998 other doors. It’s the same problem, just much more obvious that you clearly picked the wrong one 999 times out of a 1000 (on average).”

That did it for me. Having three and eliminating one is just the extreme case of this.

The “this” you’re speaking of here is the Monty Hall problem, mentioned in the first comment. Indeed, that’s a good way to think of it, but you have to remember the important point is that when “they” eliminate 998 other doors, it’s done with the knowledge of which door holds the prize, and the intent to not reveal the prize. (If they eliminate 998 doors randomly, they’ll reveal the prize 99.8% of the time, but because they know where the prize is and choose not to reveal it, they end up revealing it the desired 0% of the time.)

None of this is directly related to the two-kids problem discussed in the post, though. —Jeffrey

Well, I *am* older than you!

Fowler’s Modern English Usage says: “gender (n.) is a grammatical term only. To talk of persons or creatures of the masculine or feminine gender, meaning of the male or female sex, is either a jocularity (permissible or not according to context) or a blunder.”

Your esteemed compatriot, Bill Bryson, says “Gender, originally strictly a grammatical term, became in the nineteenth century a euphemism for the convenience of those who found ‘sex’ too disturbing a word to utter. Its use today in that sense is disdained by most authorities as old-fashioned and over-delicate.”.

But I guess it is not for me to comment on anyone else’s use of English, sorry – mine is flakey enough at times!

Maybe it’s my midwestern American upbringing, but I find no need to borrow from the noun “sex” (making babies) to describe the one-or-the-other result one gets from it. I also don’t use the word “flip” to describe the obverse/reverse nature of the side of a coin, but maybe Bill Bryson does 🙂 —Jeffrey

To me, from mathematical prospective, it all boils down to how to build your model of what being stated. The groups of objects (children pairs in this case) are represented as a set. The probability is then chosen amongst number of distinct sets. But this sets can be an ordinary unordered or partially ordered. In the former case the set (boy, girl) and (girl, boy) is one and the same and you can’t count it twice – hence in this model you will only have 3 possible pairs. In the latter case when we introduce some partial ordering to the set (by age, by eye colour or something else) we end up with (boy, girl) and (girl, boy) being distinct and will have 4 total pairs to shoose from.

I am not saying that one of them is right and one is wrong – it all depends how you choose your mathematical model. But in a simple case when there is nothing known apart from the kids gender/sex/whatever – the former model where (boy, girl) and (girl, boy) are one and the same seems to be the closes match. Adding partial ordering by age may as well be replaced by anything else similar(like ordering by height, weight etc – I don’t see why age should be preferred to anything else and used at all 😉

I’m not sure what you indend your point to be in the context of my post. The question has nothing to do with ordering, so there are only three types of sets under consideration, and in this context, boy/girl is indistinguishable in every respect from girl/boy. This one-of-each set is

not, however, equal inprobabilityto the other sets (two boys, two girls), and that inequality among the three members of the set is important to understanding both the question and its answers. —JeffreyMy point was that the interpretation of the probability is down to the model you choose.

> The question has nothing to do with ordering

True but the interpretation of it and modelling it via mathematical representation – has everything todo with it.

> in this context, boy/girl is indistinguishable in every respect from girl/boy

Depends on the model, if you choose to introduce some “ordering” (relation) in a pair such as “older than”, then (boy, girl) is not the same as (girl, boy).

I really am missing your point, because if you “choose to introduce some ordering” to the question, you’re then answering a different question. —Jeffrey

> This one-of-each set is not, however, equal in probability to the other sets (two boys, two girls)

It is if there is no “ordering” to the pair.

Hmmm, I’m beginning to think my number one son and your oldest brother Steve is going to be proven correct in his prediction of the number of comments this is likely to “engender.” (Sorry. Couldn’t resist.)

A little late to the conversation, but may be adding another perspective.

What most people seemed to be struggling with is that by randomly identifying the girl on the swing to be his/her daughter, one explicitly breaks the symmetry in the “girl then girl” pairing of the answer space.

More precisely, the answer space should include “girl-on-swing then girl-not-on-swing” and “girl-not-on-swing then girl-on-swing” in addition to “boy-not-on-swing then girl-on-swing” and “girl-on-swing then boy-not-on-swing”.

Consequently, the kid who is not sitting on the swing has a 50% chance of being a boy.

In general, we don’t know which girl of the (girl, girl) pair is randomly named as being his/her daughter by the parent.

The Monty Hall problem is different in that the revealation of the game show host depends on the prior pick of the game show contestant.

Hello

Here is an other example of the way our mind works:

One flow is intuitive and fast (sometimes right , sometimes wrong)

The other is analytical and slow (and sometimes right or wrong)

Here is the problem:

I just purchased an envelope and a stamp for $1.10

The envelope costs $1 more than the stamp

What is the cost of the stamp???

Quickly you will answer : obvious $1 for the envelope and $0.1 for the stamp , this adds to $1.10

But if you now substract , you’ll find a $0.9 difference, not a $1 as asked !!!!

I let you compute the correct answer

When intuition and analytics are in conflict, there is a little voice in our brain which tells us “it looks that way, but it’s wrong” This little voice has been experimentally measured (like in the envelope problem) and tells the truth in 95% of cases . So follow your little inner voice when it tells you “something is incoherent here”

My initial reaction when I first saw Jeff Atwood’s original post is still the interpretation that I think makes the most sense in this case. That is, JeffA took a problem that is intrinsically confusing for many people, and he intentionally worded his version of the question such that there exists three valid interpretation of his ambiguously-worded question. If the ambiguity was intentional, then JeffA was exceptionally clever at driving traffic to his (often interesting, sometimes controversial) blog. As your 9th commenter points out, the 3rd interpretation is that we were already told that the subject has exactly one girl.

JeffreyF’s math is correct. Still, my preferred answer remains: 100%. Why? JeffA is an adept computer programmer, is competent at english, and I suspect he knew a priori that his wording was ambiguous. I look forward the next “stack overflow” podcast to see if Jeff and Joel discuss this question.

Grandma F: “people have too much free time”.

Her daughter: “my head hurts”.

Her other son: “waiting for 1000 comments”.

I – gave the Monty Hall problem to my husband who got hooked and started calculations. What’s the probability of a woman to start such calculations compared to a man???

BTW reminds me of the “interest in stars and 15yo. boys in girls” on the hanabi evening with our two 4th grade boys.)

Anyway this post definitely took me some time (googling). Significantly more time compared to the others.

Anne