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.
I'd say 50%.
Mikael on December 31, 2008 3:17 AM33%
Isaac on December 31, 2008 3:19 AMActually, 100%. They say "one" of them is a girl. Therefore the other must be a boy.
Isaac on December 31, 2008 3:21 AMquick thought: 45% and I'm not ashamed of being wrong.
I read once somewhere that 55% of humans are female.
And what abou hermaphrodites???
Ino on December 31, 2008 3:23 AMIt's 50%. You already know that one of the two kids is a girl, so the problem is reduced to "What is the probability that the other one is a boy?"
Hussein on December 31, 2008 3:24 AM100% - if they have 2 children, and they've told you that only one is a girl, the other one must be a boy (at least that's my take on it and assuming we aren't dealing with any of the more exotic genders).
I'm going for 2/3
The combinations could be:
Boy/Girl
Boy/Boy
Girl/Girl
Girl/Boy
We know one of the children is a girl so we can drop the boy/boy combination. This leaves three combinations, two of which include boys.
Toot toot.
jammus on December 31, 2008 3:24 AM50% or .5 probability.
Two thirds.
My explanation:
Since this is hypothetical, we may assume we are talking about the expected value. We may further assume that in an independent experiment (i.e. birth), the odds for a boy or a girl are identical at 50%.
Now, for two children there are four possibilities, with equal probabilities:
1. boy-boy
2. boy-girl
3. girl-boy
4. girl-girl
Since we've discounted the first possibility, we are left with three possibilities with equal probabilities, two of which yield the desired outcome. Hence, two thirds.
Options are BB BG GB GG
Comment rules out BB so the answer is 2 to 1 (assuming B/G 50/50)
But realistically, anyone who says one is a girl implies the other is a boy
Dave on December 31, 2008 3:26 AM2/3
If they have 2 children, there are four possible permutations, all other things being equal:
BB
BG
GB
GG
If you know that one of them is a girl (ignoring the very valid semantic point that Isaac raised) that eliminates the 'BB' possibility. Of the three remaining possibilities, two satisfy the 'boy and girl' condition. Therefore, 2/3.
Murali on December 31, 2008 3:28 AM@Isaac - that's brilliant reasoning.
I'd say that there are four possible combinations for two children:
a) boy + boy
b) boy + girl
c) girl + boy
d) girl + girl
and that we could naively assume 25% probability for each.
(a) is ruled out, therefore the person has one of a,b,or c, with 33% probability each. The odds of boy and girl are therefore 66%.
50%. It's always 50%. There is no dependancy between the two. Having one girl doesn't mean you have a higher chance on the second attempt of having either. It's still 50%.
Same as tossing a coin. If you throw 99 heads in a row, the chance of a head (or tail) on the next throw is still - and always will be - 50%.
Nic Wise on December 31, 2008 3:33 AMLets also rephrase the question:
Let's say, hypothetically speaking, you met someone who told you they had ONE CHILD. What are the odds that person has a boy?
:)
Nic Wise on December 31, 2008 3:35 AMIt depends on what they mean by "one is a girl". Let's assume they said "at least one is a girl", except nobody would say that if they weren't a character in a puzzle. More realistically, imagine they mentioned two children and later on that they were organising a birthday party for "my daughter", which lets you deduce the same thing, that there's at least one girl.
When they mentioned two children, there were four possible pairings: two girls; older girl and younger boy; older boy and younger girl; two boys. When they mention a daughter that rules out them having two boys, but the other pairings have equal probability. So the answer is 2/3.
Andrew Turner on December 31, 2008 3:35 AM1/3rd chance that the other child will be a boy.
Here is my reasoning:
There can be two cases here:
1) Two girls
2) One girl and one boy.
In case 1 there are two sub cases:
1.1) He was talking about the first girl
1.2) He was talking about the second girl
In case 2 there is only one sub case (beacuse he is talking about the only girl)
So among these three cases only one gets you one girl and one boy.
I would say 50%, but since you are implying there's a catch here, it might be 1/3, like that "game show doors" problem.
Lerxst on December 31, 2008 3:36 AMTo all the statisticians above: how is boy+girl different from girl+boy? The order doesn't matter, the only information you have is that one of them is a girl.
John Rothlisberger on December 31, 2008 3:37 AM66%?
Tuna Toksoz on December 31, 2008 3:40 AMJohn Rothlisberger: Depends on culture. See China or Thailand for example.
mannu on December 31, 2008 3:40 AMMannu: you're talking about selective abortion or selective in-vitro conception -- I wouldn't factor that in to this simple, undoubtedly trick question.
John Rothlisberger on December 31, 2008 3:43 AMIf you are talking with parent and he/she tells you, that there are 2 children and one of them is a girl then there is a 100% probability that other is boy. So the answer to the question "What are the odds that person has a boy and a girl?" is 100%.
If the person you are talking with is not a parent of children in this case, then I can agree with people who say who say 2/3.
Aarne on December 31, 2008 3:43 AMif he says "ONE of them is a girl", I think he's meaning the other one is a boy. so 100% chance, I'd say... or 99.99999999% to be on the safe side :-)
if he had two girls, he would speak differently.
By the way, I agree with Nic Wise. In the absence of external influence, a coin toss doesn't know what the results of previous coin tosses were.
John Rothlisberger on December 31, 2008 3:44 AM@john rothlisberger - because having a boy and then a girl is a different event to having a girl then a boy. We're working out the probability of each child pair occurring. There are four possible events (BB, BG, GB, GG) of which we're discounting one (the BB pairing) leaving us three remaining possibilities.
jammus on December 31, 2008 3:45 AMSince he already as a girl, possible pairs are:
BG
GB
GG
so the odds of having a boy and a girl = 66.67%
Vadakkoodan on December 31, 2008 3:46 AM@john - it would be the same with a coin toss.
"I flipped a coin twice. One of the results was a head. What is the probability that the other result was tails?"
H/H
H/T
T/T - NO!
T/H
Still 2/3.
jammus on December 31, 2008 3:48 AMTo the comenters above me.
In this particular problem BG and GB is the same. So only there are 2 remainig options. 50/50
LBO on December 31, 2008 3:50 AMread my first line as "since he already has a girl..."
Vadakkoodan on December 31, 2008 3:51 AM@John Rothlisberger
The four outcomes are the ways in which children could have been born. You could have
boy then boy
boy then girl (i.e. the boy is older)
girl then boy (i.e. the girl is older)
girl then girl
Two coins add up to 30c, one of them isn't a nickel.
What are the two coins?
If you think the answer to Jeff's puzzle is 50% consider this riddle and try again.
Andy on December 31, 2008 3:53 AMI'm going with 2/3. Same sort of reasoning as Monty Hall : http://en.wikipedia.org/wiki/Monty_Hall_problem
Greg on December 31, 2008 3:54 AM@jammis: no we are not working out the combinations. we are working out the probability of ONE INDEPENDENT event (we know the other already), which has 2 outcomes. 1/2 = 50%.
or if you want to work it out with sets:
BG
GB
BB
GG
#3 is eliminated, 'cos we know we have one girl, leaving:
BG
GB
GG
As they didn't say that the first - or second - is a girl, BG and GB are the same (it's not order dependant), so we have:
BG (or GB, doesn't matter)
GG
Hence 50%.
Nic Wise on December 31, 2008 3:54 AMIt's closer to 100% but not there.
Reasoning: in general population boys outborn girls by 51.4%. So if we gave a 2-child "general" family then to keep up the statistic girl already has a smaller chance to also be the second child.
If it were 50% then situation would become, for N of 2-children families already N children are girls and the rest are N/2 girls and N/2 boys. which makes 1.5N girls and .5N boys (which contradicts statistics).
Pasi Savolainen on December 31, 2008 3:54 AMBTW, @Daniele Muscetta has a VERY good point :)
Is 2008 over yet? please?
Nic Wise on December 31, 2008 3:56 AMConditional probability and Bayes' theorem.
"What are the odds that person has a boy and a girl?"
(the *usual* problem)
but combined with an extra information
"...and one of them is a girl."
we have a different problem.
http://en.wikipedia.org/wiki/Conditional_probability#The_conditional_probability_fallacy
http://en.wikipedia.org/wiki/Bayes%27_theorem
Nikos on December 31, 2008 3:56 AMWhat's wrong with the world!! It's a simple probability question. There are only 4 posibilities. One of 'em is a girl. So, you are left with the other three options which makes it 1/3.
Saj on December 31, 2008 3:56 AMBreaking down the possibilities is a good approach, albeit everybody took the wrong turn at the first intersection. The possibilities have nothing to do with gender distribution or coin toss. They hinge entirely upon who the person you met is.
1. Normal person: Nobody in their right minds would say that they "have two kids, one of which is a girl" and mean anything other than "I have a boy and a girl". They also wouldn't see "B-G" and "G-B" as two different options. Resulting figure: 100%.
2. Abnormal person: The kind that like to mess with other people's minds for no apparent reason. It would be fun in parties to follow up the initial statement with "...and the other is a girl too! haw haw haw!" Figure made up on the spot: 28%.
3. Really abnormal person: The kind that like to tell lies for no apparent reason. They could actually have three boys (or no kids) and you couldn't be any the wiser. Figure range: 0%-100%.
4. Cyborg: They always tell the truth, but are very literal about it. They tend to enumerate the children/gender pairs one by one so the figure remains 50%.
PS. I could just say "the question is wrong as asked" and leave it at that, but I like to think I'd fall into the second category.
PPS. If you think cyborgs cannot have children, you are a discriminating technophobe and will answer to Skynet when the revolution comes.
Ishmaeel on December 31, 2008 3:58 AM66%
Gullit on December 31, 2008 3:58 AMI'm only interested in _if_ people who answered wrong will admit that they are wrong after the right answer is revealed. :-)
Zizzencs on December 31, 2008 3:59 AM@jammus -- you've convinced me. I agree, the question isn't an independent "what is the probability of the first of the two children being a boy in the absence of all other information?". Knowing that one of the children is a girl changes the question (and the answer).
The first question would have an answer of:
GG - No
BB - Yes
BG - Yes
GB - No
= 50%
The question "what probability of at least one boy", would be:
GG - No
BB - Yes
BG - Yes
GB = Yes
= 75%
COOL!!
OK, so there's this aeroplane and it's on this treadmill right...
jammus on December 31, 2008 4:00 AMGoogle/Yahoo also asks to compare yourself with a tree! Why the hell I'd compare myself with a tree???!!!
Zig on December 31, 2008 4:01 AMWithout a lot of thought, I'd say 66%
Having two boys is out, so your are left with 3 possibilities of which only 2 satisfies boy AND girl
But there may be some probability catch just because of how the question is presented (it can't be that easy)
Juan on December 31, 2008 4:02 AMI think you can go two ways with this question, depending on what it says to you. Take these two different, but similarly-phrased questions, and see which direction your mind goes with them:
"You met someone who told you they had two children. One of them is a boy and one of them is a girl. What are the odds that person has a boy and a girl?"
"You met someone who told you they had two children. Both of them are boys. What are the odds that person has a boy and a girl?"
Do you answer the questions using different implied information, even though they're phrased the same way?
Matt Gibson on December 31, 2008 4:03 AM@Nic Wise: You're wrong. You're not working out the probability of a single independent event - you don't know which child you're talking about, so you must consider both. The probability that the first child is born a boy is 50%. The probability that the second child is born a boy is 50%. The probability that ONE CHILD OUT OF TWO is a boy when you know that ONE OF THE TWO is a girl is not 50% - it is 66% as explained so patiently many times above. You have it exactly backwards.
Fred on December 31, 2008 4:05 AM@Zizzencs happy to. Of course, if I did admit it (or not admit it), that would reveal the answer. So....
Nic Wise on December 31, 2008 4:07 AMno Bayes' theorem here: the first child is already a girl, so the chance that the second one will be a boy is not related
>>> 50% (or the orginal percentage of boy over girl)
Motocarota on December 31, 2008 4:08 AMHere we go again, any bets on how many people we can get this time to insist that the answer is 2/3, and that anybody who disagrees with them is a moron?
P.S. You all should have learned this problem in your CS education, around the same time as you did Monty Hall.
pantsgolem on December 31, 2008 4:08 AMAll the children learned probability theory and forgot how to think normally! Why would you care if the first one is a boy or a girl..they didn't tell that their first child was a Girl, now did they? So, you have three choices:
Boy-Boy
Girl-Boy
Girl-Girl
One of 'em is a girl. So, drop the Boy-Boy option. How many you got now?
Saj on December 31, 2008 4:10 AMFor an intellectual blog about something as complicated as programming, there are a surprising number of blatantly wrong answers presented here. Oddly enough, they also seem to defend their argument the fiercest. Maybe a sign of the problems in our trade ?
J. Stoever on December 31, 2008 4:11 AMThis post is going to be followed up by one about seemingly simple problems that are inadequately specified. The bold part at the bottom of the next post will read something like "As developers we have the duty to seek out and understand the unspoken assumptions of our customers and fellow developers, to seek common ground, and HUGS!"
This is similar to ".999... == 1" and "airplane on a treadmill" debates, as mentioned in the Stack Overflow podcast.
Problems like this result in the kind of arguing above, people make an assumption about the spec and then cling to it while shouting that people who made the other assumption are crazy.
@fred. see previous comment :)
Nic Wise on December 31, 2008 4:12 AMYou! Sheldon Coopers of teh intertubes! "One of them is a girl" doesn't mean a frak about the other one.
Stop being such language nitpickers!
And have a happy year change.
maeghith on December 31, 2008 4:13 AM@Isaac. You have been told that they have two children. Maybe you are TOLD that one is a girl but it is also possible that you SEE one child and that you SEE that that one child is a girl.
There is by the way also the possibility that that person isn't telling the truth.
Theo on December 31, 2008 4:16 AM@Nic Wise: I have seen a lot of similar threads on various mailing lists/forums/discussion boards/etc. and there are always some people who do not accept they couldn't solve the problem.
BTW some statistics so far:
33% --> 3
45% --> 1
50% --> 10
66% --> 11
100% --> 5
I'm glad that probability theory doesn't work as statistics for this problem :-p
Zizzencs on December 31, 2008 4:16 AM2/3, for reasons explained above (BB BG GB GG). To those that are saying order of BG or GB doesn't matter, or comparing it to a coin flip, you are incorrect. If the question was rephrased as
"You met someone who has 1 child, a girl, and they are now pregnant. What are the odds that the new baby is a girl?"
Now the answer is 50/50 because the event has not occurred. This is similar to the 99 heads question. Since the children have already both been born, the order does matter.
Matthew Truesdell on December 31, 2008 4:18 AMI still haven't seen anyone give a good explanation why BG/GB are seperate cases. The questions does not ask about the order in which the children appear, only whether there is a girl and a boy (in whatever order and of whatever ages). To me, it makes just as much sense to consider the color of the children's eyes as to consider the order of the children.
Morten Christiansen on December 31, 2008 4:19 AMThis is not the Monty Hall problem. In MH, the hosts picks one of the two remaining doors after the player has picked one. The pick depends on what the player chose, or, in other word, the host can't decide which door to open before the player decides, because otherwise there'd be 1/3 chance that he'd pick the same door and that wouldn't work, would it?
Now, assuming that the odds of having a boy is 50% (for various biological reasons it's a little more, even though there are more women in the population, but women live longer), and assuming that this is not a semantic trick ("you met someone who told you they had two children, and one of them is a girl" is not the same as "you met someone who told you they had two children, and THAT one of them is a girl"), then the odds are 50%.
Are you doubting me?
Okay, try this little experiment. Change the question to: "what are the odds that the children are both girls". Why should the probability be different?
NM on December 31, 2008 4:19 AMit's either 50/50 or 2/3 depending on whether the parent picked the child they told you the sex of randomly or not.
If they picked it randomly and then said "hey look - it's a girl" then the probability of a boy being left is 50-50, as the picking of the first child was independent of the sex of the second child.
However, if they deliberately picked a girl to tell you the sex of, then they are skewing the probabilities in favour of leaving a boy behind, hence increasing the probability to 2/3.
Rhys on December 31, 2008 4:20 AMIt's not a probability question after all
I'd say the second kid is a boy for sure (100%), otherwise they'd have a third kid.
@Morten,
For the explaination why the BG GB cases are different, see my answer above.
Niyaz PK on December 31, 2008 4:23 AM"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 me the way you phrased your question raises the question whether that person still has two children. However, English is not my native language so I might be totally wrong about this...
Thom on December 31, 2008 4:24 AMI would say there's a 90% chance they have a boy and a girl. If both were one sex or the other, most people would say, "We have two girls" or "We have two boys."
We had 3 boys, who are young men now. We always put that out front: "We have 3 boys" to which the reply would come "God bless your wife. She must be a saint." She is. I need to brew the saint's coffee now. Bye.
Jeff Schwandt on December 31, 2008 4:24 AMMonty Hall? But there aren't three doors.
So I say 50%. Just because one is a girl, doesnt mean exactly one is a girl.
Mr Bones on December 31, 2008 4:25 AMCan't see any other answer than 2/3 assuming 50% split between boy/girl:
A person having 2 children has 3/4 chance to have at least 1 girl.
A person having 2 children has 1/4 chance to have 2 girls.
Chance of having only a girl given at least one girl:
chance of 2 girl / chance of at least one girl = (1/4) / (3/4) = 1/3
Chance of having a boy given at least one girl:
1 - chance of having two girls given at least one girl = 1 - 1/3 = 2/3
This is different from the question "My first child is a girl, what gender will my next child be?" then obviously the answer is 50%.
This is is the same as saying "what is the chance of me having a boy as a second child, given that my first child is a girl"
Possible outcomes for two children are BG GB GG BB. Chance of first being a girl is 1/2, chance of second being a boy if the first is a girl is 1/4.
So, chance of being a boy is
Chance of boy if first is girl / Chance of first is a girl = (1/4) / (1/2) = 1/2 as expected.
I'm with the 50/50 crowd, I do not for the life of me see why the order BG and GB should be two things. No mention of order was made just one of the two is a G what are the changes that the one left is a B? So I get to 50%.
Marthinus on December 31, 2008 4:28 AM2/3. here is a proof everyone should be able to understand.
import java.util.Random;
public class Monte {
public static void main(String[] args) {
Random random = new Random();
int samples = 0;
int boySamples = 0;
for (int i = 0; i < 1000; ++i) {
Sample sample = new Sample(random);
if (sample.hasGirl()) {
++samples;
if (sample.hasBoy()) {
++boySamples;
}
}
}
System.out.println(boySamples/(float)samples);
}
public static class Sample {
private Gender first;
private Gender second;
public Sample(Random r) {
first = nextGender(r);
second = nextGender(r);
}
private Gender nextGender(Random r) {
if (r.nextBoolean()) {
return Gender.Boy;
} else {
return Gender.Girl;
}
}
public boolean hasGirl() {
return first == Gender.Girl || second == Gender.Girl;
}
public boolean hasBoy() {
return first == Gender.Boy || second == Gender.Boy;
}
}
public enum Gender {
Girl, Boy
}
}
If this person lives in China, the probability is 0. He/she lied to you telling you he/she had two children. Please be careful speaking with people you don't know.
splattne on December 31, 2008 4:29 AMI would also say 50%, but I'm more concerned with the the question "Where do I find the correct answer?"
Dion Moult on December 31, 2008 4:30 AMI'd say 50%. When we hear that the person has two children, the probability is 33%, as we don't know anything further, so it could be GG, BB, or GB. However, with the revelation of the fact that one is a girl, that changes everything and the possibilities are now GG or GB, making the probability of a GB combination 1/2, or 50%.
DH on December 31, 2008 4:30 AMBTW, this puzzle reminds me this other one:
The "three door puzzle" is an interesting and unusual probability question. Here's how it works. You are a contestant in a game show, and the game show host tells you there is a prize behind one of the three doors you face. You have to guess which door to open.
But when you make your guess, instead of opening the door you picked, the game show host opens a different door...one that he knows has nothing behind it. So now you're down to two doors. And the game show host says, "I'll let you change your choice, if you want to."
And the question is, do you change your guess? Or keep your original choice?
Solution here: http://www.theproblemsite.com/treasure_hunt/door_hint.asp
splattne on December 31, 2008 4:31 AMHere's another variation on the question to help put away those silliness about not being 50%:
Your pet cat just gave birth to 10 kitten. You find out that at least 9 of them are female, but the 10th ran away before you could examine it. What is the probability that the 10th is a boy?
Now your pet rat just gave birth to 10 little rats. Your neighbour is holding 9 of them in her hands, she knows their gender but she won't tell you. You're going to inspect the 10th. What are the odds that it's a boy?
Wait! Before you have a chance to look, she tells you the surprising news: "they're all girls!" Have the odds changed?
Another one: you organize a costume party for your kid's birthday, he's turning 6. All the kids wear mask. One of the parents introduces herself as the mother of John. Or did she say Joan? You're not sure. She mentions she has two kids. You really can't tell if Joan or John is a boy or a girl, with the mask and all. What are the odds that her/his sibling is a boy? A girl?
She tells you John is, in fact, a boy. What are the odds now? Did they change?
Wait! She actually meant that Joan acts LIKE a boy. What are the odds?
NM on December 31, 2008 4:35 AM@DH:
If you know someone has two children, there is a 50% chance they have a boy and a girl (ignoring order), a 25% chance they have two boys, and a 25% chance they have two girls. Your initial 33% figure is mistaken.
P(FirstBornSon) = 0.5
P(SecondBornSon) = 0.5
P(TwoSons) = 0.5 * 0.5 = 0.25
According to Dr. House, everyone is lying. So i have to assume that this person told me nothing truthful about the sex of his two children.
Hence, the odds that this person has a boy AND a girl is:
GG - Possibly
BB - Possibly
BG or GB (order is irrelevant) - Possibly
In conclusion: the probability of that person having a boy and a girl would be 33%. But since you also can not rely on the person being truthful about the number of kids he has, we have to assume that the odds of this person having a boy and a girl can only be deduced from population statistics and the average odds of any one person (of which we know nothing in particular, not even his/her sex) having two kids of which one is a girl and one is a boy.
Hence the solution is beyond our reach and we can only come up with a statistic probability, or an estimate. The only thing you can certainly say is that the chance must be less than the percentage of people having exactly two kids in the first place.
Here's why it's NOT 50% :
If the FIRST one were a girl, the probability that the second is also a girl is 50%.
HOWEVER that's not what the problem says! There are already TWO children, and the parent gets to see the end result before responding. The parent has more information than you do (which is not the case in all these coin toss scenarios people keep making up).
So, since the probabilities of the four scenarios are equal, BUT knowing that the selection of the first child is BIASED by the parent toward girls, this actually biases the remainder towards boys.
answer: 2/3
sep332 on December 31, 2008 4:39 AMTwo ways of looking at this:
1) Since we know one of two kids is a girl, there are two options: They have Boy/Girl or they have Girl/Girl. Ergo, chance of "Boy/Girl" is 50%.
2) When having two kids, one of four scenario's can happen: GG, GB, BG and BB. We know one child is a girl, so it was either GG, GB or BG, two of which contain a B, so it's 2/3, or ~66%.
I'm leaning towards 2), but couldn't articulate why 1) would not be a completely valid way of treating the problem.
@NM:
>Change the question to: "what are the odds that the children are
>both girls". Why should the probability be different?
Because when you have two kids, you have 50% of having a boy and a girl, 25% of having two boys, and 25% of having two girls.
Here are two more questions:
"You meet a woman who tells you that she has two children. Being a logician and fond of puzzles, she is quite precise in her wording and tells you that one or more of her children is a girl. What is the probability that the other is a boy?"
"You meet a woman who tells you that she has two children. Being a logician and fond of puzzles, she is quite precise in her wording and tells you that the eldest child is a girl. What is the probability that the other is a boy?"
Do you get the same answer for each?
Note: assume 50-50 chance of boy/girl birth to keep simple.
Charles Darke on December 31, 2008 4:41 AMNow here's a question:
What is Jeff up to given he has managed to distract 150K+ developers on new years eve (tho, if you happen to be in New Zealand (and shortly Australia), it's happened)??
Is this what he does when he needs a window to redeploy stackoverflow or something?
Bait-and-switch, people. Bait and switch.
Nic Wise on December 31, 2008 4:44 AM@drscroogemcduck,
Your program is wrong!!!
You have not included the most important information in the problem in your program.
"told you they had two children, and one of them is a girl"
He told that one of them is a girl.
The question is not about the probailty of having one girl and one boy.
The question is about the probability of having one girl and one boy after the guy told you one of the children is a girl.
Does the fact that he TOLD this change the probabilty?
YES!!!!
That is the beauty of this question.
Niyaz PK on December 31, 2008 4:45 AMIf they said one of their children is a girl, doesn't necessarily mean the other is not a girl. Therefore, since we know one of them is a girl, there is a 50% chance they have one girl and one boy (or whatever the "scientific" percentage is for boy vs. girl).
Jeff Layton on December 31, 2008 4:49 AMAnother way to think about this:
Suppose these people have 1000 children, and you know ONE of them is a girl. What is the probability ALL the other ones are girls? That's pretty minuscule, right? So what is the probability the remaining 999 are about evenly split between boys and girls? That's a lot more likely! So intuitively, 50/50 distributions are more likely. This holds true, even when you only have 2 kids.
The same method helped me understand the Monty Hall problem: Suppose there's 1000 doors, you pick one, and then Monty opens 998 doors, leaving only your original pick and one other door closed. Should you switch? Hell yeah, because the chance that you initially picked the right door was so small.
Jeroen on December 31, 2008 4:49 AMOk,
I'm going for 50%*, and here are my reasonings:
There are actually 6 combinations (if we are giving each combination equal probablility):
B1-B2
B2-B1
G1-G2
G2-G1
B-G
G-B
Note that we've doubled the B-B and G-G combinations to take account of order, in the same way that we take account of order in the B-G cominations.
So we've ruled out the B-B combinations and are left with:
G1-G2
G2-G1
B-G
G-B
half of these have a Boy AND a Girl.
Another (possibly more intuitive) way of explaining it: the second child is independent of the first, and has a 50% change of being a Boy.
-Perros-
*For all my calculations I'm assuming the following:
- Boys and Girls have a 50/50 split.
- The fact that they've told us that one is a girl doesn't implicitly state that the other is a boy.
33%
labilbe on December 31, 2008 4:51 AMMathematically it is 2/3, as others have explained. But as someone said "one of my children is a girl" and we can assume that someone is not a Cmdr. Data of some kind, we can probably assume the percentage is higher - close to 100%
Daniel Lehmann on December 31, 2008 4:51 AMThe answer depends on what 'distribution' of two-child families you assume you're sampling from, which in turn depends on how you interpret the information 'one of the children is a girl'.
The possibile interpretations of this statement are:
1) The parent is saying that *only* one of the children is a girl -> the distribution is {gb, bg} -> the probability of a boy is 100%
2) The parent randomly selected one of their children, and told you what sex it was (it just happened to be a girl) -> the distribution is {gg, gg, gb, bg} ('gg' is counted double because 'gg' parents would make these 'one girl' statements twice as often as each of the 'bg' and 'gb' parents) -> the probability of a boy is 50%
3) The parent is effectively answering yes to the specific question 'do you have at least one girl'? -> the distribution is {gg, bg, gb} ('gg' only counts once here because parents with two girls wouldn't answer yes to this question 'more often' the 'bg' or 'gb' parents) -> the probably of a boy is 2/3
Of course, if you reckoned that either one of these interpretations might actually hold, with probabilities p1, p2 and p3, then you could estimate the the total probability of a boy as p1 + p2 * 1/2 + p3 * 2/3.
You guys are only considering the case of two kids!
What if someone has five boys and one girl? Wouldn't that also work? That person has a boy and a girl.
For only two kids: As others pointed out:
BB
BG
GB
GG
Thus with two kids, there is a 50% chance in combinations that there is one boy and one girl. As for Charles' question:
We know at least one child is a girl, therefore we can throw out the BB combination:
BG
GB
GG
Thus, the odds are 2/3 that she has one boy and one girl. If she specified a particular child (the one on the left is a girl), the odds change again since we can throw out the BG combination since the Boy is on the left:
GB
GG
Thus, it is a 50% chance that each child is of a different sex.
Of course, all these assume that a boy or girl is a 50% chance. If we say that a child has a 55% chance of being a girl and only a 45% chance of being a boy, the odds must be adjusted.
David W. on December 31, 2008 4:52 AMOne other thing: Statistical reasoning becomes fundamentally and utterly DIFFERENT depending on whether you're asking what the odds are something WILL HAPPEN, or whether something HAS HAPPENED.
Jeroen on December 31, 2008 4:52 AM@Jeff Layton:
You're right, there is a 50% chance they have a boy and a girl. The point is that by saying they have a girl, they eliminate from consideration the 25% chance that they have two boys. The probability of a boy and a girl is now 50% / (the new total probability of) 75% = 2/3.
Jeff,
what is the answer? we are all going crazy here!
firstly, the guy who mentioned conditional probability,
well, that is a crock of... gender of one has no influence
on the other. the are called mutaully exclusive events.
so bayes theorem doesn't fly.
leaving aside the grammar, the chances are clearly 50%.
now jeff, be a good " daddy to be" and tell us all what you think
is the answer because clearly there isn't one.
Do you 50 percenters agree with this?
66% of all 2-child families that have a girl also have a boy.
This is obviously the case since our distribution goes:
25% BB
25% BG
25% GB
25% GG
I'd say 3/8 = 37,5%
Vince on December 31, 2008 4:55 AMSo, is Jeff thinking of getting another kid?
(yeah, it's 66%, but I read a book on randomness not too long ago)
david on December 31, 2008 4:58 AMTo the folks who play the "One of them is a girl, so the other must be a boy" remember they could always say "One of them is a girl, and so is the other".
Kinda like "I have a pair of kings, and another pair of kings" (although technically, that's two pair and not four kings, if you play right).
And for the people doing all the probabilities on combinations, remember that it's up to the father and they don't always have the disposition to shoot out a Y-chromosome, so there's more to it than that, and even so it's a crapshoot which swimmer reaches the goal.
Andrew on December 31, 2008 4:58 AMJammus was the first to get it right.
Jon Peltier on December 31, 2008 4:59 AM@Niyaz
i'm not sure exactly where the program is wrong. it only selects samples where there is at least one girl. i thought this matched the statement, "and one of them is a girl". i guess if the statement means one and only one girl then the program is wrong. the answer would then be trivially 100%.
drscroogemcduck on December 31, 2008 4:59 AMThe odds that the parents gave birth to a boy, after having a girl *IS* 50%. (or about, were making a basic assumption here)
Likewise, the odds that parents of two children will have one boy and one girl *IS* 50%
{ BB,BG,GB,GG } 1/2 of those possibilities.
But that's not the question. The question is What are the odds that parents have one of each given that one is a girl. That problem removes one of the four possibilities and the safe bet is on a BG or GB combination at 66.6%.
JPicasso on December 31, 2008 4:59 AMI'm going to go with 50% (neqlecting the fact that birthrates are not equally divided between the sexes). Since we are given no information by the woman about her second child then that child has an equal probability of being a boy or a girl.
Jonathan Hollin on December 31, 2008 5:01 AMOne other thing: Statistical reasoning becomes fundamentally and utterly DIFFERENT depending on whether you're asking what the odds are something WILL HAPPEN, or whether something HAS HAPPENED.
Jeroen on December 31, 2008 5:02 AMI getting more and more proofs that 2/3 is the correct answer.
So my 1/3 answer is probably wrong.
Note to self: Don't think too much. Don't try to be oversmart. Better luck next time.
Niyaz PK on December 31, 2008 5:02 AM@drscroogemcduck,
You were correct. Sorry for the confustion. My fault. :)
Niyaz PK on December 31, 2008 5:03 AMThe prior information you have here is that the person has 2 children of which (at least) one is a girl. This means there is no condition on the probability of the other child.
The probability of it being a girl is (close to) 50%
Jan Oosting on December 31, 2008 5:07 AMIt's a simple conditional probability problem. We have two trials, and we know the outcome of the first trial. The order that the couple had the children in is irrelevant, all that matters is the order that we find out about them.
Possible trials:
B/G (we know they have a boy, we guess the second is a girl)
B/B (we know they have a boy, we guess the second is a boy)
G/G (we know they have a girl, we guess the second is a girl)
G/B (We know they have a girl, we guess the second is a boy)
First trial: Girl. This is the data we are given a priori. This means that scenarios #1 and #2 above are impossible because the first trial result was G and not B. The only remaining two possibilities, given that we know the first trial was a G are G/G and G/B. The answer (barring any unequal weighting of gender occurrence due to socioeconomic or other concerns) is 50%.
Andrew on December 31, 2008 5:09 AMThis is all bordering on the ridiculous.
This has nothing to do with statistics, probabilities, etc.
If someone walks up to you and says "I have two children, one of which is a girl", the correct assumption is that the other child is "not girl". So you can consider the probabilities of a hermaphrodite, or you can assume the other child is a boy.
The premise smacks of "Hi, I'm Jeff Atwood, and I'll get to prove a point later about how nerds think by asking a relatively innocuous question"
transiit on December 31, 2008 5:10 AMSo wait, can a 66% person explain simply and clearly to me why the specified sex of the first child matters?
If we make the assumption of 50% M/F chance, then to me the question could be read as "I have two children. Ignore one of them, what are the odds that the other child is a boy?"
How come you treat the sex of one child as dependent on the sex of the other? I'd genuinely like to understand the reasoning you follow.
Rob on December 31, 2008 5:10 AMThinking about this in a different way:
Probability assumes that if you are faced with only 2 choices, say a coin flip of heads or tails, regardless of what the last coin flip resulted in, the subsequent flips always have a probability of 50%. No matter how many times you flip a coin, the odds of getting heads is always 50%. Now if we apply that to the problem mentioned above, the fact that they have 2 children and one is a girl, is irrelleavent. The probability of having a boy as a second child is still 50%.
Linguistically, I'd place the odds at or around 100% of that person having one boy and one girl. Not many normal people would say "I have two children and one of them is a girl", if the other one was also a girl.
But this is a blog written by a programmer, so linguistic rules are superseded by the rule of Logic. The four possibilities are:
BB
BG
GB
GG
Since you know the first possibility is out based on the problem statement, you're down to three possibilities. That leaves you with a 2/3 probability that the person has one boy and one girl.
You can read about a similar problem in my blog post on the Monty Hall Problem (http://www.billthelizard.com/2008/12/monty-hall-problem_20.html). Read the comments for an interesting variation and its solution.
Bill the Lizard on December 31, 2008 5:13 AMOk. First of all it's 50% (excluding small factual deviations in the rate). For those people who are not convinced of conditional independence let's look at it in detail:
First make the table for the girl being the oldest (with prob 50%):
Oldest, Youngest
G, B -> 50% * 50% = 25%
B, G -> 0%
B, B -> 0%
G, G -> 50% * 50% = 25%
Now youngest (prob. 50%):
Oldest, Youngest
G, B -> 0%
B, G -> 50% * 50% = 25%
B, B -> 0%
G, G -> 50% * 50% = 25%
Adding it all up comes to 100%.
There is 25%+25% chance for 2 girls, 25% chance for G,B, and 25% for B,G. As in this case we do not care about order this means 50% chance for 2 girls and 50% chance for a boy and a girl. Take out the one girl we know of (and have the other child left) we have a probability of 50% boy and 50% girl.
The answer should be 2/3.
The two children is distinct. Suppose they are named A and B.
There can be 4 possible combination:
1) A is a boy. B is a boy.
2) A is a boy. B is a girl.
3) A is a girl. B is a Boy.
4) A is a girl. B is a girl.
Now we know that one of them is a girl. So we can eliminate choice 1). We have 3 choices left. 2) and 3) is the situations with one boy and one girl. So, the odds of one boy and one girl is 2/3.
I have followed the same links. dont remember the sequence now! ended up the same article on the wikipedia, making me think of the same question. I was asking the same thing to my friends a few days ago. wow.
Onur BIYIK on December 31, 2008 5:14 AMMy solution:
If you have 2 children, there are 3 different combinations:
B-B
B-G
G-G
therefore are there 1/3 chance that there are a boy and a girl.
But we now that the person has one girl, wich mean that we can eliminate the B-B solution. That leaves us with:
B-G
G-G
now there is 1/2 chance, wich is my solution.
Andreas on December 31, 2008 5:14 AMYou know... there might be a slight possibility the other child may be intersexual.
Spike on December 31, 2008 5:15 AMFirst of all, anyone who poses the problem this way is just intentionally making trouble. This is not a "real world" problem. Frustrating. As the linked article shows, there are realistic ways of stating this problem that do cause confusion and incorrect answers. Anyway...
My instinct was to go with 1/2. But I'm now convinced it is 2/3.
You are told that a family has two children. You are asked to compute the probability that they have one of each. The possible combinations are: BB, BG, GB, GG. So the odds of BG or GB = 2/4 = 1/2.
You are now told that one of the children is a girl. You are not told *which* one. The only possibility you can eliminate then is BB, leaving: BG, GB, GG. So the odds of BG or GB = 2/3.
Now we change the question slightly: "I have a daughter. My wife is pregnant. What are the odds that after she gives birth I will have both a son and a daughter?" In that case the list of possible combinations is reduced to: GB, GG. The first child must be G. So the odds of GB = 1/2.
michael on December 31, 2008 5:15 AMAll these comments are SO ridiculous. The answer is blindingly obvious.
"you met someone who told you they had two children, and ONE of them is a girl" [emphasis mine]
My reading of that sentence tells me that ONLY ONE of the two children is a girl. What parent with two girls is going to say, "one of them is a girl"? Technically, yes, that's true, but, come on, what a ridiculous way to speak. That parent would be an imbecile.
Since a child can only be either a boy or a girl (discounting hermaphrodites), the other child is a boy.
100% probability of boy and girl.
Morgan Cheng: If the children are distinc, why don't you distinguish between girl1/girl2 and girl2/girl1?
Morten Christiansen on December 31, 2008 5:16 AMWhy are people assuming that there is no correlation between already having a girl and the odds of having another one? In other words there could be a connection between having a girl and the likelihood of having another one increasing. If not, please explain to my father in law why he has six girls and no boys!
Note that I'm not stating that this is the answer to the puzzle. I'm simply trying to point out a potentially flawed assumption.
Matt on December 31, 2008 5:22 AMFor the people who keep commenting on how silly it would be to say "One of my children is a girl" - please re-read what was written. There are no quotes to indicate what was hypothetically said. The text reads: "you met someone who told you they had two children, and one of them is a girl". The ONLY thing you can reliably infer from that is that the parent said they had two children. How you became aware of the daughter is not clearly stated.
It is ambiguous and seems to be the cause of much confusion.
Goomba on December 31, 2008 5:24 AMThe problem of not considering the order (i.e. treating GB and BG as the same event) is that then the probability of GB is not the same as the probabilities of BB and GG. In other words, having both a boy and a girl is more likely than having two boys (or two girls). So it is not correct to assign them all equal probability of 1/3 and then conclude the final answer of 1/2.
I therefore side with the people who consider GB and BG as distinct (and equally probable) events.
Beerguy on December 31, 2008 5:27 AMI say 2/3. Here's my reasoning
Suppose you gathered all the parents of two children in a room. Half of them would be parents of a boy and a girl. A quarter are parents of two girls. A quarter are parents of two boys.
Now you send all the parents of two boys out, leaving all parents who qualify for our hypothetical situation. However, only one third of those remaining have two daughters. Hence two thirds of parents-of-two who have at least one daughter also have a son.
Mark Heath on December 31, 2008 5:27 AM2/3 : You have 4 possible combinations of children: boy-girl, girl-girl, boy-boy, and girl-boy. The person just eliminated one of them. That leaves two out of three combinations possible, and two of them are correct.
I'm curious to see how other people think.
Tristan on December 31, 2008 5:31 AMThe birth order of the children has absolutely no bearing on the final result, it doesn't matter whether the girl is older then her sibling or not. Also, let's assume that this isn't some kind of trick question. The question here is how many people understand simple Bayesian probability. The answer is not many.
37,5%. Vince is correct
2 children, one is a girl
Just 50% possibility that the other child is a boy is correct only if we play in the whole(100%) space of the possibilities. Since we know that there is at least one girl the space is reduced to 75%.
So 50% of 75% is the answer.
Nikos on December 31, 2008 5:34 AMI am not surprised this has provoked a Monty Hall Problem storm of comments. The answer is that if there are two children, and we know that one of them is a girl, then the probability that the other is a boy is 2/3.
Consider all of the (equally likely) possibilities for a family with two children:
girl-girl
girl-boy
boy-girl
boy-boy
We strike the fourth case out: We know they do not have two boys. Therefore we are left with:
girl-girl
girl-boy
boy-girl
In two out of those three cases, the other child is a boy. In one out of those three cases, the other child is a girl. This is the case when they announce that one of their children is a girl. On the other hand, if they announce that (for example) their *oldest* child is a girl, only the following cases apply:
girl-girl
boy-girl
Now the odds that the youngest child is a boy are 1/2, not 2/3.
Reg Braithwaite on December 31, 2008 5:44 AMFor those claiming conditional probability, please use the right numbers. Taking the obvious road with equal probabilities for boys and girls, and ignoring edge cases like hermaphrodites or whatever.
P(A|B) = P(A [n] B) / P(B)
The only condition is that at least one child of two is a girl. It is pretty self explanatory that:
P(at least 1 girl) = 0.75 (this is 1-P(two boys))
and also:
P(exactly 1 boy) = 0.5
P(exactly 1 boy [n] at least 1 girl) is still 0.5, because exactly one boy directly implies 1 girl.
So, the conditional probability is:
P(exactly 1 boy | at least 1 girl) = 0.5 / 0.75 = 2/3
Mark Heath: I can't argue that what you say does not give two thirds. However, I'm not convinced that the case you state matches the original question.
It's all very nice to endlessly restate the problem in different forms and shapes, but you need to carefully argue that the problems are the same for it to be of any significance (which I don't find it to be, but the question seems to be open for interpretation).
Morten Christiansen on December 31, 2008 5:44 AMjake wrote: "firstly, the guy who mentioned conditional probability,
well, that is a crock of... gender of one has no influence
on the other. the are called mutaully exclusive events.
so bayes theorem doesn't fly."
Uh, you are thinking of *independent* events, meaning they do not influence each other. Mutually exclusive events are events that *cannot* both happen.
http://en.wikipedia.org/wiki/Mutually_exclusive
I think the 50% people are confusing the question with this one: "if I already have a girl what is the probability that my next child will be a boy?", and not "I already have 2 children, one of them is definitely a girl, what is the probability of me having a girl-boy pair?"
The difference is subtle perhaps, but real.
Ian on December 31, 2008 5:47 AMIf I flip a coin, what are the chances of it landing heads up? 50% right? Okay, now if I tell you that I've just flipped the coin 10 times and each time it landed on heads. Does that make a difference to the outcome of the current flip? No.
This is essentially the same question. And the answer is the same too.
Andrew Newdigate on December 31, 2008 5:47 AMI think the true answer is that Jeff's wife is pregnant again and this is his way of teasing it out.
blearghhh on December 31, 2008 5:48 AMI have to side with the 50%ers.
I think any other answer takes too much info into account. We are told there are two children and one is a girl. So the only unknown is the gender of the second child. I see no need to include the gender of the known child in the probability equation.
%100 - someone would not tell you "one of them is a boy" if they had 2 boys. so it must be 1 boy and 1 girl.
bryan on December 31, 2008 5:50 AMA note to the conditional probability folks: You are NOT given that there are two trials and you know the result of one specific trial. You are given two trials and you know the result of one or the other trial.
As for whether Jeff is playing PuppetMaster and this is all about how "nerds" think, I point out that this is a well-known problem which you will face in first-year University if you haven't already seen it in High School or read about it in a recreational mathematics book.
If someone wants to try to make inferences about how *I* think, the inference you can draw is this: I think I've heard this one before :-)
http://en.wikipedia.org/wiki/Monty_Hall_problem
Reg Braithwaite on December 31, 2008 5:50 AMThe odds that person has a boy and a girl are fifty-fifty.
Emanuel Cunt on December 31, 2008 5:53 AMLet's say that there are 100 women with 2 children. Naturally, 25 of them will have 2 boys, 25 will have 2 girls and 50 women will have one boy and one girl.
You met one of these women and she said "I am not in the first group". Now the probability of she being in the second group is 50 / 75 = 2 / 3.
serhat on December 31, 2008 5:53 AMLet's say that there are 100 women with 2 children. Naturally, 25 of them will have 2 boys, 25 will have 2 girls and 50 women will have one boy and one girl.
You met one of these women and she said "I am not in the first group". Now the probability of she being in the second group is 50 / 75 = 2 / 3.
serhat on December 31, 2008 5:53 AMIf she already has one Girl than there are 3 possible combinations to the birth order:
G - B
G - G
B - G
So the probability he has a boy and a girl is 2/3.
But, if she said: "ONE of them is a girl" than the other one is necessarily a boy, and the probability is 100%.
Yoav on December 31, 2008 5:53 AM@Andrew Newdigate
You are answering the wrong question. The question does not concern a future flip of the coin, it concerns flips that already happened. If you flipped a coin twice, what is the probability that it came up heads twice? 0.25
If someone told you that one of the flips was heads (but did not say which), now what is the probability that they were both heads? It's not 50%, because you have both the possibility that the first flip was tails, and the possibility that the first was heads while the second was tails, to eliminate.
If someone told you explicitly that the FIRST flip was heads, then the probability of two heads is indeed 50%.
Sigh on December 31, 2008 5:54 AM100%
2 Children
1 of them is: Girl
Only option left is: Boy
Let's try booleans:
I have choosen two booleans. One of my choices was false. What is the odds that I've also chosen true? (remember I've chosen two... It's impossible for the odds to be false because that would mean I've only chosen 1 boolean.)
Let's try up/down:
I'm pointing in two directions with both of my hands. One of my hands is pointing down. What is the odds that I'm also pointing up? 100% of course, because I'm pointing in TWO directions not one.
Same thing applies with male/female with the way this thing is worded.
Lloyd Cotten on December 31, 2008 5:55 AMLet'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?
0%
He had two.
Now he has
So he doesnt have
stevoo on December 31, 2008 5:58 AMThe question is "I have two children - what is the chance that I have a boy and a girl?"
So it's 50%.
In code (Oracle PL/SQL for a change of pace):
declare
v_boy_girl NUMBER;
v_first_child NUMBER;
v_second_child NUMBER;
v_iterations NUMBER := 100000;
begin
FOR i IN 1..v_iterations LOOP
v_first_child := round(dbms_random.value(0,1)); -- 0 = girl, 1=boy
v_second_child := round(dbms_random.value(0,1)); -- ditto
IF v_first_child + v_second_child = 1 THEN -- 1 boy and 1 girl
v_boy_girl := nvl(v_boy_girl,0) + 1;
END IF;
END LOOP;
dbms_output.put_line( 'percentage that is boy/girl '||v_boy_girl*100/v_iterations );
end;
percentage that is boy/girl 49.929
Dave on December 31, 2008 5:59 AM@Andrew Newdigate: no, it's not the same question. There's a big difference between asking
"I've just tossed a coin 10 times, all of which came down heads. What are the odds that the next toss will be a tail?" (1/2),
and
"I've tossed a coin 11 times, at least 10 of which came down heads. What are the odds that the other toss was a tail?" (11/12).
jpsa on December 31, 2008 5:59 AMI wonder if this post will get read so far down the list... but here goes:
ASSUMPTIONS:
1) The chances of having a boy (as a first or second child) is roughly 50%.
2) The mother gave birth to both children and was not able to pick their sex (ruling out adoption and picking a girl because she didn't want boys)
3) The mother has only two children (I could say I have one kid, which is true, but I also have two kids)
4) The other child is EITHER a boy OR a girl (not a hermaphrodite, though the chance of being on would probably be too small to consider)
Given these assumptions, the chance of the other child being a boy is 50%. It doesn't matter what the sex of the other child is, assuming every time you have a child there is a 50% chance it will be a boy.
I think this problem was posted to bring up a point about assumptions and not having enough information to solve a problem.
kbo on December 31, 2008 5:59 AM"Hey man, haven't seen you since your wedding! How've you been!"
"Great! I've got two kids now -- that's my daughter Denise over there."
-- and we have the possible question without the bias, which forces the answer of 66%, because order matters. Let me ask two related questions, to show the distinction.
I flip two coins, hidden from view. You ask if either coin is heads; By way of answer, I take one of the two coins -- you don't know which -- and place it out for you to see that it's heads. What are the odds that the other is tails?
I flip two coins, the first openly, the second hidden from view. The one you can see is heads. What are the odds that the other is tails?
They are not the same question, because the information you have is different.
Trevel on December 31, 2008 6:00 AM(without peeking)
It depends on how they say it. If they say, "one of them is a girl", then it's pretty clear that the intention is that the other one isn't.
If instead they say something in passing that indicates that one of them is female, I think the odds are roughly 50/50 for the other one. I believe slighly more boys are born than girls, but it's roughly 50/50.
T.E.D. on December 31, 2008 6:02 AMThe SQL 'solution' completely missed the point that one of the children was a girl...
Sigh on December 31, 2008 6:04 AMOK. After reading through the comments I'm starting to wonder what the point of this post is.
I am a bit dejected by the amount of people who think that getting one outcome somehow magically decreases the odds of getting that same outcome when you try again. Still, they were a minority. A minority that Las Vegas would love to get hold of, but a minority. :-)
T.E.D. on December 31, 2008 6:07 AMAha, I see Keith Devlin has a new book out ;)
I actually had to google frantically for this because there's too many variables that are caused by the wording. Like Ishmaeel says, we don't know enough about the speaker and their intentions to be able to give a proper answer. Having said that, if I disregard the imprecision of the problem as it's laid out, and take it on faith that the proud parent just wants us to guess what sex their other kid is, I'm going to have to sit in the 2/3rds camp. It's not intuitive, and I did struggle against that for a couple of hours, but 2/3 is right, 50% is not - reading about Pascal's Triangle is what's finally beaten the right answer into my head.
Good puzzle, though, Jeff - lots of developers getting nice and frothy over it :D
HollsK on December 31, 2008 6:07 AMThe answer is 2/3. The problem is the explanation for this is normally AWFUL! It's confusing to people why GB and BG are different? They aren't. The difference is in the probability of a couple having GB, BB, GG. It is not 33%, 33%, 33%. It is 50%, 25%, 25%. People are twice as likely to have one of each.
Therefore if we know we have one girl then, GB (50%) and GG (25%) is the set of possibilities allowable. Therefore it is twice as likely the couple has a boy than a girl.
TJ on December 31, 2008 6:09 AMstatic void Main(string[] args)
{
Int64 testsToDo = 100000000L;
Int64 boys = 0;
Int64 girls = 0;
bool child1;//True = girl
bool child2;
Random r = new Random();
for (Int64 test = 0; test < testsToDo; test++)
{
if (r.NextDouble() <= 0.5)
child1 = true;
else
child1 = false;
if (r.NextDouble() <= 0.5)
child2 = true;
else
child2 = false;
if (child1 == child2 == false)
{
//No girl, drop test
}
else
{
if (child1 == true)
{
//Child1 is girl
if (child2 == true)
girls++;
else
boys++;
}
else
{
//Child1 is boy, child2 must be girl
boys++;
}
}
}
Console.WriteLine("Boys: {0} ({1})\nGirls: {2} ({3})", boys, (double)boys / (double)(boys + girls), girls, (double)girls / (double)(boys + girls));
}
Result:
Boys: 24993725 (0,499959003070699)
Girls: 24997824 (0,500040996929301)
Keeping it purely mathematical, i'd says 50% chance without knowing what the male to female ratio is.
However, if a person is speaking to you about there family, if both children were girls, they would likely say I have two girls. They would generally not say, I have one girl and the other is a girl too. So in this case with this particular example, I would have to say that there is a 100% chance that the other child is a boy.
Now to reading the comments...
Scot McPherson on December 31, 2008 6:09 AMgod programmers are dumm
plceli on December 31, 2008 6:10 AMI would have to guess around 90%. This is because of 2 things, the already mentioned BB, GG, GB, BG solely would produce 66% odds of the other child being a boy. However, we also must add that still in the world today having a boy is more important than having a girl. So by that logic a % of parents whose first child is a Boy will not have a second child and a % of parents who have 2 girls will keep on having children until they can no longer support them or they have a boy and knock themselves out of this situation.
Ben on December 31, 2008 6:10 AMWithout looking up the odds of identical births somewhere we don't have sufficient information to determine the answer. My prediction is that this is Jeff's way of telling us he and his wife have twins on the way.
David Sheeks on December 31, 2008 6:15 AM"god programmers are dumm"
dumm...
No shid
A programmer on December 31, 2008 6:17 AM@Patrik: *cough* *ahem*
> if (child1 == child2 == false)
try
if (child1 == false && child2 == false)
:)
jpsa on December 31, 2008 6:19 AMZERO.
If they say they _had_ two children, then they no longer have two, they either have no child or just one. Since they say one _is_ a girl, that's the only one. I know, I'm pushing it :)
Depends on if you want the answer in pure science, or pure stats.
Science:
More boys are born by girls. By 20, the numbers even out, because boys have a higher mortality rate (sex-linked diseases being but one factor). Also, if your first is of one sex, it is more likely that the next will be of the same sex, because men do not always produce 50/50 sexes in their sperm.
Stats:
Possible combinations:
BG
GB
GG
BB
BB is now invalid. The other options are GG, BG, GB. The options for the other sibling are G, B, B. So 66%.
In reality, it's probably a bit lower (see the above science).
Katie on December 31, 2008 6:24 AM2/3
With two children, there are four possiblities: BB, GG, BG, and GB, each with equal probability.
That there is one girl takes the BB result out of play, leaving, the other three, each with equal probaility.
Two of those are one boy, one girl, so the probability is 2/3.
JohnMcG on December 31, 2008 6:24 AM2/3
All the possibilties are
BG
GB
GG
BB
BB isn't possible leaving BG, GB and GG; so it's two thirds
Saral on December 31, 2008 6:24 AMI feel a huge urge of upvoting and downvoting some of the comments. :)
Marcel on December 31, 2008 6:24 AMAh, oops :)
New result:
Boys: 49999062 (0,666620393455004)
Girls: 25004737 (0,333379606544996)
Ah, oops :)
New result
Boys: 49999062 (0,666620393455004)
Girls: 25004737 (0,333379606544996)
I feel a huge urge of upvoting and downvoting some of the comments. :)
Marcel on December 31, 2008 6:26 AMReading the comments brings home the notion that when people use "or" in conversation, they typically mean exclusive OR rather than logical OR.
I, on the other hand, usually mean bitwise OR. (:-)
JohnMcG on December 31, 2008 6:26 AMIt's 2/3.
- This is the sequence of events: (1) I make my first child, chance 1/2 to be a boy, 1/2 to be a girl. (2) I make my second child, same chances.
- If I were to ask you: what's the chance that I have at least one girl, you would pick {GG,BG,GB} from all the possible combinations {GG,BG,GB,BB} each combination has a chance 0.5*0.5. So 3*0.25 = 3/4. Easy.
- Now this is the mistake many of you are making. If I say my FIRST child is a girl, what is the chance I have a girl and a boy? You know for sure that my first child was a girl, so what you need to know is: what is the chance my second child was a boy, to get GB. The chance is 50%. This is what many of you are thinking. If I would say: my second child is certainly a girl, the reasoning stays the same (50% to get BG).
- BUT I have not told you which child is the girl! It could be the first, it could be the second, it could even be both! (I have not told you if the first coinflip was heads, or the second one was heads!) Let's list all the possible combinations in the end:
BB --> this is impossible, because then I could not tell you that one of my childs is a girl.
GG }
GB } These are all possible. Chance of this subgroup is 0.75.
BG }
Now that we have established this, which elements of the subgroup are we looking for: {BG,GB}, chance of appearing within this subgroup: 2/3.
(- Another way of formulating the problem: I tell you that I DON'T have two boys, what's the chance of having a Boy and Girl?)
* Assuming that there is an equal 50% chance to get a boy or a girl.
* Assuming that "and one of them is a girl" =/= "ONLY one of them", it could be either one girl, or two girls.
Here is why it is not 50%:
Any person that have 2 children have one boy and one girl with %50 probability already.
After learning one of them is a girl, is not this probability supposed to increase?
serhat on December 31, 2008 6:27 AMIt's 2/3.
- This is the sequence of events: (1) I make my first child, chance 1/2 to be a boy, 1/2 to be a girl. (2) I make my second child, same chances.
- If I were to ask you: what's the chance that I have at least one girl, you would pick {GG,BG,GB} from all the possible combinations {GG,BG,GB,BB} each combination has a chance 0.5*0.5. So 3*0.25 = 3/4. Easy.
- Now this is the mistake many of you are making. If I say my FIRST child is a girl, what is the chance I have a girl and a boy? You know for sure that my first child was a girl, so what you need to know is: what is the chance my second child was a boy, to get GB. The chance is 50%. This is what many of you are thinking. If I would say: my second child is certainly a girl, the reasoning stays the same (50% to get BG).
- BUT I have not told you which child is the girl! It could be the first, it could be the second, it could even be both! (I have not told you if the first coinflip was heads, or the second one was heads!) Let's list all the possible combinations in the end:
BB --> this is impossible, because then I could not tell you that one of my childs is a girl.
GG }
GB } These are all possible. Chance of this subgroup is 0.75.
BG }
Now that we have established this, which elements of the subgroup are we looking for: {BG,GB}, chance of appearing within this subgroup: 2/3.
(- Another way of formulating the problem: I tell you that I DON'T have two boys, what's the chance of having a Boy and Girl?)
* Assuming that there is an equal 50% chance to get a boy or a girl.
* Assuming that "and one of them is a girl" =/= "ONLY one of them", it could be either one girl, or two girls.
Reading the comments drive home the notion that when people use "or" in conversation, they almost always mean "exclusive OR" rather than "logical OR."
I, on the other hand, usually mean "bitwise OR." (:-)
JohnMcG on December 31, 2008 6:27 AMThe more I think about this problem, the more variables I come up with and the more assumptions I have to make. I'd think the best way to get an answer to this is to look at statistical data for parents with two kids and see how often on child is a boy when the other is a girl.
kbo on December 31, 2008 6:27 AMReading the comments drive home the notion that when people use "or" in conversation, they almost always mean "exclusive OR" rather than "logical OR."
I, on the other hand, usually mean "bitwise OR."
JohnMcG on December 31, 2008 6:27 AMIt's 2/3.
- This is the sequence of events: (1) I make my first child, chance 1/2 to be a boy, 1/2 to be a girl. (2) I make my second child, same chances.
- If I were to ask you: what's the chance that I have at least one girl, you would pick {GG,BG,GB} from all the possible combinations {GG,BG,GB,BB} each combination has a chance 0.5*0.5. So 3*0.25 = 3/4. Easy.
- Now this is the mistake many of you are making. If I say my FIRST child is a girl, what is the chance I have a girl and a boy? You know for sure that my first child was a girl, so what you need to know is: what is the chance my second child was a boy, to get GB. The chance is 50%. This is what many of you are thinking. If I would say: my second child is certainly a girl, the reasoning stays the same (50% to get BG).
- BUT I have not told you which child is the girl! It could be the first, it could be the second, it could even be both! (I have not told you if the first coinflip was heads, or the second one was heads!) Let's list all the possible combinations in the end:
BB --> this is impossible, because then I could not tell you that one of my childs is a girl.
GG }
GB } These are all possible. Chance of this subgroup is 0.75.
BG }
Now that we have established this, which elements of the subgroup are we looking for: {BG,GB}, chance of appearing within this subgroup: 2/3.
(- Another way of formulating the problem: I tell you that I DON'T have two boys, what's the chance of having a Boy and Girl?)
* Assuming that there is an equal 50% chance to get a boy or a girl.
* Assuming that "and one of them is a girl" =/= "ONLY one of them", it could be either one girl, or two girls.
Here is why it is not %50:
Any person that has two children has one boy and one girl with %50 probability.
Is not this probability supposed to increase after learning one of them is a girl?
serhat on December 31, 2008 6:28 AMReading the comments drive home the notion that when people use "or" in conversation, they almost always mean "exclusive OR" rather than "logical OR."
I, on the other hand, usually mean "bitwise OR."
JohnMcG on December 31, 2008 6:28 AMHere is why it is not %50:
Any person that has two children has one boy and one girl with %50 probability.
Is not this probability supposed to increase after learning one of them is a girl?
serhat on December 31, 2008 6:29 AMReading the comments drive home the notion that when people use "or" in conversation, they almost always mean "exclusive OR" rather than "logical OR."
I, on the other hand, usually mean "bitwise OR."
JohnMcG on December 31, 2008 6:29 AMIt's 2/3.
- This is the sequence of events: (1) I make my first child, chance 1/2 to be a boy, 1/2 to be a girl. (2) I make my second child, same chances.
- If I were to ask you: what's the chance that I have at least one girl, you would pick {GG,BG,GB} from all the possible combinations {GG,BG,GB,BB} each combination has a chance 0.5*0.5. So 3*0.25 = 3/4. Easy.
- Now this is the mistake many of you are making. If I say my FIRST child is a girl, what is the chance I have a girl and a boy? You know for sure that my first child was a girl, so what you need to know is: what is the chance my second child was a boy, to get GB. The chance is 50%. This is what many of you are thinking. If I would say: my second child is certainly a girl, the reasoning stays the same (50% to get BG).
- BUT I have not told you which child is the girl! It could be the first, it could be the second, it could even be both! (I have not told you if the first coinflip was heads, or the second one was heads!) Let's list all the possible combinations in the end:
BB --> this is impossible, because then I could not tell you that one of my childs is a girl.
GG }
GB } These are all possible. Chance of this subgroup is 0.75.
BG }
Now that we have established this, which elements of the subgroup are we looking for: {BG,GB}, chance of appearing within this subgroup: 2/3.
(- Another way of formulating the problem: I tell you that I DON'T have two boys, what's the chance of having a Boy and Girl?)
* Assuming that there is an equal 50% chance to get a boy or a girl.
* Assuming that "and one of them is a girl" =/= "ONLY one of them", it could be either one girl, or two girls.
This is crazy. People have nothing else to do?
An error occurred:
Rebuild failed: Renaming tempfile 'C:\codinghorror\blog\archives\001203.html.new' failed: Renaming 'C:\codinghorror\blog\archives\001203.html.new' to 'C:\codinghorror\blog\archives\001203.html' failed: Permission denied
ZiG on December 31, 2008 6:32 AMThis many people have time on their hands to comment on this? Worldwide productivity must be cratering.
It is 50%. I know this because I went home and tossed all three of my children in the air 100 times each. Each child landed on their heads 50 times, their tailbones 50 times.
Science!
Jeff on December 31, 2008 6:33 AMAhhh, it's worse than <a href="/blog/archives/000781.html">Fizz Buzz!</a>
Reed on December 31, 2008 6:33 AMAll of you that brought in the 4 combinations (BG, BB, GG, GB) and said 66% are wrong! First lets rephrase Jeff's question. Say you met someone who had a little girl with them that they introduced to you as their daughter and they also proceeded to tell you that they had two kids. The daughter could have an older brother, older sister, younger brother, or younger sister. So the odds of it being a brother is 50%. The fallacy in your argument is as follows: You say they could have had a
Boy-Girl, Girl-Girl, Boy-Boy, or Girl-Boy
you are bringing ordering into question here. What you are missing here is that you dont know if the girl you know that they have is the older one or the younger one. Let's call the girl that you know they have Girl*. So the possibilities at this point are:
Girl*-Boy, Boy-Girl*, Girl*-Girl, and Girl-Girl*.
Still 50%.
Prasanna on December 31, 2008 6:34 AMgirl - boy
boy - girl
Why would these options be different? when did Jeff talked about time in is question?
the answer is 1/2
plceli on December 31, 2008 6:34 AMPossibilities lefts with the hypothesis :
- 1 boy (first) / 1 girl
- 1 girl (first) / 1 boy
- 2 girls
I'd say 2/3 is the chance to have a boy and a girl
Galephico on December 31, 2008 6:34 AMI vote 50%
If your point was to demonstrate how much of a headache statistics are, then bravo sir!
Joe Zack on December 31, 2008 6:37 AM@Fred: It's not P(exactly 1 boy | at least 1 girl) from a set of 4 possible outcomes. We know that there is at least 1 girl from all possible sets:
1 Boy, 1 Girl
2 Boys
2 Girls
We know that at least 1 is a girl, this isn't a probably it's a priori information:
P(at least 1 girl) = 1
leaving us with two possible results:
1 Girl, 1 Boy (the one we can't see is a boy)
2 Girls (the one we can't see is a girl)
P(exactly 1 boy | at least 1 girl) = 0.5 / 1 = 0.5
You're confusing the probability that we MIGHT have at least one girl with the a priori knowledge that we DO have at least 1 girl. Having the girl is given with probably of 1, not 0.75.
For everybody who says 2/3. Keep in mind the three options, excluding the "2 Boys" option:
Seen | Unseen
----------------------------------------------
1 Girl | 1 Boy (the one we can't see is the boy)
1 Boy | 1 Girl (the one we can't see is the girl, IMPOSSIBLE since knowing the girl exists is part of the problem definition)
1 Girl | 1 Girl (the one we can't see is also a girl)
The results B/G and G/B are not equivalent, and B/G is not possible due to the problem definition while G/B is.
Andrew on December 31, 2008 6:38 AMHere's why the order of the children matters:
If someone already has two children, there is exactly one way they could have gotten either two girls or two boys BUT there are two ways they could have gotten a girl and a boy (either the boy first or the girl first). Therefore, the probability of having a boy and a girl is twice as high as having two same-sex children.
Now, ruling out the boy-boy option because we know at least one child is a girl, we're left with boy-girl, girl-boy and girl-girl. 2/3 it is :-)
First I said 50%
Now I say 66%
come on Jeff What're you up to? planing another child? or trying to make a point about programmers minds?
Ino on December 31, 2008 6:40 AM@Daan
so the question should have been:
What are the odds that person has a boy then a girl?
Wow, people are still arguing for 50%, even in the face of programs that prove otherwise...
@Prasanna:
Girl*-girl and Girl-girl* still have a TOTAL 25% probability of occurring.
@plceli:
It has been pointed out many times, the two are different because each has a separate 25% chance of occurring, making a boy/girl pair twice as likely as a same-sex pair.
Thought experiment:
I go to a mall and ask people "tell me about your kids."
Some very small % of people respond "Well, I have two children, one of them is a girl."
You'd be intrigued. What a strangely phrased answer. Either they are goofing with you, tricking you into thinking that the other is a boy, or they just phrased their response awkwardly.
My guess is that if 100 people responded "two children, one a girl", somewhere in the neighborhood of 97% of them have one girl, one boy.
Ryan Walker on December 31, 2008 6:45 AMSomeone help my feable brain and tell me how this question differs from Jeff's.
If I flip a nickel twice and the first time it landed on heads what are the odds that the second time it landed on tails?
Tony on December 31, 2008 6:45 AM3 possible sets when someone has 2 kids are (B,B), (G,G), (B,G) = (G,B)
Since we are certian that 1 of them is a Girl, (B,B) can be eliminated.
out of the remaining 2 possibilites, the odds to get 1 possibility i.e. (B,G) is 1/2.
I see two ways to look at this:
1) Order matters (and generally children will be born one at a time), which gives:
BB
BG
GB
GG
so 66% chance of the other being a boy, given one is a girl.
2) Order doesn't matter (say they're born at the same time, ie. twins. or maybe order just doesn't matter), which gives:
Two boys
One boy, one girl
Two girls
so 50% chance.
I hate probability with a passion.
kbo on December 31, 2008 6:48 AMLet's assume that 5% of the population consists of people who think it's funny to say things like "one of my children is a girl" even when both are girls. The other 95% are reasonable people who would only say that phrase if they had a girl AND a boy. Of the 5% who like being obtuse, only a third will get to use the joke. Some will have 2 boys, some 2 girls, some a boy and a girl. Since the order is unimportant, we only have 3 possible combinations (BB, GG, BG) and, because we can't use the web to get exact numbers, let's assume that probability for any child is roughly even odds, +/- 5%.
So, if someone utters that phrase, they've eliminated themselves from the BB set. 95% will mean that they have a girl and a boy. Of the 1/3 of 5% that are delighted to get to use the 'joke', I'd go with 98.3% chance that the other child is a boy (only 1.7% of the population will have the opportunity to use the joke AND will think it's funny).
Scott on December 31, 2008 6:48 AMWell, demography tells us that the odds for giving birth to a boy is about 52%. So we get the following probability for having a boy and a girl: 0.52 * 0.48 + 0.48 * 0.52 = 0,4992. So, as you see, the odds are a bit less than 50% but very close nontheless.
Malcolm on December 31, 2008 6:48 AMSince genetically the probability of having a boy or a girl is a 50-50 proposition, if someone tells you they have a girl and one other child, then the other child is very likely to be a boy. I would say in the neighborhood of 98%.
Al on December 31, 2008 6:48 AMIf they say that one is a girl, common English usage in this context would be to interpret this to mean "exactly one is a girl". In other words, their other child is not a girl, and is therefore a boy.
100%
Dominic Cronin on December 31, 2008 6:49 AM> So wait, can a 66% person explain simply and
> clearly to me why the specified sex of the first child matters?
It's not the first child that is specified, it's eighter the FIRST OR THE SECOND that is specified.
The fact that you can look at both childs and pick one of them gives the mother more information than in the case "what will my next baby be".
But I vote for 100%, it's a language question, not statistic.
@George
my mind just exploded :)
ok... the answser is 2/3
The correct answer is 50%. Anyone who said 66.7% because they reasoned that there were three possible combinations (BG, GB and GG) is forgetting that it doesn't matter what *order* the siblings are in (BG/GB)--all that matters is the gender of the second child.
That leaves two possible combinations (assuming we eliminate hermaphrodites and other non-boy/girl possibilities): BG or GG. The correct answer is 50%.
Scott Gammans on December 31, 2008 6:51 AMPeople reducing the problem to sets:
This is not the same as probability.
I have a custom dice that has '1' on five faces, and '6' on the last face. The possible results are 1 and 6, but the probability of rolling a 1 is not 0.5.
Specifically regarding this problem, the BG pair is more likely than the BB or GG pairings.
@Andrew: You have the same problem with your conditional probability, which is why I take the known probabilities from the total possibilities.
Fred on December 31, 2008 6:52 AMActually it's not exactly 50%. Logically it should be 50% since it should only be possible to have a Boy or a Girl (ignoring for the moment hermaphrodites and other possible outcomes). The reality is that the is a slightly higher chance of a one or the other. Now if I could only remember the actuality of the article I read, but I'm mostly certain that you're actually more likely to have a girl than a boy for any given pregnancy (something like 51% girls to 49% boys). It seems to vary based on a lot of factors (parents occupations, environmental conditions, overall health of the mother). I know that they were investigating why fighter pilots tended to throw girls at a drastically higher ratio, something on the order of 55% girls.
Elephant on December 31, 2008 6:52 AM@Tony: His Question is: "If I flipped a nickel twice and at least one of the two times it landed on heads what are the odds that it landed on tails once?"
bdot on December 31, 2008 6:53 AMStill orange. If I ever write a virus it will come here and leave inane comments about apple - company and fruit alike - maybe some about both at the same time. I will call it orange.
66%. One is a girl. Not zero, not not both.
Methinks Jeff is playing on the fact that people will do your work for you if you ask them in a blog post. See also fizz buzz - Jeff had to close comments because people couldn't wait to tell you how to write fizz buzz in fortran and let everyone know why it was the optimal solution. http://tr.im/2rza (Sweet, I got RZA in my trim. I should go play some Wu Chess)
monoclemonkey on December 31, 2008 6:53 AMLet's say, hypothetically speaking, you met someone who told you they had two children, and one of them is named Buzz. What are the odds that person has another child named Fizz? More importantly, what happens when Fizz turns 3 and Buzz turns 5?
Chris C. on December 31, 2008 6:54 AMjpsa wrote:
There's a big difference between asking
"I've just tossed a coin 10 times, all of which came down heads. What are the odds that the next toss will be a tail?" (1/2),
and
"I've tossed a coin 11 times, at least 10 of which came down heads. What are the odds that the other toss was a tail?" (11/12).
-------------------------------------------------------------
Very well stated. If I didn't know that the intuitive answer (50%) should be challenged, I would have said 50%. With one being a girl, there are clearly 2 options for what the other child must be: a Boy or a Girl -- 50% but just because there are 2 options doesn't mean that there are only 2 combinations.
In this case, order matters. So there are 3 combinations, 2 of which produce B-G. 2/3
To those of you arguing that it's 100% because no one would say they "have 2 children and one is a girl" if the other one is also a girl. You are insufferable fools and should go away.
Bob on December 31, 2008 6:54 AMwhat are the chances of the second child being transgendered?
funkymushroom on December 31, 2008 6:55 AMMy goodness, this is absolutely fascinating. Someone alert Stephen Fry!
I can't stop reading these comments, even though they make my eyes bleed. We are all such passionate defenders of our conclusions. When math and/or science are on our side, we have the power to hurl lightning bolts of reason across the blogosphere. Double that magick when we are clever enough to spot a situation where mere mortals fail to understand reason.
I hope that whenever Jeff publishes his answer, we do not all find ourselves a little to clever by half (or is it 2/3?).
Chris on December 31, 2008 6:56 AMTHIS IS SILLY
Those of you saying 100% are just being pedantic and are making assumptions about "common English usage" which are not correct.
THERE ARE ACTUALLY TWO ANSWERS DEPENDING ON HOW YOU INTERPRET THE QUESTION:
1) The lady's first child is a girl. What are the odds that the next one (yet to be born) will be a boy? Answer: 50%
2) One of the lady's existing two children is a girl. What are the odds that the other one is a boy? Ignore the order that they were born. Answer: 66%
They are two entirely different questions with entirely different answers.
Matt on December 31, 2008 6:56 AMif we assume saying one is a girl does not mean the other is not, then we have 3 scenarios.
F=First Born, S=Second Born
F S
G B
G G
B G
Based on those 3 possibilities, there is a 2/3 chance they have a boy.
In a longer way...
Taken individually, there's an assumed 50% chance of having a boy and a 50% chance of having a girl on any one birth. So if they have a girl, there should be a 50% chance they have a boy (we're not assuming identical twins, just individual births).
The this assumption needs to be elongated though to the whole system.
F S
B B 25%
B G 25%
G B 25%
G G 25%
There's a 50% chance they have one boy and 1 girl, 25% chance they have two boys, and a 25% chance they have two girls.
But the first option isn't available. This adjusts to the remaining options to 1/3, 1/3, 1/3 and the two with boys totaling 2/3.
P(B|G) = 2/3
awptimus on December 31, 2008 6:56 AMThe paper answer is 2/3, for the reasons lots of people have given.
The correct answer is "Why did they tell you that? What else do you know? What the fuck's going on?"
Take an easier question: what's the probability that they have at least one girl? On the basis of what they said it's 1. But maybe the person is lying. Maybe they have no children at all, but are doing a television program on mathematical knowledge - that's the most likely answer of all.
According to yesterday's Washington Post, AIG Financial Products calculated the probability of losing money on their CDS deals at 0.15% I suspect they got the maths right. How did that work out for them?
I guess that's why they teach so much maths in studies related to computer science. With not very much success, it seems.
cheers!
For those who don't like Bayes, let's use a frequentist approach - axiomatically defining probability as a fraction of a population. So what is the population here? Let's assume that we're on an island with, say, 2000 families. Of these, let 1000 families have two children:
- 250 have 2 boys (set A),
- 500 have boy/girl (divided 250 oldest boy (set B), 250 oldest girl (set C)), and
- 250 have 2 girls (set D).
If we keep selecting a family at random until we find one that has two children, at least one of whom is a girl, then we will have a population of 750 (sets B, C, D). Clearly, of this population, 500 (sets B & C) also have boys, leading to a 2/3 probability.
But is this the only way to select families? What if we put all the girls from two-child families into a room, and pick one at random, and use her family? There will be 1000 such girls. 500 come from set D families (since each family has two girls), 250 from set B, and 250 from set C. So half of the time, these girls will have a brother.
I think that the first selection method is more likely to be what the question meant. But it doesn't take much to suggest the second method: "I was delivering a pizza to a girl's birthday party. Given that there were two children in her family, what is the probability she has a brother?"
Charles Dark's question does the same thing another way. What if we know that it is the *eldest* child who is a girl? If we use the first selection method - choose a random family until we have one where the oldest child is a girl, then there will be 500 families (sets C & D), and only 250 of them will have a boy in the family. So the answer here would be 50%.
How important is the birth order information? Would it work if we considered, say, the *tallest* child (assuming no equal heights, equal boy/girl height distributions, etc)? Yes. We would use slightly different terms in defining sets A-D, but the numbers & logic would be the same.
So using the frequentist (rather than Bayesian) view of probability, the subtleties in the wording of the question lead to different populations, and hence different probabilities.
Something I find really interesting thing is how difficult it can be for intuition to get these right. Probability seems so elementary - yet apparently simple problems like this, Monty Hall, Blue Eyes/Brown Eyes cause such trouble.
Blue Eyes/Brown Eyes puzzle is described at http://en.wikipedia.org/wiki/Common_knowledge_(logic)
Man this is depressing. Now ask how many people you need to have in a room before there's a 1/2 chance two of them share a birthday. And then the Monte Hall problem, which will bring about the end of the site.
1/2 (or whatever the odds of having a boy are-- this is kind of a poor example of the probability issue at hand since there are probably genetic factors that affect the likelihood)
Tom Clancy on December 31, 2008 6:59 AMTJ's explanation convinced me to change my answer from 50% to 66%:
<<"The answer is 2/3. The problem is the explanation for this is normally AWFUL! It's confusing to people why GB and BG are different? They aren't. The difference is in the probability of a couple having GB, BB, GG. It is not 33%, 33%, 33%. It is 50%, 25%, 25%. People are twice as likely to have one of each.
Therefore if we know we have one girl then, GB (50%) and GG (25%) is the set of possibilities allowable. Therefore it is twice as likely the couple has a boy than a girl.">>
So I'm going with 2/3...but I will say that most of the 2/3 people have done a very poor job of explaining why they arrived at that answer.
Matt on December 31, 2008 7:00 AMMan this is depressing. Now ask how many people you need to have in a room before there's a 1/2 chance two of them share a birthday. And then the Monte Hall problem, which will bring about the end of the site.
1/2 (or whatever the odds of having a boy are-- this is kind of a poor example of the probability issue at hand since there are probably genetic factors that affect the likelihood)
PPS I got an error when I tried to post and was then stopped in re-posting by the spam trap. Is it possible to make sure my comment actually posted before stopping me?
Tom Clancy on December 31, 2008 7:00 AMThis reminds me the book "the curious incident of the dog in the night-time". I would suggest the book to many codinghorror readers (given that they haven't already read it ;-)
dino on December 31, 2008 7:01 AMAssuming that there is no dependency between the two children, so that if your 1st child is a girl the chances of the 2nd child being female is still 50%, we have four equally likely combinations of gender
a) M + M
b) M + F
c) F + M
d) F + F
Since one child is female, we eliminate case a), so we are in one of the other three cases. Therefore, the chances that they have a noy and a girl are 2/3
Good god man, you asked a puzzle question on a programming blog! What is WRONG WITH YOU? That's like smashing atoms, or throwing black holes into each other! The comments will NEVER END! The puzzle will continue until your comments section explodes!
Cybercat on December 31, 2008 7:01 AMGood god man, you asked a puzzle question on a programming blog! What is WRONG WITH YOU? That's like smashing atoms, or throwing black holes into each other! The comments will NEVER END! The puzzle will continue until your comments section explodes!
Cybercat on December 31, 2008 7:02 AMIts 66%
without looking each of these has 25%
BB 25%
BG 25%
GB 25%
GG 25%
Someone told us that GG isn't a possibility. So there are 3 remaining options and they have equal probability (as they did before) 2 of those 3 result in a boy.
Adam on December 31, 2008 7:03 AMso at the question:
What are the odds that person has a boy?
the answer would be 3/4?
plceli on December 31, 2008 7:03 AMIf the question was: You met someone who told you they had two children. What are the odds that person has a boy and a girl?
The answer is obviously 50%.
There's extra information here. The fact that one child has been revealed to be a girl does not affect the odds of having a girl and a boy.
@Fred: You aren't taking the total possibilities, you're only taking the situations where one is a girl. Having at least one girl is a definite, a given, it's 100%, it's in the problem definition. The problem says that the first child IS A GIRL, which is like saying that P(at least 1 girl) = 1.
The first one being a girl isn't part of the probability and isn't part of the random trials: It's given, factual, undeniable information.
P(at least 1 girl) = 1
P(exactly 1 boy | at least one girl) = 0.5 / 1 = 0.5
A woman is pregnant. The gender of the child is ...?
What the odds for a boy? What the odds for a girl?
50% for both genders?
Nikos on December 31, 2008 7:08 AMYes, math is fun. But you guys are getting wild with the guessing.
Let me ask a similiar question: What are the chances that I will be hit by a car outside my house today?
Go on. Give me the equations. I'll wait.
Give up yet? Not enough info?
OK, you may say that's not a fair comparison, but I think it is.
Mathematically there's a 50/50 chance for a new born boy or girl, but IN REALITY I've read that boys are born at about a 51% rate currently in the U.S. I also read somewhere that currently in the U.S. the stats on the second child being boy/boy combinations are a few percent more likely than boy/girl combinations. Why? nobody knows, it just is.
So if we're talking recent U.S. births, statistics would say its probably a boy. Because boys are more common alone, and after a first born daughter. But you can't compute why.
And are we talking about China , Mexico, or Africa? I bet in China the statistics are way different too.
So give me all the math that you want, but there's no good answer.
oh, here's a link I just googled about recent U.S. statistics on multiple children birth, just so I don't sound totally insane.
http://www.in-gender.com/xyu/Odds/Gender_Odds.aspx
What about twins?
Nikos on December 31, 2008 7:08 AM@Andrew:
If that was true, there would be no point to the conditional probability equation, because P(B) would *ALWAYS* be 1, and P(A|B) would be simply P(A) [n] P(B).
I would say "slightly more than 2/3" because while I agree that it'd be 2/3 if boys and girls were equally probable a priori, I believe that more boys are born than girls so that it skews the result to be higher.
(The result might yet be different if the children were actually > 50 given the difference in life expectancies ;)
Chris on December 31, 2008 7:10 AMCongratulations!!
xhantt on December 31, 2008 7:10 AM@Brian
actually it does (boy - boy is eliminated)
plceli on December 31, 2008 7:10 AMI don't think any of the comments have actually tried explicitly plugging in Bayes' Theorem (per Jeff's "conspiracy" link in the original post) for this problem yet, so here goes:
Bayes' Theorem: P(A|B) = (P(B|A) * P(A)) / P(B)
In this problem, we have:
P(A) is the probability of there being exactly 1 boy in a given two-child family.
P(B) is the probability of there being at least 1 girl (that is, either 1 girl or 2 girls) in a given two-child family.
P(A|B) is the probability of there being 1 boy in a two-child family, given that we know there's at least 1 girl -- this is the answer that we're interested in here.
P(B|A) is the probability of there being at least 1 girl in a two-child family, given that we know there's exactly 1 boy.
P(A) is 0.5. Given (BB, BG, GB, GG), 2 of the 4 have exactly 1 boy.
P(B) is 0.75. Given (BB, BG, GB, GG), 3 of the 4 have at least 1 girl.
P(B|A) is 1. Given a family with exactly one boy, out of (BB, BG, GB, GG) we are left with (BG, GB); both of those have at least 1 girl.
Then, from the formula, we have:
P(A|B) = (1 * .5) / .75
= .5 / .75
= .6667 (approximately)
So 2 chances out of 3 (approx. 66.7%) that in a 2-child family that includes a girl (and it isn't known which of the two is the girl) that the other child is a boy.
Note that the problem changes if we are told that "the first child is a girl" or "the second child is a girl", as opposed to "the first and/or second child is a girl" as we are effectively told in this problem statement.
Jon Schneider on December 31, 2008 7:11 AMMy initial guess was 50%, but it's clearly 2/3. However, I think this problem gets more baffling when you increase the problem space...
Say you are told two of three children are girls:
GGG
GGB
GBG
BGG
Chances are 3/4 the remaining one is a boy.
Say you are told three of four children are girls:
GGGG
GGGB
GGBG
GBGG
BGGG
Chances are 4/5 the remaining one is a boy.
So, as the number of children goes to infinity, if infinity - 1 are girls, then the chances that the remaining one is a boy approaches 1.
Which just blew my mind ;)
Chase Seibert on December 31, 2008 7:11 AMJust in case you forgot the question
"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 key to the question is what are the odds the person HAS A BOY AND A GIRL.
From previous comments people are indicating that the possible combination's are the following, which are not entirely correct, which will lead to an incorrect calculation of the odds.
1. BG
2. GB
3. GG
4. BB
First proof:
The question is asking what are the odds the person has a boy and a girl. We know the parent already has a girl, so the option for BB is removed. So the possible combination's are now reduced to the following:
1. BG
2. GB
3. GG
Second proof:
The question does not indicate a preference of which gender comes first or second. So this allows us to remove one of the BG or GB since they indicate the same outcome 1 Girl & 1 Boy. So the possible combination's are now reduced to the following:
1. GB
2. GG
So the odds of someone having a boy and girl is 50% or .5 probability.
It's not 2/3's
I rest my case your honor
The 2/3 camp is wrong. They believe there are 4 possibilities to start with (BB, BG, GG, and GB) and do all their math following this assumption.
In reality, with the available data we have, there are only 2 possible outcomes:
-> a girl and a boy
-> both girls
The answer is obvious, isn't it? :P
JAG on December 31, 2008 7:12 AMOkay, without having read the comments:
First of all, I'll make some simplifying assumptions. I'll assume that the odds of any child born being male or female are completely equal. I'll assume that there is absolutely no link between the sex of either child. (So I'm ignoring the possibility of identical twins and that some parents might tend to produce more boys or girls.) I'll assume that all people are either male or female. I'll assume that people don't lie and that the people you meet are a representative sample of all people. I'll call all these the PERFECT PEOPLE assumptions.
Next, I'll assume that when you meet someone they *always* tell you the number of children they have and whether they have a girl, and that they are not influenced by whether those children are boys or girls. I'll call this the QUESTIONNAIRE assumption, because it's like assuming that for every person you meet, you give them this questionnaire:
1. How many children do you have? [0, 1, 2, 3...]
2. Is at least one of your children a girl? [YES / NO]
Now let's consider the event you described among the other possible events. We don't need to worry about people who have more or less than two children, they don't affect matters. Let's think about all the people with two children. There are four equally likely possibilities (bearing in mind our simplifying assumptions):
* Elder child is male, younger child is male.
* Elder child is male, younger child is female.
* Elder child is female, younger child is male.
* Elder child is female, younger child is female.
The person with two male children will never tell you that they have a girl, but all of the other three will. In this scenario, there's a two out of three chance that the person has a boy and a girl when they tell you they have a two children, one of whom is a girl.
HOWEVER, this all hinges on that QUESTIONNAIRE assumption. We can't know that from your description. Perhaps you are asking people if they have a girl, and in that case fair enough. But as you describe it, the information is provided unsolicited: how is the person deciding to tell you the sex of one of their children? Maybe they always tell you the sex of the elder child, or one of the children at random. Suppose the questionnaire is:
1. How many children do you have? [0, 1, 2, 3...]
2. Is your eldest child a boy or a girl? [BOY / GIRL]
In this case, the chance of the other child being a boy or a girl becomes even. On the other hand, perhaps the questionnaire is the opposite of my first one:
1. How many children do you have? [0, 1, 2, 3...]
2. Is at least one of your children a boy? [YES / NO]
In this scenario, someone telling they have a girl *must* have two girls.
I would recommend rephrasing the question/puzzle to be more clear. It's like we can see the output of the program (the questionnaire) without knowing the source code. We can make some educated guesses, but we can't really debug it.
Weeble on December 31, 2008 7:12 AM50%. It's not a case of conditional probability because the events are totally independent.
Andre on December 31, 2008 7:14 AMI came to the comments section convinced that the answer was 1/2 but after reading about halfway down the page and thinking about things, I'm now convinced that the answer is 2/3. I'll do my best to explain my reason for changing my mind and maybe those who say 1/2 will rethink things.
First, consider this: Knowing only that the person has two children, what is the probability that this person one boy and one girl? You would say 1/2, right? Because there are four equally probable possibilities:
Both kids are boys
First born is a boy, second is a girl
First born is a girl, second is a boy
Both kids are girls
For those of you getting hung up on order, you're right. Order doesn't matter. The middle two cases are the same for our purposes, but we have to take into account that there are two ways to have a boy and a girl. And intuitively, it makes sense that someone would most likely have one girl and one boy. Just like if you flip a coin two times, you'll most likely get one heads and one tails.
Okay, so now the person tells you that one of the kids is a girl. This takes away the first possibility, so you now have just three equally probable possibilities:
First born is a boy, second is a girl
First born is a girl, second is a boy
Both kids are girls
In two of those cases, there is a boy, so the answer is 2/3.
Those of you thinking 1/2 are interpreting the question differently (even if you don't realize it). You're thinking of it as more like: A person has two kids and the first one is a girl. What is the probability that the second is a boy? This question is subtly different because it leaves only two possibilities:
First born is a girl, second is a boy
Both kids are girls
I know I've just repeated a whole bunch of stuff that other people have said, but I've tried to make things a little clearer.
Chickencha on December 31, 2008 7:17 AM@Andre:
Conditional probability still applies to independent events, if you are asked to calculate a probability and given specific information (conditions).
Yup, I'm in with all the 2/3 folks because you can eliminate the BoyBoy option. It's a simple, but somewhat counterintuitive problem in the same class as the "Monte Hall" problem that Marilyn Vos Savant used to make so many smart people look stupid.
If I hadn't been introduced to that problem a while back, I'd probably have made the wrong choice -- you got a 50/50 chance of the next kid being a boy. True enough but solves the wrong problem.
And there's the rub for most coders. Easy enough to learn the syntax of any language and not much harder to get fluent in that language. Even fairly easy for a typical code monkey (that would be me, I claim no special talent) to solve a well-defined problem. Hard to define problems.
dgrc on December 31, 2008 7:22 AMYour alarm should go off at the wording of the question:
"What are the odds that person has a boy and a girl?"
Those saying 50% are thinking of it more naturally, like this:
"What are the odds that person's other child is a boy?"
Although the questions are equivalent, the first one is the better way to think about it, if you want the right answer.
As has been said before, you take all people of the world who have 2 children and split them into 4 groups:
BG - 25%
GB - 25%
GG - 25%
BB - 25%
Now you are speaking to a random person who meets the qualification "has two children; at least one is a girl."
This means you are not talking to someone from the BB 25%. But you could be speaking to anyone in the remaining 75%. Of that narrowed scope, clearly 2/3rds will have a boy, while only 1/3 will have a second girl.
For those who want something less formal:
Yes, each child only has a 50% chance at being a boy... however you have skewed the statistics by saying "Pipe up if you have a girl, I want to include you in this question!"
Now if EITHER child is a girl, they are sucked into the experiment. Just GETTING INTO THE QUESTION "uses up" your girl child, and leaves the remaining child with a higher chance to be a male. Only the rare people with two girls have enough to get included in the question and STILL have a second girl left over.
Patrick on December 31, 2008 7:22 AM50% -> only two possible combination (B+G & B+B)
Leon on December 31, 2008 7:23 AM45.5%. But I did a Google search.
http://www.in-gender.com/xyu/Odds/Gender_Odds.aspx
Conclusion
Although we often hear the "statistic" that you are 30% or even 70% more likely to keep having the same gender, this is just an old wives tale. It is NOT a fact. The truth is, your odds stay pretty close to 50% for each child and only vary slightly. If you have had 2 or 3 boys, you are only about 2% to 6% more likely to have another boy. If you have had girls, you are slightly more likely to have a boy next.
Sorry, it is quite late, and I wrote that poorly. Conditional probability applies here because the probability that "one child is a girl" is not statistically independent of the probability that "one child is a boy". Each birth was an independent event, so the probability of the outcome of the second was not affected by the first... the key is that we don't know whether the girl was first or second, so we lose the independence.
Fred on December 31, 2008 7:25 AMThis is why I have always hated statistics. It's just so unintuitive. (Count me in the 1/2 switched to 2/3 camp, and not happy about it).
Matt on December 31, 2008 7:27 AMI hope you all are better "programmers" than you are statisticians...
Steve on December 31, 2008 7:28 AMI notice the people deriding others never provide their own answer...
Fred on December 31, 2008 7:30 AM50% and here's why:
They have two children. One of the children is a girl, therefore there are only two possibilities: the other is a girl / the other is a boy. The order of the children does not matter. Just because we're used to having children of different ages doesn't mean we should take that into account every time we think about children. Now, in the real world, there are many other factors that can influence this, such as men who only produce XX or only produce XY sperm. There is also the case of hermaphrodites or twins, but I guess we could rule them out, because it is impossible o compute the actual chance of this happening by using only the premise we are given. There are also countless factors unknown to us that determine the sex.
The problem is quite easy: you just have to rule our everything related to the first girl because that's not a variable change. This is not a Monty Hall problem and regardless of the gender of one of the children, the chances of guessing the gender of the other are still 50% (of course, not considering real-world factors and sticking to the premise)
Tom on December 31, 2008 7:33 AM@Matt "This is why I have always hated statistics. It's just so unintuitive. (Count me in the 1/2 switched to 2/3 camp, and not happy about it)."
Agreed. I wasn't seeing the kids as individuals I guess. So therefore BG isn't the same as GB. ( I still wonder about the case of twins though).
kbo on December 31, 2008 7:34 AMThe second child is either a boy or a girl. Done.
50%
Steph on December 31, 2008 7:35 AMRemember, we are talking about humans. If a person tells you: "I have two children, one is a girl" there's still the missing option everyone is forgetting: "oh, the other one is a girl too".
We humans ain't perfect :)
ubersoldat on December 31, 2008 7:38 AMBG
GG
GB
Boy Girl probability = 66%
tail = 0 , face = 1
I tossed my coin two times, one of the result is face (1).
What are the odds the other result is tail (0)?
0-0 = eliminated
0-1 = there is a 1, other is 0
1-0 = there is a 1, other is 0
1-1 = there is a 1, other is 1
I have 2 chances on 3 that the other result is tail (0)
Makes more sense with a coin ;)
plceli on December 31, 2008 7:38 AMI would say 99.9% but it's really a question for psychological statisticians. The vast majority of people that word it that way are indicating that they have one boy and one girl. Some people might word it differently to throw you off intentionally.
I have two coins that add up to 30 cents. One is not a quarter.
Jason B on December 31, 2008 7:38 AM@Tom "One of the children is a girl, therefore there are only two possibilities: the other is a girl / the other is a boy."
You're right that there are only two possibilities, but you're assuming that those two possibilities are equally likely when they're not. The order doesn't matter, but you have to consider that there are three different ways to have two children with at least one of them being a girl.
Chickencha on December 31, 2008 7:39 AMI don't think this is the Monty Hall problem. In that problem, you know there is still "a new car" behind one of the doors. Here you don't know.
You can prolly solved this with Bayesian math, but I think a lot of people are doing the math wrong. Here are the universe of equal (perhaps this is not exactly right in nature) possibilities:
GG + GB + BG + BB = 4 outcomes
Now we have the information that one of the children is a girl. Lets weight our values (I am not going to draw a tree with chars here);
GG * 2 + GB * 1 + BG * 1 + BB * 0 = 4 outcomes
So GG happens 50% of the time (which means we have two girls meaning the second child is a girl), where GB and BG together also occur 50% of the time (which means the second child is a boy).
So the answer is 50%.
Math is not my strong suit, but I think a lot of people are incorrectly using Bayes on this page.
Jason Jackson on December 31, 2008 7:39 AMI also say 50% (if we consider that 50% is the probability of having a boy out of one child). It´s a simple use of the Bayes theorem.
Andrés on December 31, 2008 7:40 AMThere are four possible outcomes for a two-child family:
B1 B2
B1 G2
G1 G2
G1 B2
We have been told that one of the children is a girl, so we can eliminate B1 B2, leaving us with:
B1 G2
G1 G2
G1 B2
Since two of this have a boy and a girl, it would seem that 2/3 is the answer. However, we don't know which child (1 or 2) was revealed to be a girl, so we can eliminate some more outcomes.
If the first child was revealed to be a girl, we can eliminate B1 G2, leaving us with:
G1 G2
G1 B2
This gives us 50% chance odds that there is one boy and one girl.
If the second child was revealed to be a girl, we can eliminate G1 B2, leaving us with:
B1 G2
G1 G2
This also gives us a 50% chance that there is one boy and one girl.
No matter which child (1 or 2) was revealed to be a girl, the odds are 50%.
fre0n on December 31, 2008 7:41 AMThere are a lot unanswered issues here that relate to context.
>> If this someone belongs to a bi-gender race with equal gender probability between "boy" and "girl" and
>> if this person isn't trying to fool you and
>> if this person knows the gender of both children, then,
then sure, on previously stated probabilistic grounds the odds seem to be 2/3 that they have a boy and a girl.
I refuse to answer this question.
This puzzle solves nothing. :P
Shawn Poulson on December 31, 2008 7:44 AMOk so here's my program (in php)
It prints the numbers from 1 to 100, but for multiples of three prints "Girl" instead of the number and for the multiples of five prints "Boy". For numbers which are multiples of both three and five it will print "GirlBoy".
function is_special($num, $mod, $txt){
if($num % $mod == 0) {
echo $txt;
return true;
}
return false;
}
function get_fb($fizzes, $count){
for($i=1; $i<=$count; $i++){
$printi = true;
foreach($fizzes as $mod => $txt){
if(is_special($i, $mod, $txt)){
$printi = false;
}
}
if($printi) echo $i;
echo "<br/>";
}
}
$values = array(
3 => "Boy",
5 => "Girl"
);
get_fb($values, 100);
of course, this can be expanded, for example by setting
$values = array(
3 => "Boy",
5 => "Girl"
7 => "Hermaphrodite"
);
^^' seriously, it's 50%, though
Bob ArdKor on December 31, 2008 7:44 AM@Steve:
"I hope you all are better "programmers" than you are statisticians..."
I hope you are less of a "presumptuous asshole" than you are a presumptuous internet asshole.
Anti Steve on December 31, 2008 7:44 AMwhat the odds?
http://en.wikipedia.org/wiki/Possibility_theory
http://en.wikipedia.org/wiki/Probability_theory
Nikos on December 31, 2008 7:45 AMI'm absolutely certain it's both 2/3 and 1/2 chance that the other child is a boy, and therefore I'm a full 50% more right than any of you.
Also, vi is better than emacs.
Jim on December 31, 2008 7:46 AM100%
if you don't accept that when he's saying that "one of them is a girl", other one must be a boy (otherwise, if it's a real-life conversation, he wouldn't phrase it that way) .... you have to accept posibility of other trick in the question:
He says that he has 2 children. What if he has 5 children? If he has 5, statement "I have 2 children" is also true or not?
Nevermind, I assume that this is supposed to be a real-life conversation (not a logical puzzle) and therefore it implies other child isn't a girl, so it's a boy.
I'm for 100%
If it was a trick question (other child may be a boy or a girl), then it would be 50%
marek on December 31, 2008 7:46 AMThere simply isn't enough information, and different limiting assumptions can produce very different (each correct) answers. 2/3 seems to be the most popular although many people are arriving at that answer in the wrong way. 1/2 is correct under certain assumptions too.
What's needed is more information to settle some of the ambiguities.
Andrew on December 31, 2008 7:46 AMBayes 101, I guess?
Off the top of my head, with the information that "one of them is a girl", it's 66% that there's a boy and girl.
For 2 children, there are four possible selections -- older boy/girl and younger boy/girl.
The only information that "one of them is a girl" communicates is that the older boy+younger boy choice is ruled out. That leaves three choices. Since 2 of those have both boy and girl, then it's 2/3, or 66% that they have a boy and girl.
Had they said "the older one is a girl", that would set it to 50% -- not because the situation is different, but because it communicates more information to you, allowing you to filter out more possibilities.
Probability is a function of your knowledge, not a property of the external universe. It should not be surprising that probabilities change if you have different amounts of knowledge.
Therac-25 on December 31, 2008 7:47 AMI intuitively like the 50% of 75% = 37.5% idea...
However,
P(b|g) = P(b AND g)/P(g) = 0.75
P(b|g) = 0.50/0.667 = 0.75
But given that we can throw away one of the likelihoods (i.e. B+B)...
P(b|g) = P(b AND g)/P(g) = 0.667
P(b|g) = 0.667/1 = 0.667
So.... 66.67%
nuclearnewyears on December 31, 2008 7:49 AMxhantt-
I agree, (This is a total guess but...) Congratulations Jeff!!
Let's rephrase the question:
The government takes one out of every two cows, chosen randomly. You used to have two cows. The government took at least one. What is the probability the government has left you the other one?
The answer: 2/3 (67%)
A few rebuttals:
Steph, what if the "second child" is the child that was named a girl?
Leon, you haven't considered that B+G (no order) is twice as likely as G+G--regardless of the information that B+B is eliminated.
Patrick Szalapski on December 31, 2008 7:49 AMAre you having twins, Jeff? A boy and a girl?
Josh Stodola on December 31, 2008 7:50 AM@fre0n:
Reveal the first child to be a girl, yes, 50%.
Reveal the second child to be a girl, yes, also 50%.
Reveal *A* girl... this is the difference. You don't know "which one" it is, so you don't know which option to eliminate to get to 50%.
If I show you that I have a girl, there are three of four possible two-child combinations that could exist. It can be confusing, because you can think "she could have an older sister or a younger sister, so the chance is still 50%", but there is only a 25% chance of having two girls in the first place.
Fred on December 31, 2008 7:50 AMI don't understand why everyone finds the ordering between BG and GB important if you don't care about ordering between GG - the ordering of the given child isn't ever specified so you have to assume cases:
Older girl + boy
Older girl + girl
(Older boy + boy)
Younger girl + boy
Younger girl + girl
(Younger boy + boy)
The problem with the 66% postulates is that you're counting Bg and Gb seperately but not Gg and gG - meaning that ordering is decoupled and you've got 50% possibility on the second child.
Rob on December 31, 2008 7:50 AM50%
regardless of previous children, when an the child's sex is formed there is approximately a 50% chance of being a boy.
livando on December 31, 2008 7:50 AM50%
GS Chandy on December 31, 2008 7:51 AMYou are all wrong. You are assuming only two genders. Do we know if they are Vissian?
Astrochicken on December 31, 2008 7:52 AMBy the way, "older/younger" is just a easy way to distinguish. The distinction could just as easily be "taller/shorter", "shorter-named/longer-named", or "hungrier/less hungry".
Patrick Szalapski on December 31, 2008 7:52 AMPatrick Szalapski: What about the two GG possibilities? It could the first or the second that was mentioned, right? G[named]+G[other] vs. G[other]+G[named] vs. G+B vs B+G?
Jim on December 31, 2008 7:52 AMI was with the 50% crowd until I saw the Java program that made randomly generated samples and realized that the second child's gender is *not* independent of the first child's if the order is not known. People are using the coin example, of flipping one coin and asking what the next flip will be. It will be 50% because it is independent of the first flip.
However, it is entirely different if you flip twice and say that one of the flips was heads. Then from:
HH
HT
TH
TT
TT is invalid and so there is a 1/3 chance that what they flipped HH, a 1/3 chance that they flipped HT, and a 1/3 chance they flipped TH, which means a 2/3 chance that one of their flips was heads and the other was tails.
Soggy on December 31, 2008 7:54 AMI've thought about it some more, and 2/3 now makes intuitive sense to me.
If a couple has two kids, each kid has a 50% chance of being a boy or a girl. This means that having one boy and one girl is twice as likely as having two girls (or two boys), since they could have had a girl then a boy or a boy then a girl.
So if you know they have one girl, they are twice as likely to have a mixed pair as to have two girls, hence the 66% probability.
Same thing all the AB BA AA BB people are saying, but I can breathe a little easier now that I understand it outside of the math.
Matt on December 31, 2008 7:54 AM100% is a boy ... one of them is a girl so the other one is a boy.
Attila B on December 31, 2008 7:55 AMI must preface by saying that I didn't read some of the comments, although I searched and it seems that only one person hinted at the right solution (Katie). Well, here is the definitive right answer:
STATISTICALLY, WITHOUT OTHER FACTORS: the chances are 50% - the coin toss analogy that many have posted applies here.
LOGICALLY: the chances are 99.99% - if somebody TELLS you that they have two kids and one is a girl, they either have a boy and a girl or you are talking to an extremely nerdy computer programmer...
GENETICALLY: the chances of having two girls if you have one girl ARE HIGHER THAN 50%, more like 55%, provided that both children share the same parents. If a couple has a girl, the chances of having a second girl increase slightly (this is due to the statistical likelihood that the man's sperm favor one or the other gender, as often happens). If they have two girls, the chances of a third child also being a girl go up even more, to over 60%.
cp on December 31, 2008 7:55 AMAssuming it's an exercise in maths, the probability of the other child being a boy is 50%, same as the general probability of a child being born as a boy. Then again, I wouldn't rule out the possibility that some people are more likely to conceive girls/boys.
Frankly, I'm astonished at the number of "66%" answers.
Rob, Gg and gG are not separate--both represent the event "two girls". Bg and bG are separate. The event "younger boy, older girl" is a different event then "older boy, younger girl." The two events sum to make the event "one boy, one girl". "One boy, one girl" is twice as likely as "two girls". We IGNORE the possibility of "two boys", as it does not affect the other possibilities.
Patrick Szalapski on December 31, 2008 7:56 AMI think what Jeff is telling us is that he and his wife are having twins,
And he and his wife are probably having a really good time reading these responses. =)
Oh come on. What a mindfuck. Don't you have something better to do on new years eve than commenting on a random blog? ;-)
Jens on December 31, 2008 7:57 AMRob, Gg and gG are not separate--both represent the event "two girls". Bg and bG are separate. The event "younger boy, older girl" is a different event then "older boy, younger girl." The two events sum to make the event "one boy, one girl". "One boy, one girl" is twice as likely as "two girls". We IGNORE the possibility of "two boys", as it does not affect the other possibilities.
Livando, you haven't considered the possiblity that the quizzer has told you the sex of the "child whose sex is being formed".
Patrick Szalapski on December 31, 2008 7:58 AMIt is 75%, this is the classical game show question with 3 doors. There are 3 doors, one with a car, 2 with a goat.
If you choose one door at the beginning, of the game show, you have a 33% chance of being right and a 66% chance of it being in the other doors. The host opens one of the doors that is not yours, and it is a goat. He asks you if you would like to change your answer. You should say yes because you will have increased you chances to 66% if you change to another door, because at the beginning the other doors had a chance of 66% and you have just ruled one out.
This is basic 8th or 9th grade probability.
Nick Berardi on December 31, 2008 7:58 AMAlmost 300 guesses and everyone has missed the obvious...Pi. The answer is always Pi.
Kale on December 31, 2008 7:58 AMHmmm, so we know there are 2 kids, kid 1 and kid 2.
Lets say there are 4 possibilities, and assume there is always an equal chance of having a boy or girl.
BB
BG
GB
GG
Obviously we can eliminate BB.
But here's the question. Can we also eliminate BG, since we already know the first child is a Girl? In that case it would be 50%, since the only remaining possibilities are GB and GG.
Or, the other way of looking at it is that we don't know whether child 1 or child 2 is a girl, so therefore 3 possibilities remain, and 66% is the answer.
I'm not sure which is actually correct here.
For those who are saying "well if someone tells you one is a girl they usually mean the other is a boy, " BZZZT. Definitely the wrong answer. Read the question again, it doesn't say "only one," and it doesn't say anything about someone telling you one is a girl. The question just explains that *we know* one is a girl, but don't know the sex of the other. No other assumptions like that should be made.
But me to -- I hope I'm a better programmer than I am a statistician. Especially since I work with statistics :(
(But that doesn't necessarily mean I know the answer to these trick questions)
*Me too*, that should be (blush). I also hope I'm a better programmer than I am a writer!
Neil (SM) on December 31, 2008 7:59 AMIt's 50%, assuming that there is a 50% chance that any individual child born will be a boy. Knowing that there is at least one girl eliminates that child from the equation, so we just need to know the chances of the other child being a boy.
I guess this question is designed to trick people into answering the wrong question, but it still boggles my mind the number of people who believe that the order the children were born in somehow matters, or that you need to think about statistics involving 2 children at all when you already know the gender of one.
Colin on December 31, 2008 8:00 AMThis question needs to be put on Stackoverflow so that we can vote on the answers!
Nick on December 31, 2008 8:00 AMHey look, a religious war!
C# kicks VB.NET's ass!
(Oh, and 50% is the right answer.)
srsly on December 31, 2008 8:00 AMI think the missing point is that it's possible to have *more* than two.
Practicality on December 31, 2008 8:01 AMThose who don't believe 2/3 can always simulate it:
using System;
class Program
{
static void Main(string[] args)
{
Random r = new Random();
int hasBoy = 0, hasGirlAndBoy = 0;
for (int i = 0; i < 100000; i++)
{
int a = r.Next(2);
int b = r.Next(2);
if (a == 0 || b == 0)
{
hasBoy++;
if (a == 1 || b == 1)
hasGirlAndBoy++;
}
}
Console.WriteLine((double)hasGirlAndBoy / hasBoy * 100.0);
}
}
It'll print 66.xx which is equal to 2/3.
Mehrdad Afshari on December 31, 2008 8:01 AM@Patrick - I'm still not sold - if the speaker told you their oldest child was a girl you could say the second is 50% (Gb/Gg: 1/2) but since they didn't specify order you actually have four options (Gb/Gg/gB/gG: 2/4).
Rob on December 31, 2008 8:01 AM@Patrick - I'm still not sold - if the speaker told you their oldest child was a girl you could say the second is 50% (Gb/Gg: 1/2) but since they didn't specify order you actually have four options (Gb/Gg/gB/gG: 2/4).
Rob on December 31, 2008 8:03 AMJeff should not provide the answer before everyone on this planet has stated his or her opinion in this thread.
Sometimes I think 50%, sometimes 67% and sometimes 100%. I'm in some kind of quantum mechanical superposition state, a little bit like Schrödinger's cat.
I think that even when I know the answer I will still having trouble understanding the answer.
@Rob
> The problem with the 66% postulates is
> that you're counting Bg and Gb seperately
> but not Gg and gG - meaning that ordering
> is decoupled and you've got 50% possibility
> on the second child.
I'm not sure what considering Gg and gG separately even means. They describe the same case -- there's no constraint on my expectations if I predict Gg as opposed to gG.
To review, if you know that they have two children, then you have four possibilities -- b/b, b/g, g/b, g/g -- each with a 25% probability. In this context, if you were asked the question -- "at least one of them is a boy" -- you would have to say 75%. This is a function of your knowledge, not the world -- you only know "two children", and have a bunch of information about gender distribution that amount to that 75% figure.
If they then say "one of them is a girl", that's more knowledge. So now you can eliminate one of the four possibilities from your expectations about how the universe will behave. You have three possibilities left -- g/g, b/g and g/b. 2/3 of those have a boy, so you get 66%. This is a function of your knowledge, and not the world.
If they then say "the older one is a girl", that's more knowledge. That allows you to filter out the case of b/g, leaving you with a 50% probability that they have a boy.
Probabilities do not describe the physical world. They are a result of your state of knowledge about the world. A coin flip might seem like it has a "real" 50% probability, but that's only because the amount of information (not to mention processing) required to correctly predict a coin flip is astronomical -- you would effectively have to simulate a pocket universe in order to correctly predict a coin flip. Since you don't have that knowledge, you only have the probability to work with.
Therac-25 on December 31, 2008 8:04 AMI look forward to the wailing from the 50% crowd ;)
Fred on December 31, 2008 8:05 AMJim, there aren't two G+G possibilities. Distinguishing among a randomly designated "A" child and the other "B" child, the only way to get G+G is if "A" is a girl and "B" is a girl.
Distinguishing among a randomly designated "A" child and the other "B" child, there are likewise two ways to get one boy and one girl.
For more study, see: <a href="http://en.wikipedia.org/wiki/Event_">http://en.wikipedia.org/wiki/Event_</a>(probability_theory)
Munged my link
<a href="http://en.wikipedia.org/wiki/Event_(probability_theory)">http://en.wikipedia.org/wiki/Event_(probability_theory)</a>
Patrick Szalapski on December 31, 2008 8:07 AMJeff, does this always fail on any link with a parenthesis?
Patrick Szalapski on December 31, 2008 8:08 AM1/2. Having a baby is a completely independent event meaning that your second child being boy/girl has nothing to do with what your first child was. There's a 1/2 chance you'll get either gender.
Justin Bennett on December 31, 2008 8:08 AMFor those arguments about 50% vs not 50%, this might add some context: http://www.overcomingbias.com/2008/10/my-bayesian-enl.html
Wilka on December 31, 2008 8:10 AMI didn't read through all the comments, so maybe somebody brought this up eventually, but from the first bunch of comments, it looks like a lot of people are probably missing the point.
First, I think this is an artificial problem. I don't think we're really meeting someone who has two kids and is actually saying, "one of them is a girl." No normal person would do that. A normal person would say, "I have two girls" or "two boys" or "a boy and a girl."
Rather, I think Jeff is simply trying to pose the logical problem, knowing that someone has two kids, and knowing that at least one of them is a girl, what are the odds on the sex of the other child?
Those of you (in the first bunch of responses) that addressed this second case seem to be assuming that the odds of a boy or girl each time is 50%. That's not true. Nearly all men have a strong bias toward producing either girls or boys: they're not shooting X's and Y's 50/50. Some men are much more likely to produce girls; some are much more likely to produce boys.
Think about it: How many families do you know with muliple children (all by the same father) where most or all of the children are the same sex? In fact, in *most* families with multiple children, there is a clear dominance of one sex over the other. My grandparents had six children. Four were boys; the other two were girls. My wife's grandparents had five girls and no boys. My parents had two boys and no girls. I have a number of colleagues who have three girls or three boys. Etc.
So the real answer is, knowing that one of the children is a girl, it is extremely likely that the other child is *also* a girl, because the first girl is a strong indicator that the father is probably biased toward producing girls.
SWB on December 31, 2008 8:11 AMPLEASE MAKE IT STOP!!!!
Dylan on December 31, 2008 8:11 AMSomeone has already mentioned this puzzle:
http://en.wikipedia.org/wiki/Monty_Hall_problem
I think it has similar overtones with an "obvious" answer that is wrong and the less counter-intuitive correct answer.
I don't believe the point of the question is about the real life subtleties, more the general principles:
If we'd been told precisely that the *first born* was a girl, then I'd say 50% for the other child, i.e. we have the following subset of possibilities:
GG
GB
Similarly, if the *second born* was definitely a girl, then again I'd say 50%, i.e.
BG
GG
However, we don't have that additional information. We only know at least one is a girl, i.e.
BG
GG
GB
2/3 of these have a boy as the second child...
So I'm certain the answer is 2/3
Alex on December 31, 2008 8:12 AMJoke: A guy strolls down the prairie and sees a beautiful group of sheep of two colors, black and white. He approaches the herder trying to find more about them:
Guy: "Beautiful animals, what do you feed them?"
Herder: "The black or the white?".
Guy: "The white"
Herder: "Hay"
Guy: "And the black?"
Herder (with a smirk): "The same"
Guy: "I see..., and do you keep them under roof at night?"
Herder: "The black or the white?".
Guy: "The white"
Herder: "Yes"
Guy: "And the black?"
Herder (smiling): "Also"
Guy: "Mmhh..., and are they purebreed?"
Herder: "The black or the white?".
Guy: "The white"
Herder: "Yes"
Guy: "And the black?"
Herder (giggling): "Them too"
Guy: "Hey, funny guy, why do you ask for white and black if they are treated the same???"
Herder: "Well, you see, the black sheep are mine...".
Guy: "Oh, and the white?"
Herder: "Them too"
The boy/girl question is the type of question that has only the purpose to either entertain you or irritate you, depending on your ability to see life as simple or complicated.
To me it's not a matter of probability or bi-gender VS n-gender. To me the answer is straight: "boy". And the more complicated I want to make it, the more entertaining it will be, but it doesn't deviate from the fact that life is simple.
Guillermo on December 31, 2008 8:12 AMLet's put it this way:
If he is already telling me he has a girl, 3 things could have happened:
* He had a girl, and then a boy
* He had a boy, and then a girl
* He had a girl, and the a girl
The option where he has a boy and then another boy is out of context, since he is telling me he has a one girl.
If we assume each of these options have the same chance of happening, then the chance of having a boy and a girl would be 2/3, as it was said previously...
ivanchg on December 31, 2008 8:13 AMTo avoid confusion, I should rephrase
"2/3 of these have a boy as the second child..."
to
"2/3 of these have a boy as one of the children"
I think the key problem here is understanding what's being communicated.
In a real conversation with a real person, then you interpret things differently than in a math question -- you don't have to look further than boolean logic and the use of "or" to see this. In normal person talk, "or" means "xor" in boolean. If you wanted to say a boolean "or" in person, you would usually say "one or the other or both", or something like that.
If a real person said this to me, I would understand "one of them is a girl" to carry more information that it has if I were to interpret it formally. No human without an Autism spectrum disorder would say "one of them is a girl" without that implicitly carrying the information that the other one is not. No one normal talks like that (if you do, then you're not normal, but you probably know that by now).
Formally, if we engage Bayes' theorem, you get 66% with the amount of information that the statement strictly contains. The confusion here is being caused by understanding exactly what information is contained within that statement. If you phrase it more explicitly -- "one of them is a girl, maybe both are, but I'm not telling you anything other than just one of them is a girl" -- much of the confusion would be dealt with.
Therac-25 on December 31, 2008 8:15 AMYou're wasting your time. It's an ambiguous question. Each answer is correct, but for different reasons. I've seen this question a few times and the answer is always of opinion about the question. Other questions I've seen are more ambiguous about whether it's a combination or permutation too.
I think the main theory that no-one has said yet, is that the fact they already have a girl is irrelevant. If the question were to be: "What's the possibility their other child is a boy?", then it would affect the possibility. Whereas he's asking what the odds are, and the odds are the same regardless of the outcome you've been told. The facts should not be mixed in to the odds. In this case, the odds are 1/3 (since order is seemingly irrelevant and GB is the same as BG).
Lewis on December 31, 2008 8:18 AMI haven't read all the comments here, but yes, everyone should read http://www.overcomingbias.com/ on a regular basis.
Therac-25 on December 31, 2008 8:18 AMWow!!
I am really shocked how many people are still saying 50%, even after being shown the case that it is 2/3rds. I am so stunned I am starting to worry that maybe I'm overlooking something.
But if that's the case and I'm wrong, someone in the 50% camp would have to be able to convince me. So far all I see from the 50% camp is extremely unconvincing. I still haven't done an internet search but I'm going to try to debunk a few of the 50% arguments here:
First, the simplest pro-50 argument, by Andre:
"50%. It's not a case of conditional probability because the events are totally independent."
Debunk: The 2/3rds case does not claim the births are dependent events. It merely looks at the distribution of genders across two children, and notes that we veer away from an even distribution by applying the rule "has at least one girl." I mean, look, what could be simpler:
25%: two boys IS EXCLUDED FROM CONSIDERATION
25%: two girls
50%: one of each
Tom talks about the order of the children and how we shouldn't consider it. This is not an argument for 50%! It should be an argument for 2/3rds... it's exactly because we don't care about the order that the culling step creates this skewed distribution. If the question said "their first child was a girl. What are the odds their second child was a boy," THEN it would be 50%. So Tom, please change sides.
Leon says there are only two possible combinations. Yes, but not in even distribution!
Jason Jackson goes off the rails when he says:
"GG * 2 + GB * 1 + BG * 1 + BB * 0 = 4 outcomes"
Why did he multiply GG times two?? This incorrect an unexplained step leads him to the wrong answer.
To get 50%, fre0n does some weird stuff where he adds more "if" conditions to split the population based on which child was "revealed to be a girl." But he doesn't deal with the complications that should arise, notably the overlap between the G1G2 case. He represents that group equal to the hetergenous groups in both branches of his tree, when in fact there would be some reduction of it... whatever portion of that group "revealed" their first child as a girl would need to be removed from the "second child revealed as girl" branch of his tree. He overcounts this GG group to get his 50%. Also he doesn't even weight the two branches of his tree, but rather assumes a 50% distribution. I'm not going to redo his math to show it's 2/3rds, but I am unconvinced by him.
So I feel pretty sure that it must be 2/3rds, because I have seen a good argument for it, and I see none for 50%.
But I haven't looked it up, and I understand this sort of thing can be tricky.
So 50% camp, please deliver a stronger case, or else be convinced!
Patrick on December 31, 2008 8:18 AM50/50 if no one knows if each either, but when a girl is known the possibilities is stronger to have girl again, so the odds is more likely to have another girl. Maybe 66% or sth...
How many parents with a boy and a girl try for a third (and thus take them out of the two children parent pool) and how many with two girls try for a third? I would venture that more with two girls try for a boy and that must bump up the odds that if they have only two kids that they have one of each. So definitely somewhat above 50%. I guess 65%!
Tony on December 31, 2008 8:19 AM50.5% Slightly more males are born than females for whatever reason. Or 50% if you want to simplify further.
The gender of child Y is not determined by the gender of child X. (Chromosome pun intended.)
Man, I laugh at some of the complex solutions here. This is a simple problem. The question can be reduced to "I have a baby. What are the chances it is male."
Don't over-think the problem. See TheDailyWTF.com for a fine collection of solutions to over-thought problems.
Michael Riecken on December 31, 2008 8:19 AMovercomingbias has the definitive answer on this problem: http://www.overcomingbias.com/2008/10/my-bayesian-enl.html
in this, malformed, version of the problem the probability can be reasonably taken to be 50% or 66%. In the proper formulation, *you ask the person* if one of their children is a girl, and the probability is definitely 66% in that case.
Bill Mill on December 31, 2008 8:21 AM@Michael Riecken
> Man, I laugh at some of the complex solutions
> here. This is a simple problem. The question
> can be reduced to "I have a baby. What are the
> chances it is male."
No, actually, it can't. But if you're happy not understanding math, that's fine.
The question isn't about one event with a 50% probability. It's about the result of two events ("is one a boy?"), each event having 50% probability of each outcome, and the effect that your knowledge ("one of them is a girl") has on the prior probability of the outcome (75%).
Therac-25 on December 31, 2008 8:24 AM<a href="http://www.xkcd.com/356/">http://www.xkcd.com/356/</a>
That is all.
Underflow on December 31, 2008 8:26 AMKnowing that one is a girl leaves one child's sex undetermined. This would imply 50% odds.
On the other hand gender is determined by X and Y chromosomes. XX is female and XY is male. This is a pick two of four problem so it has 4 possible outcomes, (XX, XX, XX, and XY - either of the female's X and the combination of each of the male). By this logic there is a 25% chance the boy is male based on the chromosomes.
http://en.wikipedia.org/wiki/XY_sex-determination_system
Noaki on December 31, 2008 8:26 AMEach event is independent so there's a probability of .5 that the other child is a boy. If you flipped a coin 9 times in a row and it came up heads each time, then ask what is the probability of getting a tails on the next flip, it will be .5. That is much different then asking what is the probability of getting 9 heads in a row and then 1 tails.
Andrew on December 31, 2008 8:27 AMThe Unfinished Game by Keith Devlin
http://www.amazon.com/Unfinished-Game-Pascal-Fermat-Seventeenth-Century/dp/0465009107
Forget Bayes. Just do like Fermat and delinate the universe of possible outcomes.
Also, I hope that I never get in an argument with Nic Wise. Ever.
And for those who are keeping score: 66%.
PWills on December 31, 2008 8:28 AM@Noaki
Umm, what?
Therac-25 on December 31, 2008 8:28 AMBoy 100%
Ahmed Nasser on December 31, 2008 8:28 AMReposting, since it actually has a formula people can follow...
"I intuitively like the 50% of 75% = 37.5% idea...
However,
P(b|g) = P(b AND g)/P(g) = 0.75
P(b|g) = 0.50/0.667 = 0.75
But given that we can throw away one of the likelihoods (i.e. B+B)...
P(b|g) = P(b AND g)/P(g) = 0.667
P(b|g) = 0.667/1 = 0.667
So.... 66.67%"
nuclearnewyears on December 31, 2008 8:29 AM@Andrew
Flip two coins, then. If the statement "one of them came up heads" is true, what are the chances that you got a tails in that go, as well?
You can write the software to test it, if you want. The answer is 66%.
Therac-25 on December 31, 2008 8:30 AM@Patrick:
"I'm not going to redo his math to show it's 2/3rds, but I am unconvinced by him."
Please do the math.
Also, why would I weight either branch? Each branch is as likely as the other.
fre0n on December 31, 2008 8:31 AMGrief grief grief. I haven't read all the answers but presumably some of you are seriously bored. Me too!! Who wants to work on NYE?!
We know there are four combinations, BB, BG, GB, GG. Each category has roughly/statistically the same amount of kids in.
The parent speaks from any of the last 3 categories, so you've got 2 cases out of a possible 3 with a boy, 1 only with all girls.
=> 2 in 3 chance of both sexes.
...Right?
It still seems like 50% but my simulation says 66%.
In Haskell (underscores to preserve formatting):
import Random
import Data.List
main = do
__r1 <- getStdGen
__let (r2,r3) = split r1
____children = zip (randoms r2) (randoms r3)
____hasAGirl (a,b) = a || b
____hasABoy (a,b) = not a || not b
____familiesWithADaughter = take 100 (filter hasAGirl children)
__print $ genericLength (filter hasABoy familiesWithADaughter) / genericLength familiesWithADaughter
I think Nic Wise is right.. the "Girl and then Boy" and "Boy and then "Girl" options should be considered as a single option because they both result in 1 boy and 1 girl. this leaves 50% chance that the remaining child is a boy. However, as others have stated, if a person asked you the question the way it was worded they would seem to be implying that the other child is a boy.
Alpants on December 31, 2008 8:32 AMBy the way, +1 to Bill Mill. Very concise, very correct.
PWills on December 31, 2008 8:33 AM@Alpants
Gb and Bg both describe different states of the universe. If you want to "combine them", that's fine -- but then "Girl or Boy, order irrelevant" will have twice the probability of either Girl-then-boy or Boy-then-girl.
Therac-25 on December 31, 2008 8:34 AMBased on Jeff's link, he's probably looking for the fancy 66% Bayesian answer to the problem. It is pretty silly, though. The gender of one doesn't tell you anything about the gender of the other, and nothing in his statement of the problem even implies a conditional. Therefore the answer is 50% (or 49.5%ish if you want to take into account the fact that girls are slightly more common).
Anonymous Coward on December 31, 2008 8:34 AMI think this is a monty hall problem and exactly like what Parade magazine was described as doing on the wikipedia article, Jeff left out some explicit details of the question that affect the results. There is no direct quote where the person is saying "One of my kids is a girl". We don't know if Jeff is trying to ask us a probability question. I think the 66% is right and I also think that at least some of the 50% people aren't figuring out the odds correctly on the total combination of boy/girl. Sure - there are 3 POSSIBILITIES (excluding birth order) (Boy and Boy, Girl and Girl, and Boy and Girl) but they don't have the same PROBABILITY of occurring.
Jeff Martin on December 31, 2008 8:35 AM@Noaki
Sorry, but it's a pair of chromosomes that get XY or XX, only the second one of the pair has the chance ie there's no YX pairing, presumably if so lots of people would get both sets of junk and no ears or something
Tobermory on December 31, 2008 8:35 AMint noChildren = 2;
int noGirls = 1;
int noBoys = noChildren - noGirls;
print(noBoys);
I'm surprised at the number of 50%'ers out there.
If we were told that the first child was a girl, what are the probabilities that the other child was a boy, then you'd be right. But that's not the question!
Here's a related question: you have three drawers, one contains two blue socks, another contains a blue and red sock, and the last contains two red socks. You don't know which is which. You open a drawer and pull out a red sock, what is the probability that the sock in the drawer is red?
There are only two colours blue and red and by drawing a red sock we've narrowed the possible drawers to two, but you're absolutely wrong if you answer 50%.
Tyro on December 31, 2008 8:37 AMPeople, we all know that a given child has a 50% chance at each gender! That's not in dispute.
But we're talking here about a series of unrelated events, filtered by an incomplete set of knowledge.
It's okay if you're not comfortable solving that sort of problem, but for you to have no respect at all for the fact that it might be more complicated than you think is just.... well, it's scandalous! Shocking!
The comment by Michael Riecken in particular is very unsettling.
If you think it's 50% that's okay, but you damn well better either:
A) show your impeccable work
or
B) have an open mind for the possibility that you might be wrong
> Therac
> Gb and Bg both describe different states of the universe
Why is that true but not Gg and gG?
Rob on December 31, 2008 8:39 AMAs an interesting aside, I didn't want the answer to be 66% because of the rudeness of the people like Fred. However, unfortunately, that's what it looks like to me, as I showed in my other post. I think it's an interesting personal observation. I'd rather the obnoxious people be incorrect, but what can you do?
nuclearnewyears on December 31, 2008 8:41 AM@Rob
"My older child is a girl and my younger child is a girl."
"My younger child is a girl and my older child is a girl."
One parent with two children can say those in the same universe and not contradict themselves.
Therac-25 on December 31, 2008 8:41 AMOr give it a try:
wget http://pastie.org/349733.txt && python 349733.txt
.. because java sucks :)
Dice don't have memory. Neither do lottery balls or playing cards. This is why Las Vegas and the lottery continue to exist.
The problem to consider has nothing to do with one of the children being a girl (other than to know to exclude boy-boy combinations), but what are the odds that the other child is a boy.
I submit that excluding accommodating for birth order and excluding the case for two boys (we already know there are not two boys from the problem statement) that you have the following choices:
girl - boy
or
girl - girl
I say 50%.
Mike on December 31, 2008 8:45 AM@nuclearnewyears:
Rudeness? Where was I rude?
plceli and Steve had rude posts, I don't think I was deliberately rude.
Fred on December 31, 2008 8:46 AM@Mike
You can't exclude birth order, though -- unless you've been told which one is the girl, then the options are:
girl - boy
boy - girl
girl - girl
If you exclude birth order, that's fine, but then you have to weight the girl-boy selection appropriately, as girl-boy-order-excluded has a different probability than girl-boy-in-order.
Therac-25 on December 31, 2008 8:48 AMI agree with everyone mentioning twins. It's a total geek way of saying he's having twins.
So, I see a lot of people over think things a bit much, given I have source code, and a bunch of equations to use to determine the probability of the gender of the second kid.
Fun stuff, congrats Jeff if you're having twins. I'm hoping you have B/G twins, makes things more fun growing up. :D
Sentax on December 31, 2008 8:49 AMThe sex of other child is independant of the sex of the first child. It is like the probability of having tail while tossing a coin after having head.
So it should be (unless the parents are not humans) the average probability of having boy.
It is at first order 50% (picking up a X or Y), it could be completed with a second order effect (small positive bias towards women 128 G/100 B ), and with a third order effect (probability of picking up ŕ XXX or a XXY).
Since, it is a game on a geek blog I'd expect first order effect to be a good answer.
So unless there any other revelant informations, and that a 3% approximation is acceptable then the answer is 50% +-5% (this is not a precise answer, but an accurate one with a little margin taken for confort)
Would it be a politicial blog, I'd take care that a biased statistic is not expected (like the strong cultural bias against women birth in India or China). Would it be a scientific blog expecting us to be careful on assumption, I'd give a probability in function of life expectancy in case jeff wanted to trick us on the strong male/female life expectancy bias (he never said the person in question was less than a century old therefore that children where younger than 60 years old)).
There is no such thing as a good answer, there are only expected answers. The way a question is turned always gives strong hints on the right answer, but as Dr House said, people lies :o)
The reason why I love programming is we are building our software out of the "expected" frame of mind. We are free to choose an answer as long as we ask back the good questions to our customers.
In real life, there are no such things as a one turn question/answer, there is back and forth discussions from which we grow solutions :o)
Sofware is not a goal it is a journey.
jul on December 31, 2008 8:50 AMMy first instinct was 50%, but after reading the comments here I am pretty sure it is 66% (2/3). What you have to remember is that we're sampling from the population at large, specifically the portion of the population with two children, at least one of which is a girl. Here's a simple C# program I wrote that builds a population of parents with two children and shows the probability of various child combinations. It then samples randomly from those parents, throwing away results from parents with two boys, to determine the likelyhood of both children being girls if one of the children from the sample point was a girl. The resulting probabilities are 66% that it is a boy and a girl and 33% that it is two girls.
using System;
using System.Collections.Generic;
using System.Text;
namespace BoyGirlTest
{
class Program
{
static void Main(string[] args)
{
const int sampleSize = 100000;
int bb = 0;
int bg = 0;
int gg = 0;
System.Random r = new Random();
for (int x = 0; x < sampleSize; x++)
{
int boys = 0;
for (int y = 0; y < 2; y++)
{
if (r.NextDouble() > 0.5)
{
boys++;
}
}
switch (boys)
{
case 0: gg++; break;
case 1: bg++; break;
case 2: bb++; break;
}
}
Console.WriteLine("BB: {0}%", (double)bb / sampleSize * 100);
Console.WriteLine("BG: {0}%", (double)bg / sampleSize * 100);
Console.WriteLine("GG: {0}%", (double)gg / sampleSize * 100);
double pbb = (double)bb / sampleSize;
double pbg = (double)bg / sampleSize + pbb;
double pgg = (double)gg / sampleSize + pbg;
int mixed = 0;
int allgirls = 0;
int allboys = 0;
for (int x = 0; x < sampleSize; x++)
{
double test = r.NextDouble();
if (test >= pbg)
{
allgirls++;
}
else if (test >= pbb)
{
mixed++;
}
else
{
allboys++;
}
}
Console.WriteLine("All Girls: {0}%", (double)allgirls / (sampleSize - allboys) * 100);
Console.WriteLine("Boy & Girl: {0}%", (double)mixed / (sampleSize - allboys) * 100);
}
}
}
It's 50%. In Ruby:
a = []
500000.times { a << [rand, rand] }
boy_or_girl = a.collect {|pair| pair.collect { |x| x >= 0.5 ? :boy : :girl } }
num_true = boy_or_girl.inject(0) {|acc, pair| ((pair[0] == :boy and pair[1] == :girl) or (pair[0] == :girl and pair[1] == :boy)) ? acc+1 : acc }
puts num_true.to_f / 500000.0
>> 0.499728
Any objections?
Paul Betts on December 31, 2008 8:52 AMThere's a 50% chance statistically. However, why would that person tell you that one of them is a girl? Why not tell you that both of them are girls if that's the case. So if you're dealing with a rational human who doesn't speak in riddles then it's very likely that the other child is a boy. If you take this reasoning further then you may think that this person is cagey about the gender of the other child and that is why they said that one is a girl so that may push up the probability that the other is hermaphrodite.
Guy Ellis on December 31, 2008 8:53 AMFor what I can read in the comments, those in the 2/3 camp differentiate BG and GB. If you do that, then yes, for sure the odds are 2/3, but that's because you're taking into consideration the order in which the person had his/her children.
Nothing in the question indicates that this order has to be taken into consideration. For that reason the only good answer is 50%, at least to me, because it's the answer that doesn't assume there is a problem where there is none.
David on December 31, 2008 8:54 AMOK fre0n, I will accept your challenge and show the math in your style, and how even then it still should arrive at 2/3rds.
You split the problem space in two based on "which child was revealed to be a girl."
For the GB and BG cases, it can be clear which child was revealed: the girl. So GB must go into "first child revealed as girl" while BG must go into "second child revealed".
But what abou the GG case? Which child did they reveal? This is the missing piece from your math.
Let's say it's a 50/50 split within that group, okay? (I choose this because it keeps the sub-trees balanced to even population sizes and therefore even chances, but this is not necessary, it will work with any distribution, just makes the math messier.)
So we're splitting the GG group into two: GG1 which reveals their first child as a girl, and GG2 which reveals their second child as a girl.
Let's summarize our population now..
First, before this split:
BB: 25%, totally excluded from puzzle
GB: 25%
BG: 25%
GG: 25%
Now we'll drop the BB and split the GG into GG1 and GG2:
GB: 25%
BG: 25%
GG1: 12.5%
GG2: 12.5%
Now, let's re-do your math, based on a paste from your original post:
If the first child was revealed to be a girl, we can eliminate BG and GG2, leaving us with:
GG1 - 12.5%
GB - 25.5%
So within this subgroup we have a 2/3rds chance of having one boy and one girl.
If the second child was revealed to be a girl, we can eliminate GB and GG1, leaving us with:
GG2 - 12.5%
BG - 25%
This also gives us a 2/3rds chance that there is one boy and one girl.
Convincing?
D'oh, forgot the critical line, which changes the answer to 66%. Epic fail:
a = []
500000.times { a << [rand, rand] }
boy_or_girl = a.collect {|pair| pair.collect { |x| x >= 0.5 ? :boy : :girl } }
boy_or_girl = boy_or_girl.select { |pair| pair[0] == :girl or pair[1] == :girl }
num_true = boy_or_girl.inject(0) {|acc, pair| ((pair[0] == :boy and pair[1] == :girl) or (pair[0] == :girl and pair[1] == :boy)) ? acc+1 : acc }
puts num_true.to_f / boy_or_girl.length.to_f
>> 0.666664887925997
Ok, lets say a person has a daughter and is pregnant with the second child - you would all (hopefully) agree that there is a 50% chance it is a boy, right? [i.e., the only possibilities are G-b and G-g - in other words you know the existing daughter is older]
Now lets say they already have two kids. They show you one of them and it is a girl. The probability of her begin the older one is 50%. The probability of the younger one being a boy is still 50%. The probability of the daughter you know being the younger one is 50%. Even in that case, the probability of the older one being a boy is still 50%. Probability of boy = 0.5x0.5 + 0.5x0.5 = 0.5.
For those comparing this to a coin toss - consider this. Lets say I tossed two separate coins and covered the results with two sheets of paper. I reveal one of the results to you and its a tail. what is the probability that there is a head under the other sheet of paper?
The problem here is that you are considering B-G and G-B to be two separate results but G-G as one result. Either you say there are three total possibilities [order doesn't matter] - (B,G), (G,G), (B,B) in which case, you eliminate (B,B) and you are left with 1/2 possbility of (B,G). Or you say given G* [order matters], you have B-G*, G*-B, G-G*, and G*-G in which case the probability of boy is still 1/2.
George's argument is also a good one to prove 50% [reductio ad absurdum]
Prasanna on December 31, 2008 8:56 AMOkay, 50%ers try thinking of it this way.
400 sets of parents have one kid. 50% have girls, 50% have boys. Then they all have a second kid. Again, 50-50 girls and boys. 800 kids in total. But the actual breakdown of families would be like this:
Gg: 200 (capital letter for the older kid)
Gb: 200
Bg: 200
Bb: 200
So when you look at the argument you have to consider there are twice as many families with both gendered kids as those with just all girls.
2/3
The parent has two children which can come in one of four ways:
O|Y
---
B|B
B|G
G|B
G|G
Since we know that one of them is a girl, that eliminates the BB row. That leaves 3 rows and in two of them there is a boy giving a probability of 2/3.
More technically:
let A = "The event where the parent has a boy and a girl"
let B = "The event where the parent has at least one girl"
By Bayes theorem, P(A|B) = (P(B|A) * P(A))/P(B)
P(B|A) = 1 since if the parent has a boy and a girl, they clearly have at least one girl.
P(A) = 1/2 as shown in the table above
P(B) = 3/4 as shown in the table above
This gives the following calculation:
P(A|B) =(1 * 1/2) / (3/4) = 1/2 * 4/3 = 2/3
I'm a programmer, not a statistician. I would bounce it back to QA for more information.
If the person that is giving me this information is a "jock", the "girl" could actually be a boy that under performs athleticly or is a "cry baby"
This quirk of language could also occur if the other child is a teenage (or older) female & is insulted by the childish title of "girl". Teen Angst FTW.
1001010 on December 31, 2008 8:56 AM@Paul Betts:
I don't know ruby, but how do you account for the boy/boy pairs that should be ignored? It looks to me like you are just counting the number of boy/girl pairs in the entire population (which would come out at 0.5)
@jul
The probability of the event may be 50% -- if you've had a boy, then your next child is at ~50% or so.
But probabilities do not describe the universe -- they describe our states of knowledge and ignorance about the universe. To say "I have a 50% chance of having a boy" is to say that you lack the information about what sperm is going to win the race, how the chromosomes are going to interact in what way in the zygote, whether or not the child reaches term, etc, etc. If you HAD all that knowledge, and you had the capability to make predictions at that level (which realistically would require simulating a temporary universe and running another copy of yourself and your spouse) then it wouldn't be 50% -- you could predict it accurately. But because you lack all of that information, then we have to make do with probabilities.
What we have in this example is a situation, and incomplete knowledge about the simulation. If you're having a second child, then you KNOW the gender of your older child. That's MORE knowledge than we have in this example. In this example, we just know if "one" of them is a girl. That's less knowledge than knowing if the older one is a girl, so we can't say as much about the gender of the other child.
harrr, too slow
Fred on December 31, 2008 8:58 AMThis is a very tricky riddle. So tricky, in fact, that it has NO answer: 0.666 and 0.5. can both be right or wrong, depending on your definition of probability. Read bout it here:
http://www.overcomingbias.com/2008/10/my-bayesian-enl.html
42.
master chief on December 31, 2008 8:58 AMMarilyn Vos Savant used this in one of her columns. Here's a write-up: http://en.wikipedia.org/wiki/Marilyn_vos_Savant#.22Two_boys.22_problem
Brian Deterling on December 31, 2008 8:59 AM@Paul Betts
In your example num_true is the number of families with a boy and a girl, the question is how many families that have at least one girl also have a boy. So first you have to look only at the families where the first or second is a girl. From that group which ones have a boy?
Trystan on December 31, 2008 9:00 AM@therac
The problem statement does NOT say "What are the odds that person has a boy and a girl where the boy was born before the girl?"
It says "What are the odds that person has a boy and a girl?"
That means that
BG and GB combinations can and should be collapsed together.
Mike on December 31, 2008 9:01 AMIt's so funny that so many people are posting programs to prove their point -- as if the computer can't be wrong!
It shows a complete ignorance about programming: your program is going to make the same assumptions, right or wrong, that you do.
Of course your program will produce the same answer your mind does, how could it do any different?
Bob on December 31, 2008 9:01 AMI see what's going on here. This is a clear case of Schrödinger's child.
Until we observe this child, he/she is in a quantum superposition of all possible genders. Since this child exists as both male and female simultaneously, I'm going with 100% chance of being male and also a 100% chance of being female.
Matteo on December 31, 2008 9:01 AMI've pretty much been convinced now that 66% is correct. It is surprising to me though.
Colin on December 31, 2008 9:02 AMIf you take the question as a problem of statistics, it's 50%. There are three possibilities, one of which have been disqualified (BB). You are left with two possibilities and, assuming equal likelihood, the BG/GB scenario is 50%.
Chris on December 31, 2008 9:03 AM@Mike
> BG and GB combinations can and should be collapsed together.
That's fine, do that. But if you ignore order, you have to weight it appropriately. AB order ignored is twice as likely as AB in order.
Therac-25 on December 31, 2008 9:05 AMPrasanna says "They show you one of them and it is a girl."
That's where you lose the correct answer.
They don't show you one and ask about the other.
They say:
- I have two children
- At least one is a girl
And that is the difference between 50% and 66%.
PS Thanks, everyone, for a very unproductive morning!
C#:
int sampleCount = 10000;
int hasGirlCount = 0;
int hasGirlAndBoyCount = 0;
Random rgen = new Random();
for(int ii=0; ii<sampleCount; ++ii)
{
int sample = rgen.Next(4);
bool hasBoy = (sample & 1) != 0;
bool hasGirl = (sample & 2) != 0;
bool hasGirlAndBoy = hasGirl && hasBoy;
if(hasGirlAndBoy) ++hasGirlAndBoyCount;
if(hasGirl) ++hasGirlCount;
}
Console.WriteLine("count(one girl and one boy) / count(one girl and whatever) = {0}", ((double) hasGirlAndBoyCount) / hasGirlCount);
JAG on December 31, 2008 9:07 AMI'm filing this one under "ways to start a nerd fist fight" right up there with .999~ == 1.
Michael C. Neel on December 31, 2008 9:07 AM@Mike
> It says "What are the odds that person has a boy and a girl?"
To clarify, the question is properly phrased as:
"What are the odds that a person has a boy, GIVEN that they have a girl?"
Therac-25 on December 31, 2008 9:08 AMThe question is boring, but the answers (comments) are highly entertaining. I hope none of you are working on elevator software.
Jim on December 31, 2008 9:08 AMlol at the people that come up with a program to certify their answer. You can make your program to tell whatever you want, it doesn't make it correct.
@Jim
I am a software engineer. But no elevators. Just the space shuttle and complex medical instruments. :)
Mike on December 31, 2008 9:10 AMIt can be 50% or it can be 33%. It depends on the exact nature of the information "and one of them is a girl."
Go to a mall and conduct this study: Ask every parent with twin infants about the sex of one of their children at random. Don't pursue the questioning with any parent that says "Boy." You will find 50% Girl/Girl pairs.
To get 33% have a second person go to a mall and prepare every parent before you talk to them. Have him say "If anyone asks you, tell them about the sex of any girl child first." Throw out of the mall any parents with a Boy/Boy parent.
Most people, upon hearing the problem, think of the first scenario. When explaining the problem, most people use the second scenario as a 'gotcha.' It looks impressive, but isn't.
Thras on December 31, 2008 9:10 AM@Brian Deterling
The following quote is particularly pertinent:
"Finally vos Savant started a survey, calling on women readers with exactly two children and at least one boy to tell her the sex of both children. With almost eighteen thousand responses, the results showed 35.9% (a little over 1 in 3) with two boys." [1]
[1] <a href="http://en.wikipedia.org/wiki/Marilyn_vos_Savant#.22Two_boys.22_problem">http://en.wikipedia.org/wiki/Marilyn_vos_Savant#.22Two_boys.22_problem</a>
The problem is slightly different, but analogous. In the real world, of two child couples where one of them is gender A, the other one is gender A 1/3 of the time. Leaving 2/3 of the time where the couples is AB.
Chase Seibert on December 31, 2008 9:11 AMYes, I saw many variations on this program:
a = 5;
b = a* 22 + 17;
printf( "66%% suckers" );
@Therac
>The confusion here is being caused by understanding exactly
>information is contained within that statement. If you phrase it
>more explicitly -- "one of them is a girl, maybe both are, but I'm
>not telling you anything other than just one of them is a girl" --
>much of the confusion would be dealt with.
..but not all of the confusion! You still need some additional context to decide how to answer the question.
Consider the following representation of the distribution of 2 child families (using the obvious notation): {bb, bb, bg, bg, gb, gb, gg, gg}. I've included each alternative twice to simplify the following argument.
Each parent (one per family) makes the statement 'At least one of my children is an X' where X can be 'girl' or 'boy'. If they have a boy and a girl, they pick one of them randomly; if both children are the same sex, they don't have a choice.
We'd expect (on average) half of these statements to have X=='girl'. The subsample which produces this answer is {bg, gb, gg, gg}, since only half of the bg and gb parents makes the statement with X=='girl', but *all* of the gg parents do. Note that 50% of this subsample represents a boy-girl combination.
One the other hand, if we instead ask each parent 'can you truthfully make the statement "at least one of my children is a girl"?', the subsample which is able to answer 'yes' is {bg, bg, gb, gb, gg, gg}, and in this case, 2/3 of subsample represents a boy-girl combination. Note there is an implicit bias in the question being asked, which amplifies the weight attached to the boy-girl combos.
In summary, it makes a difference whether it's assumed that the person making the statement had the freedom to select the value of 'X' in an unbiased fashion (within the constraints imposed by the actual sexes of their children).
Henry Buckley on December 31, 2008 9:12 AMThe BG and GB should NOT be considered as a single option
http://www.in-gender.com/xyu/Odds/Gender_Odds.aspx
Check out "2-Children Families" on the very last chart
Foozinator on December 31, 2008 9:12 AM@Bob, @plceli
No, my program didn't confirm what I thought. Actual tests are the best way to catch the shortcuts and assumptions your mind makes. As long as your code actually asks exactly what the question does.
Trystan on December 31, 2008 9:14 AM@Foozinator
Sigh - of course you can do this given the fact that the problem statement DOES NOT state that birth order is important. Therefore, birth order can and should be disregarded.
Mike on December 31, 2008 9:15 AMWhat's the point of reading the comments if they don't deliver an answer?
no on December 31, 2008 9:15 AM@Chase
No fair! Using the universal teacher's copy!
Tobermory on December 31, 2008 9:15 AMThe difference between BG and GB only matter if the age of the children is considered in the original problem.
However, nowhere in the problem does it mention having one child before the other.
This allows the assumption that maybe the two children are twins and you can stop worrying about age.
Therefore, BG = GB... Leaving only two possible options.
Lancejt on December 31, 2008 9:18 AMIt doesn't matter whether you consider BG and GB as a single possibility or not. What matters is whether you realize what you're assuming.
If you consider BG and GB to be a single possibility, then you have to realize that this single possibility is more probable than GG or BB.
If you consider BG and GB to be separate possibilities, then BG, GB, BB, and GG all have equal probabilities. This is, to me, an easier way to look at it.
Chickencha on December 31, 2008 9:18 AMPrasanna:
You said:
>> Lets say I tossed two separate coins and covered the results with two sheets of paper. I reveal one of the results to you and its a tail. what is the probability that there is a head under the other sheet of paper?
I think that that is a different problem than the one presented above. In the above, it was a given that the sample contained at least one girl. In your example, you could have had any result, and it happened to be a girl (tails in your coin example). So of course in your example it is going to be 50% because there is no sample filtering. The tossed coin that is sitting under the second sheet of paper is equivalent to a second, independent event. In the problem above, the filtering out of a set of possible samples reduced the denominator (sample set size) from all possible outcomes to only those with at least one girl.
To make your example isomorphic with the boy/girl example, say you flipped two coins, looked at both of them, then showed one of them to me, and it was tails. You're selectively giving me information from one event out of two separate events. Since you considered both events before showing me the tails, I have to consider both of them in deciding the probability, rather than just considering one, independent event. And in that case, in the population of all possible unordered coin-flip pairs, the probability of tails-tails is 25% and the probability of tails-heads is 50%. I throw away the 25% probability of heads-heads, so the probability of heads-tails is 50%/(100-25%), or 66%.
@Mike
I wasn't talking about birth order. Check out the stats. A family is twice as likely to have a mixed gender pair of kids than either all boys or all girls.
Foozinator on December 31, 2008 9:21 AMThis particular puzzle is best expressed as "you know one of them is a girl" rather than the vague statement used in this post: "you met someone who told you they had two children, and one of them is a girl." It's very clear the answer is 2/3 if you only know one of them is a girl, but if you also have that extra piece of implied information -- the parent might have said "one of my children is a girl," then you can go on these tangential diversions to psychoanalyze that statement.
If Jeff's goal in that awkward working was to create more debate and discussion, the tactic has succeeded in spades. Me, I'm firmly in the 2/3 camp, because I've not been explicitly told that the parent said "one of my children is a girl."
For example, suppose you meet someone with a girl in hand, and they say "I have two kids, this is one of them." That's a non-negotiable 2/3 scenario, and consistent with the statement "you met someone who told you they had two children, and one of them is a girl."
Doug on December 31, 2008 9:22 AMI'd say 100%, because clearly the picture included are the boy and girl in question.
HB on December 31, 2008 9:23 AM@Mike
> Sigh - of course you can do this given the
> fact that the problem statement DOES NOT
> state that birth order is important. Therefore,
> birth order can and should be disregarded.
That's FINE. Disregard birth order. The problem is that the probability of events AB ignoring order is the sum of the probability of AB in order and BA in order. If you want your answer to be correct, you can't just say that P(AB Order Ignored) = P(AB In Order). That is WRONG.
Therac-25 on December 31, 2008 9:24 AM@Mike
>birth order can and should be disregarded.
Yes, but not the size of the population. Because the birth order is disregarded, you get twice as many BG combos as GGs.
Extending your position to the overall picture, you'd get 2-child families distributed like this:
1:3 with 2 boys
1:3 with 2 girls
1:3 with both.
If the first child was, say, a girl, the chances of getting another girl would be 2:3, which ain't the case. Unless your Snoop Dogg.
Tobermory on December 31, 2008 9:24 AM> This particular puzzle is best expressed as "you
> know one of them is a girl" rather than the vague
> statement used in this post: "you met someone who
> told you they had two children, and one of them
> is a girl." It's very clear the answer is 2/3 if
> you only know one of them is a girl, but if you
> also have that extra piece of implied information
> -- the parent might have said "one of my children
> is a girl," then you can go on these tangential
> diversions to psychoanalyze that statement.
This is true. The correct phrasing of this question is :
"What is the probability that a parent with two children has a boy, given that they have a girl?"
That's what Jeff is trying to say, he's just trying to be clever by not phrasing it like a math problem because he hates his readers.
Therac-25 on December 31, 2008 9:26 AMLet's try it with real numbers. Assume perfect distribution.
1) Say we have 100,000 2-child families:
GG 0.25% 25,000
GB 0.25% 25,000
BG 0.25% 25,000
BB 0.25% 25,000
2) Families with one girl: (GG, GB, BG) = 3 * 25,000 = 75,000 families.
3) Families with one girl and one boy: (GB, BG) = 2 * 25,000 = 50,000 families.
4) Probability of 1g 1b given 1g = 50,000 / 75,000 = 2/3
OK now the key question for those who disagree is which part is wrong? Steps 2,3,4 are basic math and can't be disputed. Therefore step 1), the distribution of the families, must be the issue and can be debated in isolation.
Tim Hollingsworth on December 31, 2008 9:26 AM============= I'VE FIGURED IT OUT =============
I'm beginning to understand why so many people have such different opinions on this. We have to take a step back, and realize that we're not talking about the probability of the same thing.
If you take all the mothers who have two kids, and only count those who have at least one daughter, then the probability of the other kid being a boy is only 1/3, because we have eliminated all the families with two boys. Hence, we're less likely to find a boy as the second sibling.
If, on the other hand, we take all the mothers who have two kids, but this time we count how many of those have kids of opposite sexes, we end up with a probability of 1/2.
The way the question is asked makes me think the second approach is more appropriate (but I can see how one may differ).
Here's an example of alternate formulations where the problem is decided more clearly one way or the other:
1/ You're a teacher in an all-girl school. At the PTA meeting, a parent mentions she has one (1) other child. What's the probability of it being a boy? 1/3
2/ You're the father of one (1) daughter. Your wife is pregnant again. Bad luck, you have a car accident, go into a coma for 9 months. When you wake up, what are the chances you're having a boy this time? 1/2
NM on December 31, 2008 9:26 AMQ: two children, and one of them is a girl. What are the odds that person has a boy and a girl?
_______________________________
Monty Hall is our of the question, because:
the likely hood of having a boy or a girl individually is 50%, resulting in groups BB, BG, GB, and GG.
We know there is a girl, so BB is impossible
BG = GB (there is no order present in the question)
SO we're left with (BG|GB) + GG, leaving 2 possible combinations
meaning we're still at a 50% change of gender.
_______________________________
Let's try Bayes:
the probability of one's gender is 50%, the second child has a 100% chance of being female.
P(a) & P(a') = the probability of one's gender = .5
P(b|a) = the probability of two's gender given P(a) = 1
P(b) = .5*.5 + 1*.5 = 0.625
(.5*1)/0.625 = 0.8
SO there's an 80% chance of the other being a girl ... i think
Bayes' theorem is crazy.
So I'm thinking it's a 50/50 chance no matter what.
JKirchartz on December 31, 2008 9:27 AMTotal possible combinations: BB, BG, GB, GG
P(b|g) = P(b AND g)/P(g) = 0.75
P(b|g) = (|BG, GB|/4)/(3/4)
P(b|g) = 0.50/0.667 = 0.75
But given that we can throw away one of the likelihoods because of prior information (i.e. B+B)...
Total possible combinations: BG, GB, GG
P(b|g) = P(b AND g)/P(g) = 0.667
P(b|g) = (|BG, GB|/3)/(3/3)
P(b|g) = 0.667/1 = 0.667
So.... 66.67%
nuclearnewyears on December 31, 2008 9:31 AMTotal possible combinations: BB, BG, GB, GG
P(b|g) = P(b AND g)/P(g) = 0.75
P(b|g) = (|BG, GB|/4)/(3/4)
P(b|g) = 0.50/0.667 = 0.75
But given that we can throw away one of the likelihoods because of prior information (i.e. B+B)...
Total possible combinations: BG, GB, GG
P(b|g) = P(b AND g)/P(g) = 0.667
P(b|g) = (|BG, GB|/3)/(3/3)
P(b|g) = 0.667/1 = 0.667
So.... 66.67%
nuclearnewyears on December 31, 2008 9:31 AMJeff needs to make Coding Horror-branded wall pads, so slamming my head against the wall will be less painful.
Therac-25 on December 31, 2008 9:31 AMI've realized that there are two different 50% camps. Here are responses to each of you:
"It's a coin toss - child 1 doesn't affect child 2 - having more information doesn't change the odds"
Having more information doesn't change the odds of our arriving at a particular place, but it changes what we know about that place. Here's a contrived (and annoying) example.
I'm going to throw a die, then give you a chance to bet on the result. If you bet on 6, what are the odds that you'll win? 1 in 6, right? Now suppose that I throw the die again. This time, I tell you that the result is NOT 6. If you bet on 6, what are the odds that you'll win? 0. When the die was thrown, the odds were 1 in 6 that it would come up 6, but once more information was received, we had to change our assessment. In the case above, if we only know that two children exist, the odds of having one girl and one boy are 1/2. Once we have more information (that it's not two boys), our assessment should change.
For the "There are 3 possibilities: BB, BG, GG because order doesn't matter" people, I'll offer the following thought: just because there are three possibilities doesn't make them equally likely.
Let us turn our attention to a pair of dice. What are the odds that I will roll double-sixes? Well, let's designate N as "not a six" and 6 as "six". Then the possible outcomes are 66,N6,6N,NN. But since we don't care about order, that's the same as 66,6N,NN, so the odds of double sixes are 1 in 3, right? No? Should we have weighted all the possibilities differently?
In the case of kids or a coin tosses (or anything else with a 50-50 chance), there are four possibilities: AA, AB, BA, BB. If we regard AB and BA as equivalent (because we don't care about order or color or whatever makes the two items distinct), we have the following weights: AA=1, AB=2, BB=1. Once we recognize that the boy/girl combination is twice as likely as either of the other two, when we throw out the boy-boy combination, we're left with 2 (girl/boy) / 3 (girl/boy + girl/girl) = 2/3.
But we already have so many comments, nobody's going to read this one.
For all you Random Variables addicts:
# girls = A ~ Binomial(2, 1/2)
P(A=0)=P(A=2) = 1/4
P(A=1) = 1/2
P(A = 1 | A >= 1)
= P(A=1, A>=1) / P(A>=1)
= (1/2) / (3/4)
= 2/3
Lord, please save me from this madness!!
Judging by these comments, what kind of software system would this produce if we split people into management, analysts, and programmers?
Oh the pain of it all, the utter disaster of an over budget, missed the user requests, coding horror pain of it all...
The collected wisdom here makes me want to shoot myself in the face. We can do no better than arguments about junior high school probability?
Within the first 25% of the comments, the only people to get anywhere close to the correct answers are Ishmaeel, Jeff Schwandt and (snarkily, though absolutely correctly) transiit. The answer is that only real unfunny pranksters would tell you that one child was a girl and that the other one... oh, wait, was a girl too! So the answer would be culturally determined, but one would expect in a Western culture at least that it would tend towards 100%.
Douglas Greenshields on December 31, 2008 9:34 AM@David
You are exactly correct in your first paragraph but I beg to differ with your analogy. I told you about one of my kids' gender completely at random and asked you about the probability of the other one being of the opposite sex. In other words, I could just as well have removed the sheet of paper from the other result, showed you that it was X and asked you what is the probability of the other one being Y. They *are* two independent events.
@Doug
If I met you with my daughter in hand, the probability of my other kid being a boy is a _non-negotiable 2/3_?? Care to explain?
Again, go back to George's extension of the 2/3 theory - if i showed you 9 of my 10 kids to be girls, you would be 90% sure my other kid is a boy? *Really?*
Prasanna on December 31, 2008 9:36 AM@Douglas Greenshields
> The collected wisdom here makes me want to shoot myself
> in the face. We can do no better than arguments about
> junior high school probability?
The tone is being set by the blog author. This is clearly a Bayes 101 post.
Therac-25 on December 31, 2008 9:37 AMLord, please save me from this madness!!
Judging by these comments, what kind of software system would this produce if we split people into management, analysts, and programmers?
Oh the pain of it all, the utter disaster of an over budget, missed the user requests, coding horror pain of it all...
Jeff, you really need to attract a better clientele.
Pardeep on December 31, 2008 9:37 AMIsn't it pretty simple?
Let A = event that first baby is a girl
Let B = event that second baby is a boy
P(A) = P(B) = 0.5
Since A and B are independent, therefore P(B|A) = P(B) = 0.5
Of course, that's assuming P(B) = 0.5 (which may not be true...)
Am I missing something here?
Jack Hsu on December 31, 2008 9:39 AMOK, let's spell this all the way out. If you take into account birth order as well as all possible gender combinations of two children, you have 8 possibilities (the number suffixes indicate birth order):
B1B2
B2B1
G1G2
G2G1
B1G2
G1B2
B2G1
G2B1
If it is revealed to you that birth order does not matter, this drops the number of possibilites to:
BB
BG
GG
GB
If it is further revealed to you that there is at least one girl in the pair, then the number of possibilities is:
BG
GG
GB
Given these three possibilities, let's look at the question: "What are the odds that person has a boy and a girl?"
Well, now that I think about it a little more, with these three remaining possibilities, two of the three are boy girl combinations. I think I have just jumped into the 66.6% camp.
Anyone want to try to convince me otherwise. :)
Mike on December 31, 2008 9:39 AM
If I
"met someone who told you [me] they had two children, and one of them is a girl,"
then their other child is a boy.
Otherwise why would they say "one of them is a girl?"
Versus "at least one of them is a girl" or "both of them are girls."
ToeKnee on December 31, 2008 9:41 AMIts 50%.
The reasoning acording to which the probability of the second child being a boy is 2/3 is wrong. If it wasn't then given that someone who has 3 children and says that two are girls, the probability of the 3rd one being a girl would be 1/4. If they had 100 children and revealed that 99 are girls, the probability would be 1/100. Clearly wrong.
This is a classic case of dependant probability were P(a|b) = P(a*b)/P(a). --> P(2nd girl | 1st girl) = P(two girls)/P(one girl) = 0.25/0.5 = 0.5
Manu on December 31, 2008 9:41 AMThis is freaking Hilarious... I have read this Blog for quite a while now. I have worked as a Process Engineer for a Semiconductor Company. My job was to statistically compare process runs to determine the probablility of introducing defects through process variance.. I then work as a Software Engineer, I was one of those SE's that were profecient, but just did not like the work. Now I work as a business analyst.
What I find interesting is Engineers, and Developers all want to solve the damn problem before understanding what is it thye are trying to solve. They all want to apply a formula or code to issues. Engineers and SE's tend to overcomplicate the issue for the sake of overcomplicating the issue. They like to prove to people how they are so much smarter then others. As a group, they tend to be the most arrogant group of people I have met..
Now what is really dangerous is an Engineer that took a couple of programming courses in college. He really thinks he knows everything and that code can be thrown together in a couple of hours to get what he wants done.. I relly hate working on projects that are sponsored by engineers..
So, what does this long diatribe have to do with the answer? Pretty much nothing. Much like the information added to the riddle. It is just fluff..
For each and every child born there is a 50/50 chance it will be on gender or the other..
Trace on December 31, 2008 9:42 AM@Prasanna
*slams head against the desk*
> If I met you with my daughter in hand,
> the probability of my other kid being
> a boy is a _non-negotiable 2/3_??
> Care to explain?
Say this with me: Probability is a measure of an observer's state of knowledge and ignorance. It has no physical or metaphysical reality.
If you meet me with your daughter, and I don't know which child it is (older/younger), then YES, the probability of the other child being a boy is 2/3.
If I met one hundred parents-of-two-children in a row, with their daughters in tow, and I had no idea of the birth order of any of them, then 66% of them would have a brother. ~33% would have a sister, ~33% would have an older brother and ~33% would have a younger brother.
THIS IS BECAUSE OF MY IMPERFECT KNOWLEDGE. If I meet a different 100 parents, but know that it's always an older daughter, then ~50% will have a younger sister, and ~50% will have a younger brother.
> Again, go back to George's extension
> of the 2/3 theory - if i showed you 9
> of my 10 kids to be girls, you would
> be 90% sure my other kid is a boy?
> *Really?*
No, the math would be more complicated. If you give me a bit, I can do it properly.
This is ridiculous.
Over 400 comments and counting.
Don't you all have anything better to do on New Year's Eve?
Jeff, seriously ... how could you??? ;)
And this is the community that you want voting on things like "which is the best answer"?
I haven't looked carefully, but I'd guess that most of the calculations above are completely ignoring the probability that someone is hypothetically lying.
I did see at least one reference to "not enough information", so I suppose there is some hope for humanity.
"The collected wisdom here makes me want to shoot myself in the face. We can do no better than arguments about junior high school probability?"
The fact that there's any argument at all is what worries me. The problem stated very clearly, has a clear answer, and doesn't require any complicated thinking.
The answer is dependent on the fact that we are not trying to predict a future event. If we were trying to predict the probability that an unborn child would be a girl or boy, the answer is 1:1, 50%, half, or whatever you want to call it. Actually it is amazing how many people don't understand that one - it's why people continue to buy the scratch lottery tickets figuring if the last ones were losers, their chances keep getting better if they keep buying.
This is not about predicting a future event. Backgammon is one of my favorite games, so argue this one a bit - if you need a given number in order to make a winning move, what is the probability that you will get that number on your next dice roll? Some people think it's 2/6 (two dice with each number one time) - but it's actually 11/36 - which is not quite as good as 1/3 chance. If you've bet money on the game, it's pretty important to understand that. Argue away...
Jasmine on December 31, 2008 9:43 AM0.25 => 25%
probability of having a boy 1/2
probability of having a girl 1/2
probability of having a girl after having a boy (1/2)*(1/2) = 1/4 = 0.25 => 25%
This doesn't take into account the probability of having an hermaphrodite.
John_Idol on December 31, 2008 9:45 AM@VoiceOfInreason: check my earlier comments. I'm arguing with Dr. House: everyone is lying.
Being in the 50% school myself, I put together a simulator here: http://klozoff.ms11.net/testing/boygirl.html
Run it as many times as you'd like!
@Manu "The reasoning acording to which the probability of the second child being a boy is 2/3 is wrong. If it wasn't then given that someone who has 3 children and says that two are girls, the probability of the 3rd one being a girl would be 1/4. If they had 100 children and revealed that 99 are girls, the probability would be 1/100. Clearly wrong."
How is this "clearly wrong"? I'm not convinced. Look at the big picture. If someone has 100 kids it's really unlikely that all of them will be girls. We can agree on this, yes?
Now let's say we know that 99 of them are girls. There are 100 ways to have 99 girls and 1 boy. You could have the boy first, the boy second, etc. There is only one way to have 100 girls: have them all in a row.
If you said "Here's a couple that has 99 girls and they're about to have another kid," then I'd say there's a 50% chance that that kid would be a boy because we know the order. But that's a different question.
Chickencha on December 31, 2008 9:46 AM@Mike
> If it is revealed to you that birth order
> does not matter, this drops the number of
> possibilites to:
>
> BB
> BG
> GG
> GB
Before you notice your own mistake here (that you have two things in different order after saying order does not matter), you would end up with this if order didn't matter:
BB
BG-Unordered
GG
Where: P(BG-Unordered) = P(BG) + P(GB).
The calculations come out the same, but if you're going to ignore order, you have to do it right.
Therac-25 on December 31, 2008 9:46 AMBeing of the 50% school myself, I put together a simulator. It's here:
http://klozoff.ms11.net/testing/boygirl.html
Stephen Oberholtzer on December 31, 2008 9:47 AMNow, doing some reading, research, and thinking it out more, the problem becomes more complex when the wording of the given data is changed: you met a women walking with her daughter and she tells you she has two children. What is probability of other being a girl?
Most of your the posters have "leaped" to the above wording of the problem.
ToeKnee on December 31, 2008 9:47 AMManu, you're mistaken in your interpretation. You're treating the girls as being commutable, which they are not.
If the question were, "what is the chance that there are two girls given that the youngest is a girl?" then your interpretation would be correct.
mike on December 31, 2008 9:47 AMAnd another thing... The post isn't clear if we are talking about odds as in probability theory (http://en.wikipedia.org/wiki/Odds) or in the everyday language (aka probability).
Jack Hsu on December 31, 2008 9:48 AMPrasanna has it correct.
If the 66% people consider BG and GB to be distinct cases, then they must also consider that there are two GG cases - one where the revealed child is the eldest, and one where it is the youngest.
Leaving:
GG
GG
GB
BG
= 50%
Martin on December 31, 2008 9:49 AMwhat a train wreck!
sympatric greg on December 31, 2008 9:50 AMI've never felt this comic more appropriate than right now...
http://imgs.xkcd.com/comics/duty_calls.png
@Bob
Programs are obviously fallible but you can write a monte-carlo simulation that coincides very closely to the problem statement. ie:
a) give me a sample of families with at least one girl
b) give me the subset of families with a boy
c) prob = b/a
Since you don't have to refer to probability or use deductive reasoning (other than proof-by-monte carlo) it should be easier to convince someone or find out where your assumptions are different. Much harder to locate the fallicious derivations people are using and trying to convince them they are fallicious.
drscroogemcduck on December 31, 2008 9:52 AMI'd just like to point something out that seems rather fishy in all of the comments I've seen. I keep seeing 4 possible combinations:
boy-boy
boy-girl
girl-boy
girl-girl
The trouble is that in order to satisfy the question, order is not important. That means that
boy-girl and
girl-boy
are the same. Since we know that one of the options is a girl, that rules out TWO of the other options. Why? Consider if the left child is a girl
boy-boy (out)
boy-girl (out)
girl-boy
girl-girl
Or consider if the right child is a girl
boy-boy (out)
boy-girl
girl-boy (out)
girl-girl
Either way you look at it, assuming a 50% chance of gender at birth, the answer is 50%, not 67%.
Of course, considering that the question states that *one* of them is a girl (and not that at least one of them is a girl) the real answer is 100%, barring strange genderless children.
Just my thoughts on the subject.
Nicholas Flynt on December 31, 2008 9:52 AMmartin, you are incorrect. There are two childern, X, and Y.
You can't say that X=g & Y=g is a different case from Y=g & X=g, however, X=g & Y=b is clearly different from Y=g & X=b.
If you don't know which child is the girl (the younger or the older), then there are two ways in which the other child is a boy, and only one way in which the other is a boy.
mike on December 31, 2008 9:53 AM66% (You already know that one is a girl, but not in which order they were born) {GB, GG, BG}. Those are the only options left available to choose from, and 2 / 3 are the required Boy Girl mix.
Andrew on December 31, 2008 9:54 AMNicolas Flynt,
why do you think two are ruled out? Nowhere in the problem statement does it say that the girl is the younger.
mike on December 31, 2008 9:55 AMmike,
you are incorrect g1 != g2
Martin on December 31, 2008 9:56 AMMartin,
There are two children, conceived in two separate random events. One may be a boy or a girl, and the other may be a boy or a girl. If they are both girls, there is only 1 way to achieve that. If there is one boy and one girl, there are 2 ways to achieve that. That's why that it is incorrect to could the two-girl case twice.
Order does matter here. The problem is that we can't know the order a priori, which is why we end up with the unintuitive answer of 2/3.
mike on December 31, 2008 10:00 AM"If the 66% people consider BG and GB to be distinct cases, then they must also consider that there are two GG cases"
That's a good point. Considering that, I was wrong previously.
Total combinations possible: BG, GG (BB is not a possibility)
P(b|g) = P(b and g)/P(g)
P(b|g) = 0.50/1 = 0.50
Nicolas It is precisely because we don't know the order of birth that the answer is 66%.
The total set of all possible combinations for 2 children is this: {BB, GG, BG, GB}. If the question was (not knowing if the parent has a boy or girl, what are the chances they have both) then the answer would, indeed, be 50% as two of the options are the Boy Girl Options.
However, the question explicitly removes the possibility of BB from happening, and so we are left with 3 potential answers. Out of this 3 only 2 are the Boy Girl Mix that the question is looking for.
@Prassana
Damn, I guess it's not more complex. I thought it would come out weirder than it does.
P(A) is the probability that you have 10 girls, 1/1024.
P(A|B) is the probability that you have 10 girls, given that you have had 9 girls so far.
P(B) is the probability that you have 9 girls, 10/1024.
P(B|A) is the probability that you have 9 girls, given you have 10, this is obviously 1.
P(A|B) = P(B|A)P(A) / P(B) = 1*(1/1024)/1/512 = 1/1024 / 10/1024 = 1/1024 * 1024/10 = 1/10 = 10%.
1-P(A|B) = 90%
Keep in mind what you're saying here -- if you meet 1000 people in a row WHO YOU HAVE NO INFORMATION ABOUT that have 9 girls, then 90% of those are going to have a brother somewhere.
Probability is about the information state of the observer, NOT about reality.
Therac-25 on December 31, 2008 10:06 AM
Consider the coin flip. If you flip the coin enough it works out to 50/50 odds.
Every time you have a child(flip a coin) a 50 / 50 chance exists.
So BB, BG, GB, GG doesn't matter. The first child has no influence on the second child's odds.
ThatsOdd on December 31, 2008 10:06 AMThis is funny... that you guys can read hundreds of clear explanation of why it's 2/3 and not 1/2, and still argue the point as if it's some kind of opinion, is baffling. It is not a matter of opinion - it is about whether you correctly understand the problem or not.
There are two problems here:
1. In a two-child family where the gender of one child is known, what is the chance of the other child being a boy - 2/3
2. What is the chance of an unknown child being a boy - 1/2
The question in the OP is number 1. It is not a matter of opinion, it is a mathematical fact. If we can't depend on math to be factual and true, we might as well pack it in and go home.
Jasmine on December 31, 2008 10:07 AMnuclearnewyears,
don't confuse yourself with Nicolas's misguided logic! There is only one way for there to be two girls, namely, one girl was born and then another girl was born! The same is not true of the BG case.
mike on December 31, 2008 10:07 AMRead this: don't post a comment until you understand it - http://mathforum.org/library/drmath/view/52186.html
Jasmine on December 31, 2008 10:08 AMIck, typo in my above proof.
P(A|B) = P(B|A)P(A) / P(B) = 1*(1/1024)/10/1024 = 1/1024 / 10/1024 = 1/1024 * 1024/10 = 1/10 = 10%.
Therac-25 on December 31, 2008 10:09 AMThis is similar to the Monty Hall Problem and Bertrand's Box Paradox:
http://en.wikipedia.org/wiki/Monty_Hall_problem
http://en.wikipedia.org/wiki/Bertrand%27s_box_paradox
Share and enjoy!
Steve on December 31, 2008 10:10 AM@Martin
Of all 2-child families you could meet, these are the odds:
Both girls - 25%
Mixed - 50%
Both boys - 25%
This isn't counting order or figuring math. This is a census (http://www.in-gender.com/xyu/Odds/Gender_Odds.aspx - bottom)
Picking random families, you have a 75% chance of getting a family with a girl. Picking families with a girl, having 2 chances evens out the homogeneous families with the mixed ones. But neither of these is the question.
You're about to be introduced to the Thompson family, and you hear that they have 2 kids. Their chances of having a girl are 75%, and their chances of having mixed kids is 50%. When you're introduced to them, they also introduce their daughter, Erica. This new information narrows the possibilities. Their chances of having a girl is now 100%, and their chances of having mixed kids is 66%.
Foozinator on December 31, 2008 10:10 AM@ThatsOdd "The first child has no influence on the second child's odds."
Your fallacy here is that you're assuming we know the "first" child. We don't know which child is the girl. If we knew that the first child were the girl, then you'd be correct.
Chickencha on December 31, 2008 10:10 AMJust to nail colours to the mast, and assuming you're a robot and the person you've met is, likewise, a robot:
Probability is, as many people have pointed out, about what you know at a given time.
So if you're told that one of the children is a girl, and you're sure that person isn't lying, then the probability of one of the children being a girl is 100%, and as you aren't being asked about that child, you can remove them entirely from the equation. The question then becomes tantamount to "I have a child. Is that child a boy or a girl?". So, well, the answer would be about 46% or whatever it is. That's if you're both robots.
Douglas Greenshields on December 31, 2008 10:10 AMThatsOdd,
You're mistaken for the same reason that all the 50% folks are mistaken. You don't know the order of the flips. If the question is, given that one coin flip came out heads, what are the chances that the next coin will turn tails, then the answer is naturally 50%.
But that's not the question. The question is, given two flips that have already happened, knowing the result that one of those flips was heads implies that the odds that the other flip was tails is 66 2/3%.
mike on December 31, 2008 10:11 AMInformation:
"I have 2 kids" => ~50% chance BG or GB
Additional Information:
"I do not have 2 boys" => ~66% chance of BG or GB and 33%GG
"I do not have 2 boys" == "One of them is a girl" ? yes, I think.
FWIW, I started out in the 50% camp, but the question isn't "If a family has a 1st child that is a girl, what is the probability that the next child will be a boy?"
sympatric greg on December 31, 2008 10:12 AM"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 way this question is phrased is a language question, not a math question. The statement is that one child is a girl, a female under the age of, culture dependent, say 18-21. The other could be a woman, man or boy.
If this were a math question, it would be phrased along the lines of
"A person has two offspring, one is a female. What sex is the other?" Depending on level of the student the question may add "Statistically the chance of a live birth for a female is X%.", otherwise I'd assume the 50% chance for each.
There again, in 4th grade math questions they use conversational English which demands some incredible assumptions (including at times regional dialect).
Alex on December 31, 2008 10:14 AMDouglas,
You're still making the same mistake by assuming that you know which child came first. Stop making that assumption and follow the simple case counting that must lead you to the answer of ~ 66 2/3%
mike on December 31, 2008 10:15 AMI insist that all of you "GB, BG, BeeGee, GeeBee, BurGer, GerBer, etc" people must have taken the same class or read the same book or saw the same NOVA episode or frequent the same probability/puzzles site. You all act like you have seen this puzzle before and you are applying previous experience to this puzzle. I am not saying that is exactly wrong. I am saying that this puzzle must be different than the puzzle you have previously seen. You keep injecting order into a situation that does not require it. WHO CARE'S which came first? There is no difference between the known girl being older or younger than her sibling.
If I said I have two quarters on my desk and one is heads up, would you need to know what dates are on the quarters?
Thus, your GB and BG collapses to just GB. The possibility is either GB or GG. 1:1. 50%.
Here, I wrote a C program to prove it:
int main() {
printf("50%");
return 0;
}
I can't believe that so many people get this wrong. I have heard that we have horrible intuition about probability, but a lot of people just can't seem to understand why the answer is 2/3, even when dozens of people explain it to them. It seems sort of like the way 199 out of 200 people can't program, from Jeff's post "Why Can't Programmers.. Program?".
The only difficulty was that the original program should say "AT LEAST one of them is a girl", otherwise the problem seems to mean that exactly one of them is a girl.
Nate on December 31, 2008 10:17 AM50%,
GB and BG cannot collapse. There were two separate events. Once you understand this, you'll see that the arguments above that lead to 66% are the only correct way to reason about this question.
mike on December 31, 2008 10:18 AM@Jon Schneider:
You were sloppy in your statements, and that broke your calculations.
> P(A|B) is the probability of there being 1 boy in a two-child > family, given that we know there's at least 1 girl
You imply a "in the same family" in the end, same for P(B|A).
But nowhere in your calculations does the requirement come in that the "given family" for probability A is the same as the one for probability B ("a given" vs. "the given").
One way to get the probability of certain facts is to build a tree of independent events of which we know the probabilities down to a fact we witnessed.
Doing it like others have done, we start with the event first child boy/girl, second child boy/girl.
That gives us e.g.
BB 25%
BG 25%
GB 25%
GG 25%
But that is not something that we witnessed, so we can not start striking things out yet!
There was another thing that happened, e.g. if we happened to talk about/otherwise notice the gender of the first- or secondborn child.
That situation would lead e.g. to the equal probabilities of
BB1 -> B
BB2 -> B
BG1 -> B
BG2 -> G
GB1 -> G
GB2 -> B
GG1 -> G
GG2 -> G
Of the cases that do not contradict the witnessed event those that include a boy in the family have the same probability as those they don't, so the probability is 50 %.
But now think about a different scenario, suppose you have asked directly "do you have a girl" and you witnessed a yes - now there suddenly isn't an additional unknown event involved
BB -> N
BG -> Y
GB -> Y
GG -> Y
Now only two cases contradict the event you witnessed, twice as many involve a boy (and again all cases have the same probability).
Oh shock, now we have two results. What if we only want one?
Well, we'd have to list all possible ways how we could have found out that there is one girl and assign them probabilities and do an impossibly complicated version of these calculations.
Or you arbitrarily assign one of these a probability of one and the other of 0 and ignore all others and you get the two most common results.
"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?"
Wording here is everything. And depending on your exact interpretation, there are a couple of ways to answer this question:
1. (Human nature/language response)
If someone *volunteers* the information that "one of my kids is a girl", then in all likelyhood, they are doing so because the *other one is a boy*. Otherwise, why wouldn't they just say "both my kids are girls"?? People don't talk like that.
2. (Puzzle/Logic response)
If, however, you are talking to a mathematician, or if YOU have asked them a series of questions:
"How many kids do you have?" "two"
"Is at least one of them a girl?" "yes"
then the chance is 2/3. With two kids, there are four combinations:
B/B
B/G
G/B
G/G
The first is excluded (because at least one is a girl), and so the chance the other is a boy is 2/3.
Of course, if they tell you "my oldest child is a girl", then that changes the question entirely (see my combination grid), and the chance reverts back to 1/2.
BradC on December 31, 2008 10:19 AM@Nate:
"...but a lot of people just can't seem to understand why the answer is 2/3, even when dozens of people explain it to them."
It is perspective. I see dozens of posts explaining why it is 1/2.
50% on December 31, 2008 10:20 AMThis whole discussion reminds me of the relationship between my coworker and I (I tend to think that I'm right all the time, and he thinks he's right all the time). When we disagree on something, it is usually the case that we are both right, but from a different perspective. This is the case here. Both the 50% and 66% groups are right, depending on the interperatations. There are two explicit interperatations to the question:
1) From the set of all families with two children, a child is selected at random and is found to be a girl. What is the probability that the other child of the family is a boy? (answer: 50%)
2) From the set of all families with two children, a family is selected at random and is found to have a girl. What is the probability that the other child of the family is a boy? (answer: 66%)
I didn't come up with this, I found it here: (<a href="http://mathforum.org/library/drmath/view/52186.html">http://mathforum.org/library/drmath/view/52186.html</a>). But it is nice to know that I was right along.
fre0n on December 31, 2008 10:22 AMTHIS IS A RECORD BREAKER.
The Post with the Most Number of Comments!
@50%
> If I said I have two quarters on my desk and one
> is heads up, would you need to know what dates are
> on the quarters?
Not the dates necessarily, but "one of the quarters on my desk is heads" contains less information than "the quarter on the right is heads". The first one means that the probability of a tails is 66%, the latter that the probability of a tails is 50%.
The birth order is just a way to distinguish them. A younger brother / older sister is a different state of the universe compared to an older brother / younger sister. They could just be "first" or "second", just that birth order is a convenient place to pin the knowledge of which one is which.
Therac-25 on December 31, 2008 10:23 AMI don't understand why people are eliminating the BB combination before considering the odds...the fact that we know that half of the combination is a girl doesn't change the original odds of the different combinations happening.
So, assuming a 50/50 chance that each child born was either a boy or a girl the possible combinations are:
GB
GG
BB
BG
2 of the four are the desired comination, so the odds of that combination happening were 50%.
Paloma on December 31, 2008 10:25 AMIt actually doesn't matter which order anything happens - what matters is that it ALREADY happened. Therefore you must consider all possible two-child families, not simply the unknown child. This means there are four possibilities, not two, and you can only eliminate one of those possibilities. Therefore there are two possible mixed-gender families left, out of the three possibilities remaining. Answer is 2/3 - it is surprising, yes, but refusing to believe things that are surprising simply shows a lack of intelligence - stop it, I am losing faith in the programming community. Accept the answer, regardless of how surprising it is. It has been proven to be true! Not believing mathematical proofs is just wrong.
Jasmine on December 31, 2008 10:25 AMfre0n,
You are absolutely right. Of course, the puzzle can only correctly be in interpreted as question #2, because the only information we have available is that the family has two children, and one of them is a girl. I.e., there's no indication in the problem statement that the child we were told about was randomly selection.
mike on December 31, 2008 10:27 AM@prasanna
> Now lets say they already have two kids. They show you one of them
> and it is a girl. The probability of her begin the older one is
> 50%. The probability of the younger one being a boy is still 50%.
> The probability of the daughter you know being the younger one is
> 50%. Even in that case, the probability of the older one being a
> boy is still 50%. Probability of boy = 0.5x0.5 + 0.5x0.5 = 0.5.
And the probability that the other child is a Girl is 25%. So, 2 times out of 3 you have a girl-boy combination in some order, so the answer is 66%.
> For those comparing this to a coin toss - consider this. Lets say I
> tossed two separate coins and covered the results with two sheets
> of paper. I reveal one of the results to you and its a tail. what
> is the probability that there is a head under the other sheet of
> paper?
Try it for real. The answer is still 2/3. If you reveal one coin, then 25% of the time it will be the T from HT, 25% of the time it will be the T from TH, and 25% of the time it will be one of the Ts from TT.
> The problem here is that you are considering B-G and G-B to be two
> separate results but G-G as one result. Either you say there are
> three total possibilities [order doesn't matter] - (B,G), (G,G),
> (B,B) in which case, you eliminate (B,B) and you are left with 1/2
> possbility of (B,G).
No, because (B,G) happens 50% of the time while (G,G) and (B,B) are 25% each. So out of (B,G) and (G,G), (B,G) occurs 2 out of 3 times.
> Or you say given G* [order matters], you have
> B-G*, G*-B, G-G*, and G*-G in which case the probability of boy is
> still 1/2.
No, because B-G* happens 25% of the time and G*-B happens 25% of the time, but G*-G happens only 12.5% of the time and G-G* happens only 12.5% of the time. So, B-G* and G*-B occurs twice as often as G-G* and G*-G.
Kevin on December 31, 2008 10:27 AMI have written a program that calculates this. Compile it with any C compiler, and run it. It prints 66%.
#include <stdio.h>
#include <stdlib.h>
#define BOY 1
#define GIRL 0
typedef struct {
int child1;
int child2;
} family;
family makeFamily() {
family f;
do {
f.child1 = rand()%2;
f.child2 = rand()%2;
} while (f.child1 == BOY && f.child2 == BOY);
return f;
}
int isOneABoy(family f) {
return f.child1 == BOY || f.child2 == BOY;
}
int main() {
srand(1505423);
int numFamiliesWithBoy = 0;
int i;
for (i = 0; i < 100000; i++) {
if (isOneABoy(makeFamily())) {
numFamiliesWithBoy++;
}
}
printf("%i%% of the families have one boy.\n", numFamiliesWithBoy / 1000);
}
So many comments! Make it stop!
configurator on December 31, 2008 10:28 AMPaloma,
The reason BB is eliminated is because we are given that one of the children is a G. That contradicts the BB case outright.
mike on December 31, 2008 10:28 AMPaloma,
The reason BB is eliminated is because we are given that one of the children is a G. That contradicts the BB case outright.
mike on December 31, 2008 10:28 AM@mike:
lol, I immediately interpreted the question to be #1. Which is why I got 50% originally.
Either interpretation is equally valid. We're all right here.
fre0n on December 31, 2008 10:29 AM@mike:
But we are not talking about events. Why concern ourselves with how something came to be? All we are concerned with is its current state. Is it currently a boy or a girl?
50% on December 31, 2008 10:30 AMIt's undoubtedly 2/3. Here's a way of reframing the question that makes it a lot clearer:
Two children were born. One of them was a girl. What is the probability that both were girls?
Clearly, there are three possibilities, and both being girls is 1/3 of the possibilities (girl / girl, boy / girl, boy / boy). Subtract that value from 100%, and you get 2/3. That's an old college statistics trick...figure out the probability of the opposite and subtract it from 100%.
What I think a lot of people are getting hung up on is "the order doesn't matter". Of course it doesn't matter...but without knowing the order, there's another "turn" played in the coin flips of gender, which takes the probability from 50% to 66%.
Chris Behrens on December 31, 2008 10:31 AM@Paloma
> I don't understand why people are eliminating the BB combination
> before considering the odds
Because the problem statement says that one of the two children is a girl, thus BB is now impossible.
Kevin on December 31, 2008 10:31 AM@fre0n,
I suppose we must just disagree that both interpretations are equally valid. I don't see how the problem can be correctly interpreted as #1. There's nothing in the question as posed to indicate that.
mike on December 31, 2008 10:32 AMJeff, are you trying to do math again?
The correct answer is 50%, and for all you 66%ers out there, here's why.
Yes, there is a 25% chance of each of the four combinations. But you've forgotten another probability. What is the probability that the parent would announce the gender of their girl? Let's break it down:
Children "One is a boy" "One is a girl"
BB 100% 0%
BG 50% 50%
GB 50% 50%
GG 0% 100%
Now do your math. BG = 25% * 50%. GB = 25% * 50%. GG = 25% * 100%.
So the probability that there is one boy and one girl AND the parent said "One is a girl" is BG + GB, which is 25% * 50% + 25% * 50% = 25%. The probability that both are girls AND the parent said "One is a girl" is GG = 25%. These two situations only account for 50%: the other 50% are the "One is a boy" cases.
So, given that they said "One is a girl", either case is just as likely.
Michael L Perry on December 31, 2008 10:33 AMI'm going with the interpretation that "one is a girl" and thus, the other must be a boy.
Eric on December 31, 2008 10:35 AM@50%:
> All we are concerned with is its current state.
> Is it currently a boy or a girl?
Is WHAT currently a boy or a girl? We don't know which child we're asking about yet. Without knowing which child is the girl, we don't know which child can be the boy.
The four probabilities are :
Girl has older sister: 16.67%
Girl has younger sister: 16.67%
Girl has younger brother: 33.33%
Girl has older brother: 33.33%
50% take one coin and set it heads up (girl) now flip another coin. Half the time it will be heads (girl) and half the time it will be tails (boy). We're dealing with one constant and one variable, not two variables with specific cases being eliminated.
yd39 on December 31, 2008 10:35 AM@50%,
Events, births, selections whatever. The point is that there are two children. One (we don't know which) is a girl. What are the chances that the other is a boy? If you want to come to the correct answer, you must consider all the cases, that one is a boy and the other is a girl; that one is a girl and the other is a boy; and that both are girls. There are two children here, and you don't know (as far as is stated in the question) which one is known to be the girl.
mike on December 31, 2008 10:35 AM"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?"
This should have been reworded to avoid all of the "normal people wouldn't respond that way answers"
If it was...
You met someone who told you they had two children. You asked, "Is at least one a girl?" and they said yes. What are the odds that they have a boy and a girl?.
Answer 2/3 - Chickencha on December 31, 2008 07:17 AM - gives a good reason for changing their mind.
The other interesting thing that several people pointed out is that if the question were instead...
You met someone who told you they had two children. You asked, "Is the older one a girl?" and they said yes. What are the odds that they have a boy and a girl?.
Answer 50%
Michael L Perry,
We know that the parent said that one is a girl, so we don't need to be concerned with the probability of that happening.
mike on December 31, 2008 10:39 AMmike,
It all depends on what you determine "the odds" to be. The question doesn't explain at all how to calculate the odds.
Original question:
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?
Explicit interpretations:
1) From the set of all families with two children, a child is selected at random and is found to be a girl. What is the probability that the other child of the family is a boy? (answer: 50%)
2) From the set of all families with two children, a family is selected at random and is found to have a girl. What is the probability that the other child of the family is a boy? (answer: 66%)
I guess it depends on what you focus on: the girl or the family. When I originally read the question, I thought to myself, "So there's a two-child family with a girl. That means a 50-50 chance for the other child. After all, the fact that a family has a girl makes no difference what the other child is."
Damn, this is getting complicated. Now I'm arguing that either interpretation is right, while mike's arguing that only interpretation #2 makes sense. :P
@Therac:
"Not the dates necessarily, but "one of the quarters on my desk is heads" contains less information than "the quarter on the right is heads". The first one means that the probability of a tails is 66%, the latter that the probability of a tails is 50%."
Did you just say that the location of the quarter on my desk raises/reduces the probability that it is tails?
@Jasmine:
"Answer is 2/3 - it is surprising, yes, but refusing to believe things that are surprising simply shows a lack of intelligence - stop it, I am losing faith in the programming community. Accept the answer, regardless of how surprising it is. It has been proven to be true! Not believing mathematical proofs is just wrong."
You must have missed the part where people are questioning the INPUT of your "mathematical proof". BTW, pi is exactly 3!!!
fre0n,
You're right, people misinterpret puzzles all the time.
Indeed, your explanation belies your own misunderstanding. There is a critical distinction between the two explicit interpretations, and I don't think you're getting it...
mike on December 31, 2008 10:42 AMI will agree that coming to an agreement on the framework of the problem is part of the argument here, but I think the OP stated it pretty clearly.
It is like the "airplane on a giant treadmill" problem - people will argue that one till the cows come home (which is usually around 6:30 or whenever the sun goes down) - but they endlessly argue about the framing of the problem, whether the wheels have any friction, whether the treadmill can approach the speed of light, etc...
What is funny is that even when you make it clear that we are talking about the case of four possible combinations with one eliminated, people will still bother to argue about it. If I had drinking buddies, this would be a good one for tonight :)
Jasmine on December 31, 2008 10:45 AMThe aeroplane most definitely would take off. Lift comes from wind's speed relative to the wing, not the wing's speed relative to the ground, so the jet engines would be sucking enough air in to provide lift and pull the plane off the ground.
Andrew on December 31, 2008 10:45 AM@Therac:
"The four probabilities are :
Girl has older sister: 16.67%
Girl has younger sister: 16.67%
Girl has younger brother: 33.33%
Girl has older brother: 33.33%"
You forgot these probabilities:
Girl has red hair: 16.67%
Girl has blond hair: 16.67%
Girl has brown hair and a glass eye: 66%
I still contend that the birth order of the children is arbitrary and is an attribute inappropriately injected into the equation.
Explain why yd39's example is incorrect. Quoted here:
"50% take one coin and set it heads up (girl) now flip another coin. Half the time it will be heads (girl) and half the time it will be tails (boy). We're dealing with one constant and one variable, not two variables with specific cases being eliminated."
I believe that 99% of the responders have reading comprehension issues.
ToeKnee on December 31, 2008 10:48 AMIt would be interseting to look into genealogy statistical models, too. What is the probability of people getting a second boy if they already have a boy? Or girl? Or boy-boy? What if their ancestors already have a high percentage of boys in their family?
A few days ago, I read an article saying that some families mainly 'produce' boys, and some mainly produce girls. It's in the genes! Not only math here is needed for the correct answer, but also a whole lot of statistical genealogy data & correct statistical analysis.
Ruudjah on December 31, 2008 10:48 AMThis site is called codinghorror. I can see why. There is a huge discussion going on about probability. Everyone has leapt into "solving the problem". I'll go with 100%.
If any of you feel the need to debate, then you debate "how was the statement phrased". A lot of you are going on about a child being revealed to you. That wasn't the original problem, the original problem is that you are told one is a girl. How was it phrased?
"My eldest is a girl", "My Youngest is a girl", "I've got only one girl", "I was blessed with a girl". These all imply the other is a boy.
"I just dropped my girl off at day care" is a trickier statement. It tells us one was a girl, with no hint as to the other. Similarly "I dropped Elsie and Henry at school" has implications. Henry is one of "those" names. Henry as in Ford, or Henrietta?
So the purpose I see behind this post is not how good are we at probability, but how do we start our next project? Do we code the requirements the systems analyst gave us, or do we spend 10 minutes informally chatting to the client about him wanting a bluish screen which will give him a "sales report". Or do we do the job properly and get the exact requirements in as close to unambiguous language as possible with a carefully placed mechanism for change in project scope.
AlexOD on December 31, 2008 10:49 AM@50%:
> Did you just say that the location of the quarter
> on my desk raises/reduces the probability that it
> is tails?
Yes.
The probability does not exist within the coins, it exists within my mind. We're talking about the predictions that I can make, based on the information I have from you.
Probability is a measurement of information that an agent has about the world. It's not something that has any kind of objective existence within the world.
If you flip two coins, and tell me that "one of them is a heads", I will predict that you have a tails up as well, I will be right ~66% of the time.
If you flip two coins, and tell me that a specific one of them -- however you want to distinguish it, coin type, date, location it landed on your desk, whatever -- is heads, then it won't matter what I predict for the other one, as I will have a 50% chance of getting it right.
Do you want to run some trials? zenfnord@hotmail.com on MSN. I've got an hour before I have to leave the office.
Therac-25 on December 31, 2008 10:50 AMWe could look a it this way : if we have a group of 100 families, and these families have one child, on average there will be 50 families with a girl and 50 with a boy. Now if these 100 families have another child, each family has a 50% chance to have a girl and a 50% chance to have boy. So on average we will have 25 of the families with GG, 25 with GB, 25 with BG, 25 with BB. This is why it is important to do not merge BG and GB.
Now, let's ask the question to one of these families. If the family tells you they have a girl, you have to consider the 75 families where there is a girl from the 100 we started with. In these families 50 are BG or GB, and 25 BB. So knowing that one of the child is a girl tells you that the probability for the other child to be a boy is 2/3.
This is a really cool experiment. The more people comment with more information, the further people entrench in their own camp.
Quick question - - has anyone actually changed their mind after reading more than, say, 2 pages of comments? Everyone here wants to provide an elegant solution with little redundancy. So maybe, not commenting would be the best way to make a point (aka coding by not coding)...
Anyway, I'm in England (hours ahead of the yanks) so it's time drink til we can't feel feelings anymore.
Tob
Tobermory on December 31, 2008 10:52 AMmike,
What we know and don't know has no bearing on the probability of a situation arising. Once we know all of the probabilities of all of the situations, we can select from among them the ones which match our knowledge. Selecting too early leads to errors.
Michael L Perry on December 31, 2008 10:54 AMOf course in my post it should have read "and 25 GG. So knowing..."... sorry...
duarnad on December 31, 2008 10:54 AMOf course in my post it should have read "and 25 GG. So knowing..."... sorry...
duarnad on December 31, 2008 10:56 AMmike,
I understand the difference between the two interpretations and I can see how a person could initially jump to one or the other. Both interpretations are valid, so both answers (50% and 66%) are right.
fre0n on December 31, 2008 10:56 AMTobermory,
I guess you could say that I've changed my mind. I now say that both camps are right, depending on the interpretation of the question.
fre0n on December 31, 2008 10:58 AM@fre0n
> I guess you could say that I've changed my mind.
> I now say that both camps are right, depending
> on the interpretation of the question.
Jeff's intent is blatantly obvious, given that he linked to a previous post on Bayes. This is intended to be a Bayes 101 post, so the only reasonable way to interpret his problem is "What is the probability of a parent of two children having a boy, given that they have a girl?"
It's 66% if you're referring to proper probability theory. It's staggering that so many here have gotten it wrong!
But the pragmatist in me votes with the 100% crowd. If you met someone who says he has two children, one a girl, he implies that the other is a boy, or else he'd say "both girls". Humans are weird and illogical when you talk to them.
And I think that's a good thing. Look at all the people arguing 50% till they're blue in the face!
Barak Michener on December 31, 2008 11:01 AM@Therac:
I appreciate the offer, but I'll have to pass. Calling it a day now. Going to go make sure 2008 actually walks out the door on time. There is a 66% chance of that happening. :)
50% on December 31, 2008 11:02 AM@50%
> Explain why yd39's example is incorrect. Quoted here:
"50% take one coin and set it heads up (girl) now flip another coin. Half the time it will be heads (girl) and half the time it will be tails (boy). We're dealing with one constant and one variable, not two variables with specific cases being eliminated."
Because yd39's example is equivalent to this:
A couple has their first child; it is a girl. What is the probability that their second child is a girl (boy). Answer 50%.
However, the original question was more like this:
50% take two coins. Flip the first coin. Now flip the second coin. Do this many times. Count all the pairs where at least one flip is H. What is the proportion of HT in any order (HT or TH) to the total number of flips that are Hx (HH, HT, or TH).
Kevin on December 31, 2008 11:02 AM@Therac et al
I agree with the probability theory answer of 66%. But my intuition tells me that the answer to this question has to be 50% and so I am damned until I reconcile the difference (thanks Jeff, you have ruined my NYE).
I agree that if I met 100 complete strangers with two kids which included a daughter I would be right 66% of the time if I guess their other kid was a boy. But going back to my coin-toss-covered-with-paper experiment, I would only be right 50% of the time if I guess the covered toss was a head. So what's the difference?
[I'm going to go and think about this until my wife beats some sense into my head and gets me back to reality]
Prasanna on December 31, 2008 11:03 AMyd39,
"50% take one coin and set it heads up (girl) now flip another coin. Half the time it will be heads (girl) and half the time it will be tails (boy). We're dealing with one constant and one variable, not two variables with specific cases being eliminated."
If you assume a 50/50 chance of having a boy or girl, you need to weight your outcomes on how likely they are. All possible outcomes for 2 children are BG,BB,GG,GB. Each has a 25% likelyhood. But this particular person said that they are not in the {BB} category. That leaves 3 possible cases that are equally likely, 2 of which have one boy and one girl, therefore 2/3 chance.
Your example assumes that in a random population, BB doesn't occur {since you are setting one coin to tails}. Or you are setting the older one to girl {which will give you 50/50}. Try the experiment mentioned earlier.
Flip two coins at the same time, but only look at one of the results. If the coin is tails, count the number of times the other coin is head vs the number of times the other coin is tails. If the first revealed one is heads, disregard the result {since the person revealed that they have a boy not a girl}.
Mike on December 31, 2008 11:06 AM@Prasanna
The difference is that you're able to distinguish the coins in the second experiment. One coin is covered, and one coin is not. That's the equivalent of only meeting older daughters.
To replicate this with coin tosses, you would have an agent -- either a person, or if you want to simulate it in software, then the computer -- tell you that "one of the coins is heads" without telling you which one.
The point is that there's an agent there filtering out the information of which one is which, so you have less information to work with, and so your probability estimates will change.
Therac-25 on December 31, 2008 11:07 AM@50%:
>You keep injecting order into a situation that does not require it. WHO CARE'S which came first? There is no difference between the known girl being older or younger than her sibling.
>If I said I have two quarters on my desk and one is heads up, would you need to know what dates are on the quarters?
Lets deal with your two quarters example: Assuming that the quarters are arranged adjacent to each other (one is Left, one is Right) there are two sets of two possiblities here:
Left can be Heads (Lh) = 50%
Left can be Tails (Lt) = 50%
Right can be Heads (Rh) = 50%
Right can be Tails (Rt) = 50%
So we now have four (2*2) combinations:
Lh-Rh (which is equivalent to Rh-Lh, but I'm always going to put L first)
Lh-Rt
Lt-Rh
Lt-Rt
Each one has 25% chance of being true (50% * 50%).
Now, if I tell you that the Left coin is Heads, then clearly the chance of Right being heads is entirely independent. We are left with only Lh-Rh + Lh-Rt as our two options, with a 50% chance of either being right. If we guess, we're guessing from the However YOU KNOW WHERE THE HEAD IS.
If I only tell you that at least one of the two is heads, without telling you which one it is, the odds change. We're now left with three possibilities, not two.
Lh-Rh (valid - at least one heads)
Lh-Rt (valid - at least one heads)
Lt-Rh (valid - at least one heads)
Lt-Rt (invalid - no heads)
We thus have three options and a 33% chance of being right if we guess. Since two of those three options involve having a heads and a tails showing (Lh-Rt and Lt-Rh), we have a 66% chance of having one of each.
Bobson on December 31, 2008 11:07 AM@Therac-25:
> To replicate this with coin tosses,
> you would have an agent -- either a
> person, or if you want to simulate
> it in software, then the computer --
> tell you that "one of the coins is
> heads" without telling you which one.
To be more specific to myself, they would tell you that "at least one of the coins is heads", or "one or both of the coins is heads", or such.
Therac-25 on December 31, 2008 11:10 AMOpps, forgot to count the times when the person reveals the wrong child. If the first coin revealed is a boy/head, you have to count it if the 2nd coin is a tails/girl.
Mike on December 31, 2008 11:10 AM@Therac-25
1. I flip two coins, and tell you "one of them is heads".
2. You tell me the other one is tails (which you say will be right 66% of the time).
3. I then tell you it's the right one that's heads.
When does the probability of your guess change, before or after I tell you? ;)
Chase Seibert on December 31, 2008 11:12 AMfre0n,
I appreciate that you've covered the two interpretations at work here. It helps to demonstrate where the two answers are coming from. But once you understand the distinction, I don't see how you can say that the 50% argument is equivalent to the 66% argument. The intent of the question really is quite clear.
When you said, "So there's a two-child family with a girl. That means a 50-50 chance for the other child. After all, the fact that a family has a girl makes no difference what the other child is" that belied the misunderstanding, which leads me to think that you haven't quite grasped why the 66% interpretation is the only one that matches the question as posed.
Put another way, can you describe to me what parts of the original question lead one to the 50% interpretation? I see no information in the statement to indicated which child is being referred to or that the child being referred to is being selected at random. Without anything like that being present, the only correct way to read the question will lead to the 66% interpretation.
What's more, when you follow the 50% arguments, you see a lack of understanding about the cases here. Primarily, they argue that order doesn't matter, even in the face of evidence and hard numbers that it does. They're not saying, "look, I'm working from the assumption that I know that the child that was revealed to be a girl was selected at random."
The 66% crowd has explained this every which way, from simple math, to population studies, to source code to a C program that demonstrates this. What's sad is that there are some folks out there that just don't see what's going on here.
mike on December 31, 2008 11:13 AMThis problem is actually simple.
It is already told that the couple has 1 girl. so there is a 50% chance for a boy and 50% chance for a girl for their second child. Therefore the probability for a girl AND a boy is 50%
Steve on December 31, 2008 11:13 AM@fre0n
Your two interpretations are the same, ie 2/3
Tim Hollingsworth on December 31, 2008 11:14 AMINSUFFICIENT INFORMATION
Due to language ambiguity, this cannot be answered definitively.
1) It says, "you met someone who told you they had two children." This does not say they have EXACTLY 2 children. They could have just had twins or have children from a prior marriage they neglect to mention.
2) Even if we assume they have exactly two children, "one of them is a girl," is highly biased towards implying the other is a boy according to conventions of normal english usage. Also, the lack of context provided does not preclude that the asker did not somehow identify one of his specific children as being "a girl" (e.g. 'my youngest is a girl') or that he/she spoke in an unusual way to mean "one or more of my children is a girl".
Autocatalytic on December 31, 2008 11:14 AMINSUFFICIENT INFORMATION
Due to language ambiguity, this cannot be answered definitively.
1) It says, "you met someone who told you they had two children." This does not say they have EXACTLY 2 children. They could have just had twins or have children from a prior marriage they neglect to mention.
2) Even if we assume they have exactly two children, "one of them is a girl," is highly biased towards implying the other is a boy according to conventions of normal english usage. Also, the lack of context provided does not preclude that the asker did not somehow identify one of his specific children as being "a girl" (e.g. 'my youngest is a girl') or that he/she spoke in an unusual way to mean "one or more of my children is a girl".
Autocatalytic on December 31, 2008 11:15 AMINSUFFICIENT INFORMATION
Due to language ambiguity, this cannot be answered definitively.
1) It says, "you met someone who told you they had two children." This does not say they have EXACTLY 2 children. They could have just had twins or have children from a prior marriage they neglect to mention.
2) Even if we assume they have exactly two children, "one of them is a girl," is highly biased towards implying the other is a boy according to conventions of normal english usage. Also, the lack of context provided does not preclude that the asker did not somehow identify one of his specific children as being "a girl" (e.g. 'my youngest is a girl') or that he/she spoke in an unusual way to mean "one or more of my children is a girl".
Autocatalytic on December 31, 2008 11:15 AMINSUFFICIENT INFORMATION
Due to language ambiguity, this cannot be answered definitively.
1) It says, "you met someone who told you they had two children." This does not say they have EXACTLY 2 children. They could have just had twins or have children from a prior marriage they neglect to mention.
2) Even if we assume they have exactly two children, "one of them is a girl," is highly biased towards implying the other is a boy according to conventions of normal english usage. Also, the lack of context provided does not preclude that the asker did not somehow identify one of his specific children as being "a girl" (e.g. 'my youngest is a girl') or that he/she spoke in an unusual way to mean "one or more of my children is a girl".
Autocatalytic on December 31, 2008 11:17 AM@fre0n
Your two interpretations are the same, ie 2/3
Tim Hollingsworth on December 31, 2008 11:17 AM@fre0n
Your two interpretations are the same, ie 2/3
Tim Hollingsworth on December 31, 2008 11:17 AM50%
You already know that Boy/Boy is not an option so it doesn't enter into the realm of possibilities now.
Girl/Boy and Boy/Girl are the same thing.
That leaves Girl/Girl and Girl/Boy.
Say you're in a room with someone who tells you that both of their children will be joining you shortly. At that moment a young girl walks into the room and says 'hi mom.' What are the odds the next person entering the room will be a boy?
My old Discrete Math professor ran a seminar last semester about people's misconceptions in calculating seemingly obvious probability. I sent her this post in hopes that she'll enjoy it. :)
Charles Callebs on December 31, 2008 11:20 AMGreg,
66%, and believe me, if you tell the little girl that it doesn't matter that she is a girl and her brother is a boy, or that she is a boy and her brother is the girl, you'll be in for a night with a sad little girl.
mike on December 31, 2008 11:21 AMINSUFFICIENT INFORMATION
Due to language ambiguity, this cannot be answered definitively.
1) It says, "you met someone who told you they had two children." This does not say they have EXACTLY 2 children. They could have just had twins or have children from a prior marriage they neglect to mention.
2) Even if we assume they have exactly two children, "one of them is a girl," is highly biased towards implying the other is a boy according to conventions of normal english usage. Also, the lack of context provided does not preclude that the asker did not somehow identify one of his specific children as being "a girl" (e.g. 'my youngest is a girl') or that he/she spoke in an unusual way to mean "one or more of my children is a girl".
Autocatalytic on December 31, 2008 11:22 AMThere is a flaw with the 4-combination approach: order doesn't matter. Therefore BG and GB are the same outcome (there is no statement of ages or birth order). We are left with BG, GG, BB. But one of the children is a girl, so the only two possibilities are BG and GG. One of the two is the boy-girl case, so the probability is 1/2. Mr. Atwood's conspiracy link is there to confuse a otherwise simple problem: what is the chance that a child is a boy? 50%.
jellyturtle on December 31, 2008 11:23 AM> 1. I flip two coins, and tell you "one of them is heads".
> 2. You tell me the other one is tails (which you say will be right 66% of the time).
> 3. I then tell you it's the right one that's heads.
>
> When does the probability of your guess change, before or after I tell you? ;)
I think you're trying to be snarky here, but this is a legitimate question and it makes sense to ask. We have to look at this from the guesser's perspective. (From your perspective, the outcome is determined because presumably you know what both coins show.)
When the guess is made, it has a 66% chance of being correct from the guesser's point of view. But when you tell the guesser that it's the coin on the right, you give the guesser more information and the probability, from the guesser's perspective, changes.
This is a weird, weird thing and it's something I'm still trying to wrap my head around. But I don't doubt that it's true.
Chickencha on December 31, 2008 11:23 AMOMG, just read all these comments. I can't believe there are still so many people in the 50%-camp.
I won't try to explain it because loads of people have already done it quite well, but really, if you still think it's 50%, please try to look at it from a different perspective or something because you are just wrong.
So, yeah, 2/3 :)
And thanks to Jeff for writing such an entertaining one. It took me one hour or so to get it the first time I read this question some years ago.
Isaac Clerencia on December 31, 2008 11:23 AMIsn't this the Monty Haul problem?
There are four possibilities:
boy/boy
boy/girl
girl/girl
girl/boy
If your friend said "I have two children, what are the odds they are a boy and a girl?" The correct answer would be 1/2 (b/g or g/b of the total universe).
But your friend helpfully eliminated the first possibility (b/b) by telling you one of their children is a girl. So the correct answer is 2/3 (b/g or g/b of the total universe less b/b).
OTOH women outnumber men at all ages, I can't guess this ratio offhand without Google.
OTOOH (and assuming your friend's children have the same parents), there is a small probability that a couple's second child will be the same gender as the first, owing to some biochemical behavior of sperm and ova. Again, can't guess this number w/out Google.
So, given these two slight skews I'd guess just slightly worse than 2/3.
OTOOOH the social engineering solution takes a clue from the phrase "[I have] two children, and one of them is a girl." Which implies the other is not. So: 1/1 ?
Paul Souders on December 31, 2008 11:24 AMOMG, just read all these comments. I can't believe there are still so many people in the 50%-camp.
I won't try to explain it because loads of people have already done it quite well, but really, if you still think it's 50%, please try to look at it from a different perspective or something because you are just wrong.
So, yeah, 2/3 :)
And thanks to Jeff for writing such an entertaining one. It took me one hour or so to get it the first time I read this question some years ago.
Isaac Clerencia on December 31, 2008 11:24 AMThe choices are:
2 Boys
2 Girls
a boy and a girl
2 Boys is out.
What's left?
Greg Davis on December 31, 2008 11:25 AMAssuming the only options are boy or girl,
the possible combos are:
1 bb
2 bg
3 gg
4 gb
Strike out #1. They have a girl.
Possible combos are:
1 bg
2 gg
3 gb
So 66% they have one boy and one girl, 33% two girls.
@Chase Seibert
> 1. I flip two coins, and tell you "one of them is heads".
> 2. You tell me the other one is tails (which you say
> will be right 66% of the time).
> 3. I then tell you it's the right one that's heads.
>
> When does the probability of your guess change,
> before or after I tell you? ;)
Umm, after?
Probability is a result of my state of knowledge. If I don't have the knowledge, then I'm not going to change my probability estimates.
You are giving me MORE information by saying the right hand one is heads. So yes, I'm going to use that information to revise my estimates.
Now, this doesn't really wind up mattering in this example, as there's no point in changing my guess if it ends up at 50/50.
If you flip three coins, and say that "one of them is heads", then the probability of there being a tails is 6/7. If I was a betting man, I'd have to take at least 1:1.1667 odds on that to break even, else it would just be throwing money away.
If you then say the first one was heads, then the probability of there being a tails is 3/4. The minimum odds you'd have to offer to get any rational agent to take the bet of there being a tails now moves up to 1:1.3333.
At this point, with that new knowledge, I'd no longer make the first wager, as it's guaranteed to lose over time.
Therac-25 on December 31, 2008 11:26 AM@50% (Coin toss explained)
2 coins were tossed. One is heads. What's the probability that the other is tails?
1) Assume coin on left is heads. Then the other coin has 50% chance of heads and 50% tails.
2) BUT the question didn't say the coin on the left was heads. So let's now assume that the coin on the right is heads, then the coin on the left is 50% chance of heads and 50% tails.
3) Combine 1 and 2 (naive solution): (2 * 50%) / (4 * 50%) = 50%
Step 3 is wrong. The problem is that the heads-heads combination was double-counted. The times in 1) when we got heads-heads and the times in 2) when we got heads-heads were the SAME events, so we should only count them once. So to adjust: (2*50%) / (4*50% - 50%) = 100 / 150 = 2/3
Tim Hollingsworth on December 31, 2008 11:27 AMGreg Davis,
What's left?
a girl and a boy.
I suggest you read through the (long) list of comments for the ones that explain exactly why order really is important here. Then look at the ones that provide empirical evidence, even a functioning C program if you still can't convince yourself that knowing only that one child of the children is a girl implies that there is a 66% chances that the other is a boy. (up to linguistic issues and real birth statistics).
mike on December 31, 2008 11:29 AMI didn't want to read everything, but i didn't find keyword "dead" in these comments.
He "told you they *had* two children". So you must count in a probability that one of the children might be dead...
But "one of them *is* a girl". If she is, then I think she must be alive.
Girl/Girl
Girl/Boy
Girl/none
So I vote for 1/3rd.
Janis Veinbergs on December 31, 2008 11:33 AMI think people need economic incentives here to understand it.
For those 50% people -- that means that you think there's a 50% chance that there isn't a boy. Would you be willing to take that bet at 1:2 (or 2:1, I always forget the right order) odds?
Bet $1 that the sibling is a girl, and get $2 if you're right. Iterate that arbitrarily.
If you're right, you should break even over the long run.
Do you have enough faith in your estimates to do that with real money?
Realistically, 100%, unless they are attempting to seem witty by confusing poor communication skills with being clever, in which case, the appropriate response is physical violence.
But, since this is a riddle of sorts...
50%
The other child is one of two things, a boy or a girl. 50/50.
@Chase Seibert,
Probability depends on knowledge. This should be obvious. If you are told more information, the odds change. If I flip a coin and you say "heads" you have a 50% chance at being right. If I then say "it was tails" the odds that it was heads change to 0. The probability depends on your knowledge at the time
Mike M on December 31, 2008 11:37 AM@Chase Seibert,
Probability depends on knowledge. This should be obvious. If you are told more information, the odds change. If I flip a coin and you say "heads" you have a 50% chance at being right. If I then say "it was tails" the odds that it was heads change to 0. The probability depends on your knowledge at the time
Mike M on December 31, 2008 11:38 AMIf someone said to me, "Hey, I got two kids. One is a girl" I would have to assume the other is a boy, unless that someone is a moron and thinks his other girl would not fall into his perceived "girl" category when counting kids.
Joe Beam on December 31, 2008 11:38 AMmike,
"The intent of the question really is quite clear."
I disagree. I think the question was purposely vague.
"I see no information in the statement ... that the child being referred to is being selected at random."
Conversely, I don't see any information indicating that a family is being selected at random. I think that's where the different interpretations come from. All the statement says is "what are the odds that person has a boy and a girl". There's no mention of random families or random children. You are focusing on randomly selected two-child family that has a girl, where I originally focused on a girl who is part of a two-child family.
Give me a few minutes, and I'll code up both versions for added clarity.
For reference (and so you don't have to keep scrolling up):
Original:
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?
#1
From the set of all families with two children, a child is selected at random and is found to be a girl. What is the probability that the other child of the family is a boy?
#2
From the set of all families with two children, a family is selected at random and is found to have a girl. What is the probability that the other child of the family is a boy?
@Autocatalytic
There is sufficient information. Jeff linked to a previous post on Bayes, and this is a longstanding example to introduce people to Bayes.
This is clearly about Bayes' Theorem, and so the only reasonable interpretation is "What is the probability that a couple with two children has a boy, given that they have a girl?"
Any other interpretations are just trying to look smart by trying to guess that the author meant something other than he obviously did.
Therac-25 on December 31, 2008 11:38 AMPython code that supports the 50% theory. Is this wrong?
import random
# 1 is girl, 0 is boy
families_with_girls = 0
families_with_both = 0
for i in range(1000):
num_girls = random.randint(0,2)
if num_girls > 0:
families_with_girls += 1
if num_girls == 1:
families_with_both += 1
print families_with_both*1.00 / families_with_girls*1.00
Ooops. Ignore the # 1 is girl, 0 is boy comment. That was from a previous version I wrote that supports the 66% theory.
It all comes down to whether order counts. And I don't think it does.
random on December 31, 2008 11:40 AMIt all depends upon the selection of the statement "One is a girl" as opposed to "One is a boy". If the parent selected one of their children at random and announced his or her gender, then it's 50% (as I showed earlier). If instead the parent was asked "Is at least one of your children a girl" and replied "Yes", then the answer is 66%.
I have no evidence that the parent was asked anything, and just accosted us with random and useless information. Therefore, I'm sticking with 50%.
BTW, loving this little diversion as I try to work on NYE.
Michael L Perry on December 31, 2008 11:40 AMTim Hollingsworth,
"Your two interpretations are the same, ie 2/3"
Actually they're not.
(copypasta from <a href="http://mathforum.org/library/drmath/view/52186.html">http://mathforum.org/library/drmath/view/52186.html</a>)
Supposing that we randomly pick a _child_ from a two-child family. We
see that he is a boy, and want to find out whether his sibling is a
brother or a sister. (For example, from all the children of two-child
families, we select a child at random who happens to be a boy.) In
this case, an unambiguous statement of the question could be:
From the set of all families with two children, a child is
selected at random and is found to be a boy. What is the
probability that the other child of the family is a girl?
Note that here we have a pool of kids (all of whom are from two-child
families) and we're pulling one kid out of the pool. This is like the
problem you're talking about. The child selected could have an older
brother, an older sister, a younger brother or a younger sister.
Let's look at the possible combinations of two children. We'll use B
for Boy and G for girl, and for each combination we'll list the older
child first, so GB means older sister while BG means younger sister.
There are 4 possible combinations:
{BB, BG, GB, GG}
From these possible combinations, we can eliminate the GG combination
since we know that one child is a boy. The three remaining possible
combinations are:
{BB, BG, GB}
In these combinations there are four boys, of whom we have chosen one.
Let's identify them from left to right as B1, B2, B3 and B4. So we
have:
{B1B2, B3G, GB4}
Of these four boys, only B3 and B4 have a sister, so our chance of
randomly picking one of these boys is 2 in 4, and the probability is
1/2 - as you have indicated.
@random:
Yes, very.
Your program is omniscient (that is, it has all the relevant information). We are not.
Therac-25 on December 31, 2008 11:41 AMI have two US coins totaling 30 cents and one is not a nickle.
Michael L Perry on December 31, 2008 11:42 AMThis is an unfinished game of coin flips. The bet is that there will be one boy and one girl at the end of two flips. Before the game starts, you'd bet 50˘ to win $1 since there are two scenarios in which the bet wins and two in which it loses. After one flip, you get a girl and end the game. Now the question is: How do you divide the pot?
The next flip is either boy or girl (a 50% chance). One of those wins (a boy) and the other loses. So the odds are still 50% and each player would get their original stake back again.
This is NOT the Monty Hall problem, since there is no third door. You do not gain more information about the second toss by getting the result of the first toss.
Jon Ericson on December 31, 2008 11:42 AMfre0n,
Well, the fact that we have met this person arbitrarily is, for the purposes of solving the problem, indistinguishable from randomly selecting the family.
In a sense, that's not the critical distinction between the two interpretations. The critical bit is that *we don't know which of the two children is the girl*, and since that is the case, #2 is the only correct interpretation.
mike on December 31, 2008 11:42 AM@Michael L Perry
A quarter and a nickel?
Not quite sure what a nickle is. Is that a pickled cartoon character?
Therac-25 on December 31, 2008 11:43 AMJon Ericson,
Where is it indicated that we're waiting on the birth of another child? The girl may have come from either the first or the second "flip". You're assuming that it came from the first, which is why you get to the wrong answer.
mike on December 31, 2008 11:44 AM@Michael L Perry
(To not be a spelling nazi, the answer is a Quarter and a Nickel anyway, since the Quarter is not a Nickel).
Therac-25 on December 31, 2008 11:44 AMTherac-25,
Sorry about my spelling. It was not a trick question, just a joke. The correct answer is "The other is a nickel".
Michael L Perry on December 31, 2008 11:45 AM@Therac-25:
Can you explain the omniscience? What information does it have that we don't?
random on December 31, 2008 11:45 AMWhat a morning. I started with a 50% intuition, I moved to the 2/3 camp, and now I'm just confused. I still see 2/3 for the problem as it was stated (though it is a little ambiguous), but there's a related problem from wikipedia that has me completely flummoxed. See question 3 on http://en.wikipedia.org/wiki/Boy_or_Girl_paradox.
The question is basically, what if the parent told you she had two kids and one was a boy named Jacob? Does that change anything? Intuitively, I would have thought not at all. However, if you take the relative frequency of the name and then construct the likelihood of the relative combinations in the sample population, the more rare the name, the more likely it is that the other child is also a boy, up to a 50% probability.
That's counter-intuitive to me, and furthermore, it doesn't make sense when viewed from the point that all boys have names, so if you repeatedly questioned people about their children's names you'd expect some answer, with a varying degree of rarity. It does make sense to me that if the boy has a rare quality, you'd expect that it is likely the family he comes from had more boys since that increases the liklihood of that quality randomly presenting itself. However, given that all boys have names, I can't intuit how any one particular name would influence your expectation that the other child would tend to be a different gender. For the life of me, I can't figure out how to reconcile my intuition with this result.
Below is a C# console program to demonstrate this with a random sample set. Vary the "pj" variable to change the relative rarity of the chosen boy's name. The closer it is to zero, the closer the probability of the second child being a boy, up to 50%. The closer to one, the closer the result is to the 1/3 boy probability value from the classical problem.
using System;
using System.Collections.Generic;
using System.Text;
namespace BoyGirlTest
{
class Program
{
static void Main(string[] args)
{
const double pj = .01;
const int sampleSize = 10000000;
int jb = 0;
int jj = 0;
int jg = 0;
int bb = 0;
int bg = 0;
int gg = 0;
System.Random r = new Random();
for (int x = 0; x < sampleSize; x++)
{
int boys = 0;
int jacobs = 0;
int girls = 0;
for (int y = 0; y < 2; y++)
{
if (r.NextDouble() > (1-pj))
{
jacobs++;
}
else if (r.NextDouble() > .5)
{
boys++;
}
else
{
girls++;
}
}
if (boys == 2)
{
bb++;
}
else if (boys == 1)
{
if (jacobs == 1)
{
jb++;
}
else
{
bg++;
}
}
else
{
if (jacobs == 2)
{
jj++;
}
else if (jacobs == 1)
{
jg++;
}
else
{
gg++;
}
}
}
Console.WriteLine("BB: {0}%", (double)bb / sampleSize * 100);
Console.WriteLine("BG: {0}%", (double)bg / sampleSize * 100);
Console.WriteLine("GG: {0}%", (double)gg / sampleSize * 100);
Console.WriteLine("JB: {0}%", (double)jb / sampleSize * 100);
Console.WriteLine("JG: {0}%", (double)jg / sampleSize * 100);
Console.WriteLine("JJ: {0}%", (double)jj / sampleSize * 100);
double pbb = (double)bb / sampleSize;
double pbg = (double)bg / sampleSize + pbb;
double pgg = (double)gg / sampleSize + pbg;
double pjb = (double)jb / sampleSize + pgg;
double pjg = (double)jg / sampleSize + pjb;
double pjj = (double)jj / sampleSize + pjg;
int mixed = 0;
int allgirls = 0;
int allboys = 0;
int allJacobs = 0;
int jacobBoy = 0;
int jacobGirl = 0;
for (int x = 0; x < sampleSize; x++)
{
double test = r.NextDouble();
if (test >= pjg)
{
allJacobs++;
}
else if (test >= pjb)
{
jacobGirl++;
}
else if (test >= pgg)
{
jacobBoy++;
}
else if (test >= pbg)
{
allgirls++;
}
else if (test >= pbb)
{
mixed++;
}
else
{
allboys++;
}
}
Console.WriteLine("All Boys: {0}%", (double)(jacobBoy + allJacobs) / (sampleSize - allboys - allgirls - mixed) * 100);
Console.WriteLine("Boy & Girl: {0}%", (double)(jacobGirl) / (sampleSize - allboys - allgirls - mixed) * 100);
}
}
}
mike,
Code for interpretation 1:
using System;
class Program
{
static void Main(string[] args)
{
const int GIRL = 0;
const int BOY = 1;
Random rand = new Random();
int allGirls = 0;
int boyGirl = 0;
for (int i = 0; i < 1000000; i++)
{
// we have found a girl that is a member of a two child family...
int child1 = GIRL;
int child2 = rand.Next(0, 2);
if (child2 == BOY)
{
boyGirl++;
}
else if (child2 == GIRL)
{
allGirls++;
}
}
Console.WriteLine("allGirls: " + allGirls);
Console.WriteLine("boyGirl: " + boyGirl);
Console.ReadKey();
}
}
Code for interpretation 2:
using System;
class Program
{
static void Main(string[] args)
{
const int GIRL = 0;
const int BOY = 1;
Random rand = new Random();
int allGirls = 0;
int boyGirl = 0;
for (int i = 0; i < 1000000; i++)
{
int child1 = rand.Next(0, 2);
int child2 = rand.Next(0, 2);
// if we have found a family with a girl...
if (child1 == GIRL || child2 == GIRL)
{
if (child1 == BOY || child2 == BOY)
{
boyGirl++;
}
else
{
allGirls++;
}
}
}
Console.WriteLine("allGirls: " + allGirls);
Console.WriteLine("boyGirl: " + boyGirl);
Console.ReadKey();
}
}
It depends what question you asked, because the problem is a bit too vague at the moment. Suppose the conversation went like this:
Them: I have two children.
You: Do you have at least one girl?
Them: Yes.
Then the answer is 2/3 BG 1/3 GG, as several people have said.
But here is a much more subtle problem:
Them: I have two children.
* At this moment a girl runs into the room. *
What is the probability now?
While you're thinking about that, consider this one:
Them: I have two children.
* At this moment a girl runs into the room. *
You: Is this your older child?
Them: Yes.
In problem 3, the probability must be 1/2 BG 1/2 GG. But how could the knowledge that it's the older child make any difference?
The answer is that it doesn't. Unintuitively, the probability in problem 2 is also 1/2 BG 1/2 GG. The reason for this surprising result is that it's twice as likely that a girl will run into the room in the GG case than the BG case.
Stephen Turner on December 31, 2008 11:47 AM@random
The problem with your code is that you're giving each of these possibilities an equal chance of occurring:
Two boys
A boy and a girl
Two girls
And that's the same mistake that lots of other people are making. Here's the breakdown of how it should be:
Two boys - 25%
A boy and a girl - 50%
Two girls - 25%
@mike: "The girl may have come from either the first or the second "flip". You're assuming that it came from the first, which is why you get to the wrong answer."
How does that matter? A 'flip' in this instance is the order in which a gender is revealed to you, not when it was ultimately created. Whichever one was revealed to you is the first flip.
nuclearnewyears on December 31, 2008 11:48 AMI am confused by the 66% people.
How is:
- boy and a girl
Distinctly different from:
- girl and a boy
It's an entirely symantec difference with no bearing on the final outcome.
If I have two children, Sally and Bobby, and Bobby is the oldest, I have one boy and one girl.
If I have two children, Sally and Bobby, and Sally is the oldest, I STILL have one boy and one girl.
The order or birth and the order in which you speak/read their gender is orthogonal to the number of boys and girls, yes?
So the possible cases with at least one girl are:
girl + girl
girl + boy
@Therac
People do that with real money all the time... they buy lottery tickets, they play gambling games, etc. I love that show with the boxes with money and Howie Mandel, whatever it's called - but I can't stand to watch it any more because people never quit when they are "probably" ahead, and it's tragic to watch them blow it every time, thinking they have a chance at the big money. Of course, Howie doesn't help - he deliberately mis-states the chances of winning the money.
Jasmine on December 31, 2008 11:50 AMmike,
"Well, the fact that we have met this person arbitrarily is, for the purposes of solving the problem, indistinguishable from randomly selecting the family."
The arbitrarily met person has just told us that one of their children is a girl, so we have our random girl.
"In a sense, that's not the critical distinction between the two interpretations. The critical bit is that *we don't know which of the two children is the girl*, and since that is the case, #2 is the only correct interpretation."
Sure we do, the child in question is the one that the person is thinking about ;) . Anyway, it doesn't matter that we don't know which of the children is the girl, it still works out to 50%.
Here is a reference to a discussion of a book talking about the Unfinished Coin Game:
http://keplers.blogspot.com/2008/10/keith-devlin-and-unfinished-game.html
It's amazing how a simple conditional probability problems always get people worked up - and how many different answers you can get! This is especially funny, coming from software engineering people, who have a scientific background...
Assuming it's equally likely to give birth to a boy or a girl, Jammus got it right first.
@Chickencha:
Thanks, that cleared it up.
Order doesn't really matter (which initially leads to a 50% answer), but it does cause there to be two more cases that produce a girl and boy. It's just which one you pick that is unimportant.
random on December 31, 2008 11:52 AMnuclearnewyears,
"A 'flip' in this instance is the order in which a gender is revealed to you, not when it was ultimately created. Whichever one was revealed to you is the first flip."
But of course it does matter. Two random events occurred. You tell me that the outcome of one of the two was "heads" or "girl" or whatever. You haven't told me which. Order really does matter here because there really are 4 possible outcomes. You know the order, but I don't, so that really does affect the probability for me. If I don't examine all four cases, then I'm going to miss a case and come out with the 50% answer.
mike on December 31, 2008 11:53 AM@random:
Actually, I'm wrong, it's just buggy.
You're selecting by a random number between 0 and 2 which represents the number of girls. This gives you a probability distribution of 33% for no girls, 33% for one girl and 33% for two girls.
This is not correct. The correct distribution is 25% for no girls, 50% for both and 25% for two girls.
If you do that, then your counters should come out being correct -- "at least one girl" will be 75% of the total, and "both" will be 50% of the total, so 50/75 is 0.66.
Therac-25 on December 31, 2008 11:53 AMBased on the following:
* Probability of living in a country with a 1 child policy
* Probability of the first child causing future pregnancy complications
* Probability that having had one kid, either/or parent was so disgusted at all the poop they vowed to never have another sprog
...I think there is a 0.0012% chance of it being a toy.
mr L.
Nick on December 31, 2008 11:55 AMnuclearnewyears,
This is not an unfinished game, because the events have already concluded and the questioner already has that results before the question is posed. It dramatically changes the outcome because the information is not about independent events, it's about the combined result of independent events.
mike on December 31, 2008 11:56 AM@random
Your num_girls calculation is wrong. It should be:
num_girls = random.randint(0,1) + random.randint(0,1)
Then you will get 0.66
Tim Hollingsworth on December 31, 2008 11:56 AM100% probability that questions posed that way will reveal how lousy people are -- even smart people -- at understanding probability, logic, and linguistic ambiguity.
That was fun -- do some more, Jeff!
Do they no longer teach logic in schools? Or simple math?
Do some of you really not understand that BG and GB are the same thing?
I weep for the stupidity of the world.
Grumbledog on December 31, 2008 11:58 AM100% probability that questions posed that way will reveal how lousy people are -- even smart people -- at understanding probability, logic, and linguistic ambiguity.
That was fun -- do some more, Jeff!
THIS IS RIDICULOUS!!!!!!!! I can't believe this is still going on....
Look, take two coins. Flip them both 100 times. Mark down the results. For each time one of them is heads and one is tails make a checkmark. When you are done you will have way more than 50 checkmarks!
Trust me. For those of you still saying that it is 50% you need to run this test. You will quickly see that there are two ways that BG can come out. BG and GB. They both count toward the result.
DO IT! TEST IT! AND THEN MOVE ON!
Matt on December 31, 2008 11:58 AM@Jasmine
> People do that with real money all the time...
> they buy lottery tickets, they play gambling games,
> etc. I love that show with the boxes with money
> and Howie Mandel, whatever it's called - but I
> can't stand to watch it any more because people
> never quit when they are "probably" ahead, and
> it's tragic to watch them blow it every time,
> thinking they have a chance at the big money.
> Of course, Howie doesn't help - he deliberately
> mis-states the chances of winning the money.
Yeah, I'm half way through The Wealth of Nations right now, and Adam Smith certainly tears lotteries a new one in that. People are stupid when it comes to money, and the chance to "win big".
Might as well let him speak:
"That the chance of gain is naturally overvalued, we may learn from the universal success of lotteries. The world neither ever saw, nor ever will see, a perfectly fair lottery; or one in which the whole gain compensated the whole loss; because the undertaker could make nothing by it. In the state lotteries the tickets are really not worth the price which is paid by the original subscribers, and yet commonly sell in the market for twenty, thirty, and sometimes forty per cent advance. The vain hope of gaining some of the great prizes is the sole cause of this demand. The soberest people scarce look upon it as a folly to pay a small sum for the chance of gaining ten or twenty thousand pounds; though they know that even that small sum is perhaps twenty or thirty per cent more than the chance is worth. In a lottery in which no prize exceeded twenty pounds, though in other respects it approached much nearer to a perfectly fair one than the common state lotteries, there would not be the same demand for tickets. In order to have a better chance for some of the great prizes, some people purchase several tickets, and others, small share in a still greater number. There is not, however, a more certain proposition in mathematics than that the more tickets you adventure upon, the more likely you are to be a loser. Adventure upon all the tickets in the lottery, and you lose for certain; and the greater the number of your tickets the nearer you approach to this certainty."
Therac-25 on December 31, 2008 12:00 PMWhat could be accomplished if all these people spent this time doing something productive.
bob on December 31, 2008 12:02 PMOne small linguistic thing that I think would have made this clearer:
Instead of "What are the odds that person has a boy and a girl?" say "What were the odds that person had a boy and a girl?"
I think that makes it clearer, but doesn't really change things (and isn't necessary to figure it out)
random on December 31, 2008 12:02 PM@mike: "the events have already concluded and the questioner already has that results before the question is posed. It dramatically changes the outcome because the information is not about independent events, it's about the combined result of independent events."
I thought that at first too, but they *are* independent events for the observer, you. It doesn't matter in which order the children were born. The questioner can present the order of events in a random way in the question. Right?
nuclearnewyears on December 31, 2008 12:03 PM@Grumbledog
Do you mind if I weep for you, then?
I am a parent with two, and only two, children:
"My son has an older sister."
"My daughter has an older brother."
Excluding any kind of progressive redefinition of gender, you are claiming that I can make these two statements, in the same Everett branch, and not be in contradiction?
That's what "BG is the same as GB" means. It's nonsense, and I can't believe you can't see that.
Therac-25 on December 31, 2008 12:03 PMif(numberOfGirls == 1 && numberOfBoys == 1)...
else if(numberOfBoys == 1 && numberOfGirls == 1)...
you're kidding, right?
Grumbledog,
*sigh*
I hope you don't confuse your own kids' sexes that way.
Two events, two outcomes, one question encompassing information from the outcome of both. One way to solve these sorts of problems is to pick apart all the cases and count them up, hence, BG and GB cannot be counted as the same here.
mike on December 31, 2008 12:03 PM2/3
Here is why:
If the question was, we have a girl, with another child on the way, what is the probably of a another girl? The answer would be 50% assuming no STD's that would hinder that. See Syphilis and Henry VIII.
The problem is that order subtly matters. While not expressed in the question directly, it is implying that two previous events have occured on of which has resulted in a girl. We aren't telling you which.
So if we map the first part of the question"I have two children" out we get:
/ \
B G
/ \ / \
BB BG GB GG
The BB possibility is not possible. Because of the constraint created by the second part " one of them is a girl"
Therefore the tree of all possibilities is
/ \
B G
\ / \
BG GB GG
This can be shown in practice by flipping coins and writing down whenever at least one of the coins is heads.
By doing this over a million times (thank you random number generators and for loops) we can get these results:
At least one girl: 785491
One boy and one girl: 524338 (~ 66%)
Two girls: 261153 (~34%)
2/3 of a chance of a boy, 1/3 of a girl.
--Sam A.
P.S. my random number generator isn't broken
nuclearnewyears,
"I thought that at first too, but they *are* independent events for the observer, you. It doesn't matter in which order the children were born. The questioner can present the order of events in a random way in the question. Right?"
WRONG! Because the information is being presented encompasses the sum of the results of both events. It's true that the ordering is arbitrary, but just because it's arbitrary doesn't mean that it doesn't matter.
Seriously, just do the coin flip test and be amazed!
mike on December 31, 2008 12:07 PMI studied computer science for a while, and this very example was brought up in second year. The answer they gave was 2/3, for the same reason as many above (boy/boy, girl/boy, boy/girl, girl/girl). I however have never accepted it (I can understand the reasoning but think it is a poor example). The two events (having a boy and having a girl) are not related, so assuming we're using simple maths, (that is, for one birth each of the two genders is equally likely) it should be 50%. Logically the above sets would only be relevent in a question involving the order of birth, rather than just two children. For this case, it is exactly the same as a coin toss.
Also, I assume the question meens that at least one of the two is a girl, and not exactly one, as that would make it 100% (disregarding hermaphrodites). Also I assume it doesn't take into account genetic tendancies towards having male or female children.
Alphathon on December 31, 2008 12:07 PMPunchAndPie,
"The order or birth and the order in which you speak/read their gender is orthogonal to the number of boys and girls, yes?
So the possible cases with at least one girl are:
girl + girl
girl + boy"
Yes, the two possible cases are girl + girl and girl + boy, but girl + boy has a more likely outcome.
Possible outcomes for all persons in the world who have two children. Assume that one child has to be born before the other {likely}. Assume that chances a child is a girl is 50%.
girl + girl = 25%
girl + boy = 25%
boy + girl = 25%
boy + boy = 25%
since (girl + boy) and (boy + girl) are the same, combine them
girl + girl = 25%
boy + girl = 50%
boy + boy = 25%
now the question is if you meet a random person within this group of people with two children, one of which is a girl, what are the odds that the other is a boy. You can eliminate one case. And since the boy+girl is twice as likely you get 2/3 of all possible cases.
girl + girl = 25%
boy + girl = 50%
Also, as a converted 67%er, I have to take a little bit of umbrage with statements like:
"Do they no longer teach logic in schools? Or simple math? Do some of you really not understand that BG and GB are the same thing? I weep for the stupidity of the world."
Is that really necessary? Plenty of smart people (and I don't necessarily count myself in that crowd, though I do have a Math minor) get caught out by the same false intuition.
random on December 31, 2008 12:08 PM100% probability that if you make a smart-ass comment like I did a few posts ago, the computer gremlins will reach out and grab your spheroids and yank. When I hit Post, an error message came back, so I hit Back and did it again. So it got posted twice, making me look like a flaming marooney-toon.
Anyways, I need to get some work done, so everybody stop posting! This is too much daggone fun!
Hey, now there are two mikes!
Also, this mike agrees with random. It's the disagreement here frustrating, but lets try not to be disagreeable! After all, aren't we all trying to find the true answer to the question? Just because this medium isn't rich enough for us to convey all our ideas to one another, doesn't mean we should take that frustration out on each other.
Apologies if I've made any hurtful statements above.
mike on December 31, 2008 12:11 PM@Alphathon
> I studied computer science for a while, and this very example was
> brought up in second year. The answer they gave was 2/3, for the
> same reason as many above (boy/boy, girl/boy, boy/girl, girl/girl).
> I however have never accepted it (I can understand the reasoning
> but think it is a poor example).
It's because you're thinking that we're talking about a single event -- what the probability of HAVING a single boy or girl is.
We aren't. We're trying to figure out the results of TWO independent events, with limited knowledge.
Without ANY knowledge, we start at 25/50/25 for the distribution of genders. We are then given SOME knowledge, and can refine our distribution to 33/66. But without more knowledge, we can't get to 50/50, and that knowledge is not given to us in the problem.
Therac-25 on December 31, 2008 12:11 PMis this a paradox? when do we find out who is correct?..:))
gulzar on December 31, 2008 12:13 PMis this a paradox? when do we find out who is correct?..:))
gulzar on December 31, 2008 12:13 PMgulzar,
Jan 1, 12:01AM?
mike on December 31, 2008 12:14 PMgulzar,
Jan 1, 12:01AM?
mike on December 31, 2008 12:15 PMgulzar,
Jan 1, 12:01AM?
mike on December 31, 2008 12:15 PM@gulzar
There is no paradox. The correct answer is 2/3.
This forum is just not the right medium to resolve the disputes.
Tim Hollingsworth on December 31, 2008 12:15 PM(error handling on c-h.com is not so good!)
mike on December 31, 2008 12:16 PMDon't resubmit if you get an error. That just looks like the blog software failing at regenerating the html. It still gets your comment, and will show up.
Therac-25 on December 31, 2008 12:17 PM@Michael L Perry:
>> Jeff, are you trying to do math again?
>>
>> The correct answer is 50%, and for all you 66%ers out there, here's why.
>>
>> Yes, there is a 25% chance of each of the four combinations. But you've forgotten another probability. What is the probability that the parent would announce the gender of their girl? Let's break it down:
The probability that the parent announced the gender of at least one girl is 100%, because it's *already happened*.
@mike, re: fre0n #1: I updated my page at http://klozoff.ms11.net/testing/boygirl.html with additional simulations and an explanation for why your case #1 is flawed
@ everyone saying "BG and GB are the same, order doesn't matter":
you are correct, the order doesn't matter; however, there are two ways to *get* boy+girl. One is to have a boy and then have a girl, the other is to have a girl and then have a boy. This means that boy+girl is twice as likely as either of boy+boy/girl+girl. If you disagree with this, then you are saying that the chances are such:
boy+girl 33%
boy+boy 33%
girl+girl 33%
Feel free to argue to everyone that the chance of having two girls is 33%.
@whoever: a preview button would be really, really nice
@Greg Davis:
> if(numberOfGirls == 1 && numberOfBoys == 1)...
> else if(numberOfBoys == 1 && numberOfGirls == 1)...
There is a very clear difference between those two cases - Where you'd crash with the following definitions:
numberOfGirls=0
numberOfBoys="one"
See? Order does matter :p
By the way, having three brothers and one son, my wife is convinced we are certain to have another son if we resumed the game. The odds of having a mixed family seem to be in our favor given more tries, however: <http://www.in-gender.com/xyu/Odds/Gender_Odds.aspx>. In addition, the ratio of uncles to aunts appears to be the result of chance as well: <http://www.amstat.org/publications/chance/pdfs/144.rodgers.pdf>.
But statistics can't shake the feeling that we are doomed to have nothing but sons. Sigh.
Jon Ericson on December 31, 2008 12:19 PMSome men are predisposed to father either male or female children, so I'd guess that the second child would be likely to be the same as the first. Therefore the chances of the second child being a girl might be 25%.
wetwebwork on December 31, 2008 12:19 PMStephen Oberholtzer,
Nicely done!
mike on December 31, 2008 12:21 PMStephen Oberholtzer,
Nicely done!
mike on December 31, 2008 12:22 PM2/3, plain and simple. Try the Monty Hall problem for something that will really make people think.
Luke L on December 31, 2008 12:23 PM@mike - please stop posting duplicates
mike on December 31, 2008 12:23 PM@mike
you're giving us a bad name
mike on December 31, 2008 12:24 PMYou meet someone on a blog, they say their name is mike. What is the chance the next poster's name is also mike?
mike on December 31, 2008 12:27 PMYou meet someone on a blog, they say their name is mike. What is the chance the next poster's name is also mike?
mike on December 31, 2008 12:28 PMhttp://en.wikipedia.org/wiki/Gambler's_fallacy
So many people fall into this trap! It is 50/50. The "odds" do not change just because you have already had one kid.
When having a child you will have either a boy or a girl. When having your second child, you will still have only a boy or a girl. This does not change because you had a girl last time.
@David@ on December 31, 2008 12:28 PMI don't get why so many people believe BG and GB are different options in this case. THEY'RE THE SAME THING FOR THESE PURPOSES!
I read about 10% of the answers and agree that any parent who says "one is a girl" would probably mean the other is a boy. So, the answer there would be 100%
If the answer is meant to be ambiguous, then the answer is 50%. The only options are BB, GB, and GG and you can eliminate BB immediately.
This is not the Monty Hall problem, you're already being told Door #1 is empty so there's only 2 doors left.
John DiBella on December 31, 2008 12:28 PMOrder is NOT important. Nor is it even mentioned.
Imagine getting two coins. The order you flip the coins in will not affect the results of the other coin. Both coins still have 50:50 odds. It is the same with kids.
Now I will try to solve the problem: "What are the odds of getting BG?"
A child can either be a B or a G. The odds of each are 50%.
There is one girl. The odds of there being (at least) one girl are 100%.
I will capitalize values that are known to be true (ie. G)
bG
gG
There are two choices, the unknown child was either a boy or a girl. One of these is correct. The options are equally likely, the odds are 50% for each. Therefor the odds of there being a girl and a boy are 50%. The odds of there being a girl and a girl are also 50%.
There is only one unknown that has a 50% chance of happening for each option (boy or girl?) one out of these two choices is leads to BG. Therefor there is a 50% chance of having a boy and a girl.
I'm not sure how to make this any clearer.
Arnos on December 31, 2008 12:31 PMOut of curiosity, but those of you who say 66%:
Do you re-roll all your dice when you play Yahtzee?
If not, why do you keep some numbers?
That's a rhetorical question: It's because keeping some dice the same on later rolls changes the odds of you getting what you want.
Likewise, knowing the gender of one child changes the odds of what the gender of both are. If I know one child is a girl, but not the gender of the other child (with no hints), there's a 50/50 chance that the other child is a boy, because only the second child's gender is variable.
Powerlord on December 31, 2008 12:31 PMOrder is NOT important. Nor is it even mentioned.
Imagine getting two coins. The order you flip the coins in will not affect the results of the other coin. Both coins still have 50:50 odds. It is the same with kids.
Now I will try to solve the problem: "What are the odds of getting BG?"
A child can either be a B or a G. The odds of each are 50%.
There is one girl. The odds of there being (at least) one girl are 100%.
I will capitalize values that are known to be true (ie. G)
bG
gG
There are two choices, the unknown child was either a boy or a girl. One of these is correct. The options are equally likely, the odds are 50% for each. Therefor the odds of there being a girl and a boy are 50%. The odds of there being a girl and a girl are also 50%.
There is only one unknown that has a 50% chance of happening for each option (boy or girl?) one out of these two choices is leads to BG. Therefor there is a 50% chance of having a boy and a girl.
Arnos on December 31, 2008 12:32 PMWhat's the probability that the comments here, now numbering 600+, will reach 1000?
This question shows why statistics is a completely flawed science.
Practicality on December 31, 2008 12:32 PMI'm horrible for trying real-world statistics. I just attempted 100 paired coin-flips (200 total, each two sequential paired together). I used Tails for Girls, Heads for Boys. I got:
67 G-G pairs,
29 B-G pairs,
4 B-B pairs.
There's a reason I always call tails; I just can't flip a quarter to Heads.
Kavar on December 31, 2008 12:33 PM@John DiBella:
I thought the same thing! But, see my python script, and responses to it, to see why the order doesn't -matter-, but it does influence the results.
If a person has one girl, and they ask you "What's the chance that our next child is a boy?" the answer will be 50%.
But, both children have already been born. And it doesn't matter if the younger or older child is a girl (thereforce, order doesn't matter), but it -does- mean there are 2 different ways to get a mixed set of children (boy then girl, or girl then boy).
If the problem stated that the parent told you "My younger child is a girl", then once again the chances are 50%.
Hope that helps.
random on December 31, 2008 12:33 PMALRIGHT!!!
it's 50% or 66.6%. It is not both. It is not neither. It is one of the two. We know that. Now stop explaining the already-explained-1-billion-times to us.
Thank you.
Gabriel J. Smolnycki on December 31, 2008 12:34 PM
Just read all the comments. Very entertaining.
Many people reason that "there are only 2 outcomes so the probability is 50%" or "there are only 3 outcomes so the probability is 33%". You do realize that the probability of each case is not necessarily equal to the probability of the other cases, right?
Anyway, I came across this problem a while back as a potential interview question. It's widely known (using the same wording as Jeff's), and I'm surprised that so many people didn't google the correct answer before embarrassing themselves by insisting that the wrong answer was correct.
*******************************************
FLIP THE COINS AS I'VE SAID. UNLESS YOU ARE AS UNLUCKY AS KAVAR YOU WILL FIND THAT THE ANSWER IS 66%!!!!!!
JUST DO IT! STOP WASTING TIME AND TRYING TO CONVINCE OTHERS WITH YOUR FLAWED LOGIC. FLIP THE COINS!
THE ANSWER IS 66%.... FLIP THE F'ING COINS AND QUIT CONVINCING YOURSELF WITH FLAWED LOGIC.
GO ON, FLIP 'EM!
********************************************
If you want to insist that BG and GB are 'the same thing', then you have to acknowledge that they have twice the probability of occurring.
BG 2
GG 1
2 / (1+2) = 2/3
Tim Hollingsworth on December 31, 2008 12:36 PM@ Jeff R. Probably 100%
@Arnos The problem with reducing it to BG and GG is that people then assume they have equal weights. BG has twice the weight of the GG since one is more likely to have children of different genders than both being girls.
(Yes the probability of having children with different genders is the same as having children with the same gender, since there has to be at least one girl, then half of the same gender results are thrown out)
Sam A. on December 31, 2008 12:37 PMWould someone who claims it matters if the child has been born please explain the mathematical difference between us not knowing when the child is unborn and not knowing after the child has been born?
Arnos on December 31, 2008 12:38 PMSo this is where I still feel compelled to be difficult.
I still think it's 50%, and here's why.
We are not discussing the probability of birthing a given gender from a frame of reference at some time in the past before one or both of children were born. We have 2 existing children. One of them is a girl.
So I've heard a convincing argument of 'flip two coins a hundred times and you'll get Heads & Tails roughly 66% of the time' which is true, but doesn't seem to fit this case as it's looking to predict possible birth combinations of two as yet unborn and ungendered kids?
So for the case that this does describe, we have two coins, heads = boy, tails = girl.
Flip these coins over and over and 66% works. to predict the probability of one boy and one girl as a future occurance, 66% is correct.
But we aren't flipping both coins, these kids exists already. and one of them (doesn't matter which) is a girl. So leave one coin on the table that is set to be tails, as we KNOW that one of the kids is a girl (again, doesn't matter which one, it's quantity of currently existing girls that matter in this case)
Now flip the other coin over and over to figure out the other kid's probable gender. (Again it doesn't matter if we're flipping for the eldest or youngest kid, the second coin is simply a placeholder for 'the kid which is not the girl that was initially refered to', sort of like (true == 1) while (false == !true) )
and we get a 50% probability.
Makes sense to me, considering the amount of information provided.
PunchAndPie on December 31, 2008 12:38 PM@kavar
What kinda coin do you have that you get tails so often?
Sam A. on December 31, 2008 12:39 PM***********************************************
LET ME EXPLAIN IT BETTER THAN ABOVE:
TAKE TWO COINS. HEADS IS A BOY, TAILS IS A GIRL. FLIP THEM BOTH AT THE SAME TIME. IF IT COMES OUT HEADS-HEADS (BB) IGNORE IT AND FLIP AGAIN. IF IT COMES OUT HEADS-TAILS (GB OR BG) PUT A MARK IN THE "BOY" COLUMN. IF IT COMES OUT TAILS-TAILS (GG) PUT A MARK IN THE "GIRL" COLUMN. UNLESS YOUR NAME IS KAVAR, YOU WILL GET TWICE AS MANY BOYS AS GIRLS WHICH EQUATES TO 66%.
STOP TRYING TO EXPLAIN IT AND JUST DO IT! FLIP THE F'ING COINS!!!!!
**********************************************************
There is no point in posting any more explanations of why 2/3rds is the correct answer. Every possible way of explaining it has been posted. If anyone makes it past this comment still thinking 50% is right, it is not by a product of no sufficient explanation being posted, but rather a product of their own refusal to admit fault.
Dylan on December 31, 2008 12:39 PMAlways heard there's a slight bias statistically towards a girl. Something like 55%.
That said, the sex of the first child has no impact on the second (you don't run out of boy genes).
So I'd vote 55% girl 45% boy. Simply because those are the odds for any parent.
Robert Accettura on December 31, 2008 12:40 PM@mike: We are waiting to find out what the result of the second "flip" is. It doesn't matter if we don't know because the child is not born yet or because the parent has not revealed the gender or whatever. The second bit of information is not yet known to us and the first bit (which we do now know) is irrelevant. Initially, this was a problem with four possible outcomes, but now one of the outcomes is known and we have a two outcome problem.
The Monty Hall problem is different because it initially starts with three doors and the problem collapses unevenly. The host doesn't open doors randomly, but picks the undesirable outcome to open. In this case, the doors are opened randomly. Even if the parent purposely picked the child to reveal, how would they decide which door is undesirable? If the desired result is one of each, knowing you already have a girl is precisely as helpful as knowing you already have a boy. Which is to say, neither revelation is helpful.
On the other hand, as other commentators have pointed out, if the parent meant that one and only one of their children is a boy, knowing the first bit means knowing the second bit as well. But my guess is that the intention was to reveal one bit at a time.
Jon Ericson on December 31, 2008 12:41 PMStrong opinions weakly held.
I'm switching to the 67% camp. I read up on Bayes' Theorem and tried the cancer screening example. Working through it carefully and logically, I eventually ended up at the correct answer of 7.7%. Applying the same techniques to this problem, I got 67%.
Stated in Bayesian fashion,
P(at least one is a girl) = .75
P(boy and girl AND at least one is a girl) = .50
therefore
P(boy and girl GIVEN at least one is a girl) = .50/.75 = .67
Good one, Jeff.
Michael L Perry on December 31, 2008 12:41 PM@Sam A.
1.Take two coins. (heads is boy, tails is girl.)
2.Place one coin down on the table showing tails. (we know one is a girl)
3.Flip the other coin.
4.You will get heads 50% of the time and tails 50% of the time.
There isn't twice the odds, one value is already known.
@Arnos:
Because when you ask about an unborn child, we know that it is the first born that is the girl. When both are already born, and we don't know which specific child is the girl, the question (and therefore the answer) is different.
@Arnos:
It doesn't matter if the child has been born or not. It -does- matter if you know -which- of the children is a girl.
It's the difference between
"What is the chance that the -second- child is a boy" (50%)
and
"What is the chance that -either the first is a boy and the second is a girl or the first is a girl and the second is a boy-" (67%)
Using an unborn child in the example is just a way of restating the first one (because we know the gender of the -first- child)
random on December 31, 2008 12:42 PMPunchAndPie, it is not the same problem. You are finding out the odds that the second child is a boy given that the first one is a girl. That is not the question. The question was, given that AT LEAST ONE is a girl, what are the odds that the other one is a boy.
There is a huge difference
Matt on December 31, 2008 12:42 PM@Robert
Actually, it's the other way around. There's a slight increase in the chances for boys.
Foozinator on December 31, 2008 12:43 PM@Therac-25
Bear with me, I'm honestly not understanding something.
Trial A:
1. I flip two coins, and tell you "one of them is heads".
2. You tell me one of them is tails (correct 66% of the time).
Trial B:
1. Same
2. Same
3. I tell you the one on the right is heads.
If we did Trial A 1000 times, and Trial B 1000 times, are you saying that the number of times you're right would be statistically different?
You said "Probability is a result of my state of knowledge. If I don't have the knowledge, then I'm not going to change my probability estimates". However, you DID NOT have that knowledge when you made the guess, and the result is already fixed (both coins are down). How could me telling you anything change the number of times you're right?
Chase Seibert on December 31, 2008 12:43 PM@Robert Accettura
Then the answer given those weights would be about 62% for a boy, and 38 for two girls
Sam A. on December 31, 2008 12:43 PM@PunchAndPie
Read my earlier "Coin toss explained" post
Tim Hollingsworth on December 31, 2008 12:44 PM@chase
The number of trials that would match the conditions you give would be different between the two
Sam A. on December 31, 2008 12:44 PM"1.Take two coins. (heads is boy, tails is girl.)
2.Place one coin down on the table showing tails. (we know one is a girl)
3.Flip the other coin.
4.You will get heads 50% of the time and tails 50% of the time."
That's not the same question. Again, that finds the odds that the second child is a boy given that the first one is a girl. The question was, given that AT LEAST ONE is a girl, what are the odds that the other one is a boy.
There is a huge difference.
Sorry for the shouting earlier. But people here aren't reading they are just posting their thoughts without thinking.
Matt on December 31, 2008 12:45 PM@Matt
I don't think of myself as unlucky so much as unlikely.
@Sam A.
Just a quarter; any old quarter. I assume it has something to do with how I flip them, but I can't figure it out. There's no consistent placement of the coin. Sometimes it goes up and comes right back down, sometimes it goes halfway across the room. I'm just that special. I actually got failed in a genetics lab for this back in middle school. They tell me to flip a coin 100 times and record it, then fail me on the lab for reporting 78 Tails, 22 Heads.
@kavar Can I take you to Las Vegas?
Sam A. on December 31, 2008 12:46 PM@random
You forget we already know one is a girl. You should say "what are the odds that one child is is a boy?" Which has a chance of 50%.
Does anyone realize that genetics takes a role here. Your probability of having a boy or a girl is not .5.
The chance of having a boy vs. having a girl is not *exactly* 50%. The global statistic (http://www.cia.gov/cia/publications/factbook/geos/xx.html) seems to show that the chance is 51.45% for a boy.. That may seem negligible, but when compounded, it could add up to a good 3-4%. That could bring a "66%" to nearly 70%.
Jon on December 31, 2008 12:48 PM@Sam A.
If you want. But I make no promises regarding dice or roulette wheels.
Ok, I am switching to the 67% camp as well. However, call me stupid but I wouldn't bet on a 90% odds that the 10th (not in order) child of someone with 10 kids, of which 9 are known to be girls, is a boy. May be I should, but it just doesn't sit right with me. But 67% it is.
Prasanna on December 31, 2008 12:49 PM@Matt
The question states that one child or the other is a girl. Therefor you can always have one coin showing tails(girl). If you want you can put one coin down and then flip the other one. No matter which coin you put down(first child or second) the odds for the coin being flipped will still be the same.
@Michael L Perry
That was exactly my staring position in my previous posts. However, you cannot say that the P(at least one girl) = 0.75 because there is no way that there is a Boy-Boy combination. Re-do the calculations with B-B removed and you get 50%.
nuclearnewyears on December 31, 2008 12:51 PM@Michael L Perry
That was exactly my staring position in my previous posts. However, you cannot say that the P(at least one girl) = 0.75 because there is no way that there is a Boy-Boy combination. Re-do the calculations with B-B removed and you get 50%.
nuclearnewyears on December 31, 2008 12:52 PM@Arnos:
But we don't know -which- child is a girl. There are two ways for the statement "one of our children is a girl" to be true. The first child can be a girl, or the second child can be a girl.
To use the coin flipping example, what this question is really asking is "If you flip two coins at the same time, what is the chance of getting a heads and a tails". The answer is 67%.
If the question said "Our first child is a girl, what is the chance that the second is a boy" it would be equivalent to "Give that one coin is showing heads, flip the second, and what is the probability of getting tails".
Sorry for the dupe. After I got the error, I waited, refreshed, waited, refreshed and it didn't show up until I reposted. No way around it I guess. Sorry anyway.
nuclearnewyears on December 31, 2008 12:53 PM@Prasanna
Take 1 million coins and put any 999,999 on tails. Now flip the last one. The 999,999 coins on tails will not affect the coin actually being flipped.
@random: "But we don't know -which- child is a girl. "
It doesn't matter to the observer. One of the two is and the other one is a 50-50 chance of gender.
nuclearnewyears on December 31, 2008 12:54 PMLet's restate the question to see if we can make it clear.
You have one person. This person is either a boy or a girl. What is the odds the person is a boy or a girl?
50%
What is actually going on is there are two separate variables that you are trying to combine in to one.
1: What is the odds the girl is born first.
2: What are the odds the other child is a boy.
Both of these are 50/50. So if you say, that birth order is somehow relevant, than you have to re-include the birth order of the ***OTHER GIRL!***
So you actually would have remaining 4 options, G1 being the girl we know about.
G1-G2
G2-G1
G1-B1
B1-G1
Note that the odds are still 50/50 that one is a girl and one is a boy.
Practicality on December 31, 2008 12:56 PMI still feel that there is a confusion of abstractions going on here.
For some reason people are mapping the order/position of the coin being flipped to an individual kid, when in fact the head/tail value of the coin is only referring to a PROPERTY of the kid (gender), and not the kid themselves.
So with Heads = Boy and Tails = Girl, We map the physical coins as a placeholder for the property of a kids gender, but NOT to a kid themself, and one kid is known to 'possess' the property of being a girl, one coins stays flipped to tails as a placeholder for that property.
So the possible combinations are:
coin1 = Tails, coin2 = Tails
OR
coin1 = Tails, coin2 = Heads.
50/50
Which is why I still have to stick with 50%, not because I think I know something that everyone who is a statistics whiz does not (I'm just another dude) but because the solution being applied to get 66% solves a different problem that has ben stated I believe.
PunchAndPie on December 31, 2008 12:56 PM@random: "To use the coin flipping example, what this question is really asking is "If you flip two coins at the same time, what is the chance of getting a heads and a tails"."
No, the question is saying "I have two children (coins). One is a girl (heads). What is the chance the other is a boy (tails)."
Independent of the first.
nuclearnewyears on December 31, 2008 12:56 PM@Arnos
If you flip 1 million coins, and at least 999,999 are tails, whats the probability of a head on the coin. this coin could have been the first, the last, the 13th, it can fall into any of those different positions. If you follow the probability tree, that results ends up being quite a few more than the probability of all tails, by about a factor of 999,999.
Sam A. on December 31, 2008 12:57 PM@random
The question says that one coin is always a tails(girl).
So you can flip two coins, but one will always be a tails.
The other one, no matter which one it is, has a 50% chance of getting heads or tails. Make sense?
@nuclearnewyears:
Yes it does, because it means that there are two ways to satisfy the statement "One of our children is a girl".
See my answer about flipping the coins. The question is asking you to flip two coins at the same time, not flip one, see a heads, then flip the second.
random on December 31, 2008 12:57 PMI know we're beating a dead horse, but I can't believe people are still jumping in to defend the 50% number. It's been linked already, but please read
http://en.wikipedia.org/wiki/Marilyn_vos_Savant#.22Two_boys.22_problem
No one would believe it was 66%, so THEY DID THE DAMN SURVEY!
"Finally vos Savant started a survey, calling on women readers with exactly two children and at least one boy to tell her the sex of both children. With almost eighteen thousand responses, the results showed 35.9% (a little over 1 in 3) with two boys."
If you won't believe that then I give up.
Matt on December 31, 2008 12:59 PMJeff has a lot of reading to do.
Michael Weller on December 31, 2008 1:00 PM@Arnos
Your 1 million coins example is wrong. The question would be "1 million coins were tossed. 999,999 were tails. What's the chance the other one was heads?"
I'm not going to solve this problem but the key is that the single heads result doesn't have to be the 1,000,000th toss - it could be the 999,998th toss or 57th toss or any single toss as long as the other 999,999 are tails. So the probability will not be 50%.
Tim Hollingsworth on December 31, 2008 1:00 PM@sam
"The number of trials that would match the conditions you give would be different between the two"
How so? There are no conditions for A and are not in B also. I only added the step "I tell you the one on the right is heads".
You knew one was heads already, so it tells you nothing about the state of the coins.
*"one on the right" == where they land on the table, not some kind of order.
Chase Seibert on December 31, 2008 1:00 PM@Sam A.
The 999,999 coins that you placed on the table have NO bearing on the one you are actually flipping. The 999,999 are the given, known information. The probability of the coin you flipped (unknown information) is still 50%.
COIN TOSS EXPLAINED
2 coins were tossed. One is heads. What's the probability that the other is tails?
1) Assume coin on left is heads. Then the other coin has 50% chance of heads and 50% tails.
2) BUT the question didn't say the coin on the left was heads. So let's now assume that the coin on the right is heads, then the coin on the left is 50% chance of heads and 50% tails.
3) Combine 1 and 2 (naive solution): (2 * 50%) / (4 * 50%) = 50%
Step 3 is wrong. The problem is that the heads-heads combination was double-counted. The times in 1) when we got heads-heads and the times in 2) when we got heads-heads were the SAME events, so we should only count them once. So to adjust: (2*50%) / (4*50% - 50%) = 100 / 150 = 2/3
Tim Hollingsworth on December 31, 2008 1:02 PMI'm not sure.. I'll make a wild guess..
100%
I think a person will say "I have two girls" rather than mentioning one girl..
I'm not sure I'm taking the question in the right direction.
Now, I do the search... :)
I'm not sure.. I'll make a wild guess..
100%
I think a person will say "I have two girls" rather than mentioning one girl..
I'm not sure I'm taking the question in the right direction.
Now, I do the search... :)
I'm not sure.. I'll make a wild guess..
100%
I think a person will say "I have two girls" rather than mentioning one girl..
I'm not sure I'm taking the question in the right direction.
Now, I do the search... :)
Amr on December 31, 2008 1:04 PM@Arnos
Ah.. But i flipped all of the coins.
Sam A. on December 31, 2008 1:05 PMFor those who are confused if you remove the order than GB and BG are the same thing (because there are is just a B and a G somewhere in the pot, they are not ordered in any way).
Practicality on December 31, 2008 1:05 PM@Chase Seibert
Ah I was interpreting you to mean the one on the right was the second coin flipped.
For those who are confused if you remove the order than GB and BG are the same thing (because there are is just a B and a G somewhere in the pot, they are not ordered in any way).
So you cannot call BG and GB separate solutions.
If you call them separate solutions then you are saying the order matters. The question did not say the order mattered, so these are not separate solutions.
I am convinced that the common voodoo beliefs portrayed as "statistics" and logic are diametrically opposed (IE, Statistics theory is fundamentally flawed).
Practicality on December 31, 2008 1:08 PMSorry, I don't buy anyone's reasoning. A firm believer in empirical evidence, I'm going to go out right now and try to make some babies.
Jeff R. on December 31, 2008 1:09 PMFor those who are confused if you remove the order than GB and BG are the same thing (because there are is just a B and a G somewhere in the pot, they are not ordered in any way).
So you cannot call BG and GB separate solutions. They would be the SAME SOLUTION.
If you call them separate solutions then you are saying the order matters. The question did not say the order mattered, so these are not separate solutions.
Practicality on December 31, 2008 1:10 PMOk, I was wrong. I didn't believe that the child's age makes a difference but it does. There are two working possibilities out of three. Guess I should have though that through more carefully.
Anyway, here is link with a chart that explains it well:
<a href="http://en.wikipedia.org/wiki/Boy_or_Girl_paradox#Second_question">http://en.wikipedia.org/wiki/Boy_or_Girl_paradox#Second_question</a>
I was thinking of the first question on that page.
Arnos on December 31, 2008 1:12 PMSo if BG and GB are the same solution then we started with three possibilities (which they are if order does not matter):
BB
GG
BG (which is the same as GB)
and we eliminated BB.
That leaves GG and BG.
Practicality on December 31, 2008 1:12 PM@Chase Seibert
Well, asking me to go back in time and revise my previous guess based upon knowledge I didn't have when I made it is a bit of a tall order :-)
The probability estimates in my head have changed with the new information, but I'm temporally incapable of changing my bet now.
... or do you still think that probability exists anywhere outside of a mind?
> You knew one was heads already, so it tells
> you nothing about the state of the coins.
Yes it does.
Given coin A and coin B.
With no information, each combination of A and B, heads or tails has a 25% chance of occurring.
"At least one is heads" -> A heads, B tails OR A tails, B heads OR A heads B heads. 33% chance of each, given our new information.
"A is heads" -> A heads, B tails OR A heads, B heads. 50% chance of each, given our new information.
Probability estimates are the result of a mind's information about the world. Adding to that information will change the probability estimates.
Therac-25 on December 31, 2008 1:13 PMTo those still hanging onto the 50% argument that the first baby doesn't affect the chances of the second one...
You're looking at it wrong, and the most concise argument I can see for this is mike's:
"the information is being presented encompasses the sum of the results of both events"
We know LIMITED INFORMATION about the SUM of two babies.
We do not know ANYTHING about one particular baby. Nor is the question about a particular baby, but rather about the SUM of the two babies.
So stop thinking about just one child and the resulting 50% chance.
Make the leap.
@Practicality
You are correct. You simply need to note that P(BG) = 2*P(GG).
Therac-25 on December 31, 2008 1:15 PMIf it's a word game, then the answer is 0% because she said "[only] one kid is a girl". But if it's a math game, the answer is 50%.
We start with 2 booleans, and then one of them is already solved. The simplified phrasing of this question is: "I have 2 kids. Guess the gender of ONE in particular."
Everybody who tries to solve a more complex problem is overengineering it.
Harry on December 31, 2008 1:16 PM
@Harry
> But if it's a math game, the answer is 50%.
Then you lost the game. (Sorry if anyone else lost it just now...)
> We start with 2 booleans, and then one of them is already solved.
Which one is solved? You don't know. All you know is that they can't both be boys.
Therac-25 on December 31, 2008 1:17 PMHm. Back to my original statement:
Given that we can throw away one of the likelihoods (i.e. B+B)...
P(b|g) = P(b AND g)/P(g) = 0.667
P(b|g) = 0.667/1 = 0.667
So.... 66.67%
nuclearnewyears on December 31, 2008 1:18 PMIs this really still be debated??
"...met someone who told you they had two children, and one of them is a girl..."
Read carefully...
HB on December 31, 2008 1:20 PMThe fundamental issue I think lies in the fact that, having one un-age-defined girl means that a state with two girls is at half the probability of a BG mixture.
nuclearnewyears on December 31, 2008 1:21 PM@Patrick
I looked back at the question, thought about it for another minute, and I see what you 66% people are saying now. There is a difference between "what are the chances that she has a boy AND girl" and "what are the chances she has a boy as her next baby".
I'm changing my answer from 50% to 66%.
chris on December 31, 2008 1:22 PM@Matt: We need to ignore both BB and BG because we know the first answer is G. The only order that matters in this problem is the order the genders are revealed. So BG and GB are identical at the start of the game as are BB and GG. Once the first gender is revealed, we can eliminate 50% of the choices. We can safely ignore the first result once it is known--it can provide no more information.
Think about it inversely: What if the bet were that both children were the same gender? If you knew one child was a girl, wouldn't your odds remain 50% of winning?
Or how about this: I've flipped two coins. You may bet either that they are both the same or that one is heads and the other is tails. I'd give you 50:50 odds. Now I tell you that one of them is heads. Are you more or less nervous about losing the bet? Did it matter which bet you had taken? Would you change your bet?
Jon Ericson on December 31, 2008 1:24 PMBefore the guy told us that he had a girl, the probability of him having a boy and a girl are 2/4 (4 permutations B-B, B-G, G-B, G-G out of which two have one boy and one girl). But now he gave us additional information that one of them is a girl so it has to be B-G/G-B/G-G which is three permutations and out of which two have one boy and one girl. So the answer is 2/3 = 66.67%
Minhajuddin on December 31, 2008 1:24 PMBefore the guy told us that he had a girl, the probability of him having a boy and a girl are 2/4 (4 permutations B-B, B-G, G-B, G-G out of which two have one boy and one girl). But now he gave us additional information that one of them is a girl so it has to be B-G/G-B/G-G which is three permutations and out of which two have one boy and one girl. So the answer is 2/3 = 66.67%
Minhajuddin on December 31, 2008 1:24 PM@Therac-25
Again, if we did Trial A 1000 times, and Trial B 1000 times, are you saying that the number of times you're right would be statistically different?
"... or do you still think that probability exists anywhere outside of a mind?" Yes, the number of times you're right between Trials A and B will exist outside of your mind, when we measure how often you are correct.
Chase Seibert on December 31, 2008 1:27 PMThis is exactly why I love developers. On the surface this is a trivial question, assuming my assumptions are correct. But immediately the first several posts shot holes in my assumptions. Leave it to developers to overcomplicate a question just to make sure they are correct.
John on December 31, 2008 1:28 PM@PunchAndPie and everyone else in the 50% camp
Consider it this way: we have 1000 mothers with two children.
250 mothers will have two boys.
500 mothers will have one girl and one boy.
250 mothers will have two girls.
I think we can all agree on that, yes?
Now, if we know that one of a mother's children is a girl, we eliminate the 250 mothers who have two boys. That leaves us with 750 mothers, 500 of which have one girl and one boy.
500/750 = 66%
Tyler on December 31, 2008 1:28 PMIt depends why the parent revealed that one child is a girl.
If its because you asked "is (at least) one of the children a girl?" and you're told "yes" then its 66%.
But if you "stumble upon" the information (phone rings, parent has conversation that's obviously about a girl, you *then* ask and its confirmed that at least one of the children is a girl) then its 50%.
The difference is that, whilst there are twice as many BG households as GG, you're twice as likely to "stumble upon" one child being a girl when in a GG household.
xooorx on December 31, 2008 1:29 PM
Jeff Atwood,
"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?"
This question might have several answers depending upon what the "purpose" of asking the question was.
If the question was to show that Bayesian Reasoning is very difficult and many people get it wrong {as the link would imply}. Then the answer is 2/3.
If the question was to show that "normal people" don't think like CS majors or Mathematicians. Then the answer is near 100%, depending upon the number of percentage of people in a random sample that would happen to be Mathematicians. I wonder what percentage of the populace are Mathematicians.
If the question is posed to make us ask, "Are we really given enough information. I should get more detailed information before drawing a conclusion." Then the answer is "I don't know, need more info".
If the question was posed just to hit 1000+ comments, well done.
Please Jeff, stop the madness. What was the point?
Here's a little joke for you all...
An astrophysicist, a physicist, and a mathematician were on a train riding through Ireland. They looked out the window and saw a black sheep grazing on the pasture.
The astrophysicist says, "All of the sheep in Ireland are black."
The physicist chimes in, "Your wrong, you only know that there exists in Ireland at least one black sheep."
"Your both wrong," the mathematician says, "You only know what there exists in Ireland at least one sheep that black on one side."
Mike on December 31, 2008 1:29 PMI'm all for reductionism, but not to the point of re-writing the problem statement.
Unless I'm missing something, the answer 2/3.
People are right that order doesn't matter and that the gender of each child is completely independent, but as someone mentioned, this is a matter of filtered information, and the 50% crowd is mis-reading the problem.
This isn't a simple question of the likelihood of a particulay child being a boy (with some extra rhetorical icing); this is a different question altogether.
In a two-child family, there are -- presumably -- 4 combinations of gender outcomes, each statistically even:
Boy then Girl (25%)
Boy then Boy (25%)
Girl then Boy (25%)
Girl then Girl (25%)
One way to look at it is to simply eliminate the combination where there are two boys since we're given that information...
Boy then Girl (25%)
Girl then Boy (25%)
Girl then Girl (25%)
so, now two of the three {equally liklely} combinations contains a boy. (therefore 2/3)
But some are quick to call foul here because "order doesn't matter".
So we can take order out of the equation, but not blindly; A boy followed by a girl may be equivalent to the vice-versa, but a B/G combination is still twice as likely as either G/G or B/B. The original breakdown becomes the following (order irrelevant):
Boy/Girl (50%)
Boy/Boy (25%)
Girl/Girl (25%)
(not as some might assume 33%/33%/33% respectively)
Eliminate Boy/Boy from the mix (per the information given) and once more we have 50/75 => 2/3 likelihood that the other child is a boy.
Steven on December 31, 2008 1:31 PMnuclearnewyears,
No, applying Bayes' theorem, we need to first consider the probability within the entire population. Then we can do the math to get the new probability given known information. Taking the givens into account too early leads to errors.
P(x|y) = P(x^y) / P(y)
Or, the probability of x given y is equal to the probability of x AND y divided by the probability of y. You can't assume that y is true, yet. Otherwise the denominator would always be 1.
Michael L Perry on December 31, 2008 1:33 PMHere's another way to think about it for you 50%ers. (Feel free to substitute in your currency of choice.)
Your claim is that when I flip two coins and at least one is heads, there is a 50% chance that the overall outcome will be one heads one tails, and a 50% chance that it will be two heads. So I propose a bet. We flip two coins, and when at least one is heads, the bet comes into play. If the other coin is tails, you pay me $1. If the other coin is heads, I pay you $1.20, so that if you're right you'll tend to make money after a decent number of flips.
That means:
Two tails - Draw; no one wins
One heads one tails - I win $1
Two heads - You win $1.20
Would you take this bet?
Chickencha on December 31, 2008 1:35 PM@Mike
"You're all wrong," says the philosopher, who was listening in on all this. "You only know that on this particular trip through Ireland, your mind has brought to consciousness the percept, illusory or not, of a sheep, black on this side."
A 50% argument that the 66%ers can understand:
Lets assume the parent picked a child at random and revealed that it was a girl.
From 100 parents lets say:
25 have BB
50 have BG
25 have GG
Now... *ONLY HALF* of the BG parents will have said girl whereas *ALL* of the GG parents will have said it. So its 50% not 66%.
(You have to *ask* if there's at least one girl to get 66%)
xooorx,
Nicely stated. Exactly the premise of my original 50% argument.
However, I switched to 67% because the purpose of this argument is to study Bayesian theory. If I were being practical, I'd be in the 100% camp.
Michael L Perry on December 31, 2008 1:45 PMHere's another puzzle for you:
A certain king is often out fighting wars. He loves battle, but there is a problem: his kingdom is running low on men! So he thinks about it, and passes a new law: "Women must stop having children after their first girl."
For he reasons thus: with this law, sure, there will be the occasional one-girl family, but there will also be boy-girl families, boy-boy-girl families, boy-boy-boy-girl families, and so on. Thus, the proportion of boys amongst children will increase.
So, the problem: calculate the boy:girl percentage in the kingdom after a sufficiently long period of time has passed (assuming 50-50 odds for each birth).
John Fouhy on December 31, 2008 1:46 PM@Chase Seibert
> Again, if we did Trial A 1000 times, and Trial B 1000 times,
> are you saying that the number of times you're right would
> be statistically different?
Okay, let me get this clear. We do this 1000 times.
You flip two coins. You tell me one is heads.
I predict the other is tails. I will be right 66% of the time.
You tell me the right one is heads.
Here's your problem. This is only going to be the case 66% of the time -- in 33% of these trials, the right one is not going to be heads.
So what do you do in this case? Just pick one that's heads and tell me that one? If the right one is ALWAYS heads, then the game is fixed, so of course my estimates are going to be wrong.
You aren't giving me any new information in this case.
Therac-25 on December 31, 2008 1:47 PMThis is truly getting STUPID. You people need to get a life.
Chris on December 31, 2008 1:48 PM@xooorx
I'll buy that argument, but I don't think that that was the intent of the question. (Jeff can tell us for sure.) I also don't think that's the same logic that most 50%ers are using -- I believe most of them are arriving at the same conclusion through erroneous logic.
Chickencha on December 31, 2008 1:49 PM@Mike
"Shut up already! Who gives a flip about a sheep, anyway?" asked the software developer. "I'm trying to get some work done on my laptop, and there you are jabbering away. Here's a real puzzle for you: 'Let's say, hypothetically speaking, you met someone who told you they had two children ...' "
Jeff R. on December 31, 2008 1:50 PM@John Fouhy
I am pretty sure the proportion of men:women stays at roughly 1:1. Half the population has a girl and stops. The other half has a boy. At this point the ratio is 1:1 (ignoring multiples). Of the people who continue to have children, the same occurs again.
@Chris
Why are you even here and reading the comments? It's stupid, so go do something else.
The 2/3rds answer seems to hinge on treating B-G and G-B as two separate possibilities. I'm still struggling to see why one would do such a thing in a situation where you haven't been asked to do so. It seems to be creating a discrete possibility out of something in which there isn't one. Of the genders of children one can have, I only see B-B, B-G, and G-G. Why should I treat G-B as a discrete entity in a problem like this? That's what I don't get.
I'm not a mathy person but I haven't seen anyone explain satisfactorily why this apparently commonsensical observation is incorrect in terms that can similarly appeal to common sense.
Shmork on December 31, 2008 1:53 PM50% vs 66% -or- B-G vs G-B
People are confusing Events with Outcomes!!!
An Event is a set of related Outcomes. An Outcome is, simply put, all that one can reasonably measure and/or record
about an (ideally instantaneous) observation.
For example, consider the Events on the roll of one standard six sided die:
- Event "Even" is Outcome of 2, 4, or 6
- Event "Odd" is Outcome of 1, 3, or 5
- Event "Factor-of-3" is Outcome of 3 or 6
- Event "One" is Outcome of 1
There is also the special Event called the "Sample Space" that is the set of all possible Outcomes. The Sample Space
for the one die roll is of course 1, 2, 3, 4, 5, or 6.
Note: An Event CANNOT contain an Outcome that is NOT contained in the Sample Space! This is because, by definition,
the Sample Space must contain all possible Outcomes for a given context.
An Event is said to occur when the Outcome one observes matches one of the Outcomes that defines the Event.
(Ideally, the match should be exact, but in real life the match can be "close enough".) And, yes, it is possible for
one to define Events such that more than one occurs within a single (instant) observation. If the roll had an
Outcome of 3, then Events "Odd" and "Factor-of-3" have occurred (simultaneously).
Note also that the Outcomes in the Sample Space are (ideally) distinct. In other words, if one is to work with a six
sided die that is labelled with 1, 2, 2, 3, 3, and 3, your theoretical Sample Space might need to look like 1, 2A,
2B, 3A, 3B, and 3C, and you may need Events like "Rolled-a-2" (2A or 2B) and "Rolled-a-3" (3A, 3B, or 3C). In real
life, you're not likely to tell the 2's and 3's apart, but your theory (of 2A, 2B, 3A, etc.) will aid you in getting
the odds right.
Each Outcome may have a numerical weight of its own. Ideally all Outcomes should have the same weight, but this is
not always the case. Still, for most problems, giving each Outcome the same weight works well enough.
Each Event, in turn, has a weight equal to the sum of the weights of its Outcomes. Assuming the above Outcomes each
have a weight of 1, then Events Even, Odd, Factor-of-3, and One have weights of 3, 3, 2, and 1.
One can normalize these weights by dividing each with the weight of the Sample Space. This will give the weights,
going from 0 to 1, that is conventionally used in Probability. For the one die roll, this is a weight of 6. Hence,
the Probability of Event Even is 3/6 = 50%. In other words, P(Even) = 50%. Also, P(Odd) = 3/6 = 50%, P(Factor-of-3)
= 2/6 = 33.3%, P(One) = 1/6 = 16.7%.
As many have already pointed out, the possible Outcomes for the "one is a Girl, odds on a Boy" problem are:
(Boy, Girl), (Girl, Boy), (Girl, Girl)
The Sample Space of this problem has a weight of 3 (keeping it simple, only two kids, gender mix at 50/50, and no
twins). The observation being recorded is the gender of the first born and the gender of the second born. Hence the
Outcomes here are ORDERED sets - (Boy, Girl) and (Girl, Boy) are NOT the same! (Mathematically speaking, an Outcome
is really more like a Vector or a Matrix.)
The Event we would like to track is "Girl-and-Boy":
- Event "Girl-and-Boy" is Outcome of (Boy, Girl) or (Girl, Boy)
Events are NOT ordered sets! {(Boy, Girl), (Girl, Boy)} IS the SAME as {(Girl, Boy), (Boy, Girl)}.
An Outcome should be (in principle, anyway) a perfect record of all that can be observed. Dropping information, such
as birth order, often brings misleading results. This is because, ideally, all Outcomes should have equal weight,
and following the mechanics of the situation is your best hope of achieving this. With birth order, "Girl-And-Boy"
is an Event with a weight of 2. Without birth order, "Girl-And-Boy" is an Outcome with a (presumed) weight of 1.
If
you insist on dropping birth order from your Outcome record, you may miss out on whether the "Girl-And-Boy" Outcome
needs a weight of other than 1.
Event "Girl-and-Boy" has a Probability of 2/3 = 66.7% (weight of "Girl-and-Boy" divided by weight of "Sample
Space").
Since the problem originally asks for the odds of a boy and a girl, that is simply the weight of
"Girl-and-Boy" to
the weight of "Only-Girls":
{(Boy, Girl), (Girl, Boy)} : {(Girl, Girl)}
2 : 1
What makes this problem Bayesian is in the way information is used to remove Outcomes from the Sample Space and
Events. Once this reduction happens, the weights on Events and the Sample Space can change, which in turn changes
the probability.
Let's say in addition to "one is a girl" we are also told "and she is the first born." The Sample Space then
becomes:
(Girl, Boy), (Girl, Girl)
because the information "she is the first born" now makes (Boy, Girl) impossible.
By definition, Sample Space indicates all possible Outcomes FOR THE GIVEN CONTEXT, and so (Boy, Girl) must be
removed from Event "Girl-and-Boy" too:
- Event "Girl-and-Boy" is Outcome of (Girl, Boy)
And so, in the context of "one is a girl and she is the first born", the weights of Sample Space and "Girl-and-Boy"
are 2 and 1.
Thus P(Girl-and-Boy) is now 1/2 = 50%, and the odds change to:
{(Girl, Boy)} : {(Girl, Girl)}
1 : 1
Gosh ... look at all those replies. Would it make a difference if they told you that the oldest child is a girl?! Hmmmm ....
chris on December 31, 2008 1:55 PM@Therac-25
> You aren't giving me any new information in this case.
Just to clarify what I'm saying here.
"Coin A is heads" tells me something.
Saying "One of them is heads", and then picking one of the ones that are heads after the fact -- necessarily changing it on each trial -- does not tell me anything new. It's an obfuscated way of saying "One of them is heads".
The point is there are cases where you can say "One of them is heads" and you CAN'T say "Coin A is heads".
That's why "Coin A is heads" gives me information, and the process of "One of them is heads" -> "Coin [A|B] is one of the the ones that is heads" doesn't. If you then asked me to undergo a SUBSEQUENT guess, then I would wager at 50% the face of the other coin.
Therac-25 on December 31, 2008 2:00 PMKeep posting:
p1 = 50%
p2 = 66%
n1 = posts for 50%
n2 = posts for 66%
answer = (n1*p1 + n2*p2) / (n1 + n2)
Nikos on December 31, 2008 2:02 PMIf somebody says in casual conversation exactly "I have two children and one of them is a girl" obviously they have 1 girl and 1 boy. Believing otherwise is to fail at understanding how normal people talk.
As the problem is stated, one should probably infer that there were two statements: "I have two children" and "Blah blah, my daughter Jane is in kindergarten" (or something like that). In this case the answer is 2/3 chance of having a boy and a girl as many have explained.
Now get back to work everybody!
mj on December 31, 2008 2:02 PM@Chickencha: I would ask why we are throwing out 1/4 of our throws. I do not agree that "when I flip two coins and at least one is heads, there is a 50% chance that the overall outcome will be one heads one tails, and a 50% chance that it will be two heads." Rather, when I flip two coins and reveal the result of one of the coins, there is a 50% chance the other coin will end up the same as the first and 50% chance it will be different.
Now if you ask if at least one of the coins is heads and I answer "Yes", that is an entirely different question, since I can eliminate one and only one of the four outcomes. In this case, the extra bit of information is that I'm constrained to searching for a particular result rather than picking whatever result I feel like revealing.
The question really is: {GB, GG} or {GB, GB, BG}. Clearly you will get different results depending on the problem set, so chose wisely. ;-)
Jon Ericson on December 31, 2008 2:03 PM0% they have a boy or girl. You are only hypothetically meeting this person. Hypothetical people do not have real children.
Ben on December 31, 2008 2:05 PM@Rich K
Thank you, that is the first satisfactorily complete answer to why BG and GB should both be considered as unique for the purposes of probability (rather than just squirting that into the explanation as a 'given')
66% it is then.
PunchAndPie on December 31, 2008 2:06 PMShmork,
Treating BG and GB as separate possibilities is only useful for calculating the probability of having one of each.
Thinking of it another way, if you have 8 children, is it more likely that you have 4 and 4, or 1 and 7? They are the same outcome, but they do not have the same probability. 4 and 4 is much more likely than 1 and 7.
So the probability of 1 and 1 is 50%, the probability of 2 and 0 is 25%, and the probability of 0 and 2 is 25%.
Michael L Perry on December 31, 2008 2:12 PM50%
---------
two childs - one is a girl
two possible outcomes (boy girl, girl girl)
odds for (boy girl) is 50%
Happy new year everyone!! Go home and drink beer..
Happy on December 31, 2008 2:18 PM@Shmork:
G-B doesn't need to be treated as a discrete entity, but it's easier to explain using that then just saying "B-G has twice the weight, because there are two ways to get a mixed pair: Either the boy is born first then the girl, or the girl is born first then the boy".
This is a significant difference specifically because we're dealing with the two independent events that the 50%ers like to point out. There is 50% chance that the first child is a boy. There is a 50% chance that the second child is a girl. Thus there's a 25% chance that the order is boy-girl. Similarly, there's a 25% chance that the order is girl-boy. Thus there is a 25%+25%=50% chance that there is a mixed pair. Since the odds of boy-boy and girl-girl are each 25%, it breaks down:
boy-boy = 25% (invalid in this case)
mixed pair = 50% (valid)
girl-girl = 25% (valid)
@Jon Ericson: "Rather, when I flip two coins and reveal the result of one of the coins, there is a 50% chance the other coin will end up the same as the first and 50% chance it will be different."
If you randomly select whether to reveal heads or tails each time, then I might agree. But that's not the problem we're given in this post. We're given that at least one child (coin) is a girl (heads). It doesn't matter whether or not the hypothetical person in the problem randomly selected which child to tell us the gender of: we know the outcome.
Chickencha on December 31, 2008 2:21 PMThe New Year's partying is still hours away, but I'm giddy already. Thank you, Jeff Atwood, for that clever post, and stirring up all the entertaining and educational commentary. Could you make it a December 31 tradition???
All you posters out there, you're awesome! Happy New Year!
I read through most of the thread, then drew a little diagram to help me think through it.
B1 50% G1 50%
/ \ / \
/ \ / \
B 50% G 50% G 50% B 50%
When a couple has a child, 50% that's it a boy or a girl. Another child = 50% boy or girl. **It doesn't matter which is born first**. When a couple has two children,there's a 75% chance that one is a girl. When we know that one child is girl, there is a 66.6 (2/3) chance that the other is a boy. **This chart does not mean the the B1 and G1 on top are the first child. B1 and G1 could just as easily be the second child. Order does not really matter.**
Ben J on December 31, 2008 2:25 PMActually, I think it is not an answerable question and invalid. Who is 'that person'? Is it the hypothetical person that is telling us or is it the person who we know is a girl? Completely changes the nature of the question. Since it is not clear who 'that person' is, we are unable to determine the correct answer because the sentence is not clear.
Ben on December 31, 2008 2:26 PMCongratulations, Jeff, you win the Internet. Now please give someone else a turn.
Anonymous Cowherd on December 31, 2008 2:27 PMI read through most of the thread, then drew a little diagram to help me think through it.
B1 50% G1 50%
/ \ / \
/ \ / \
B 50% G 50% G 50% B 50%
When a couple has a child, 50% that's it a boy or a girl. Another child = 50% boy or girl. ***It doesn't matter which is born first***. When a couple has two children,there's a 75% chance that one is a girl. When we know that one child is a girl, there is a 66.6 (2/3) chance that the other is a boy. ***This chart does not mean the the B1 and G1 on top are the first children. B1 and G1 could just as easily be the second children. Order does not really matter.***
Ben J on December 31, 2008 2:27 PM(sorry, didn't read all the posts, this may have been correctly answered and explained already).
The answer is 2/3
This is similar to a problem in the "all of statistics" textbook by wasserman. The problem goes something like " you have one card that is green on both sides, one that is red on both sides, and one that is red on one side, green on the other. You draw a card at random and see one side at random. If the side you see is green, what is the probability that the other side is also green?"
Most people will intuitively (and incorrectly) answer 50%. Let's say A is the event you see green, then P(A) = 1/2 (there's 6 sides, 3 of them are green, 3/6 = 1/2).
Let B be the event you see green on the other side of the card, so the probability that we see green on the other side, given we saw green on the first side is (by bayes rule) P(B|A) = P(A and B)/P(A).
P(A and B) is 1/3, because there's 3 cards and only one of them is green on both sides so:
P(B|A) = P(A and B)/P(A) = (1/3)/(1/2) = 2/3
arturo on December 31, 2008 2:32 PM@Chickencha: Do we know how Jeff chose to reveal one gender? I maintain that he got a result first and wrote an appropriate question later. But I suppose he could have written the question first and waited around until he got an appropriate result...
Jon Ericson on December 31, 2008 2:32 PMNone of this takes into account the fact that the sex of offspring tends to run in the family. So, given any set of two-child families, the number with a GG and BB combination is each higher than the number with a BG combination. Therefore, a couple that already has a girl is statistically more likely to produce another girl.
<grin>
I think the chances are slim to NONE that the person can have a baby that is both a GIRL and a BOY...
@Jon Ericson: I'm not sure I follow.
I don't see that it matters how Jeff chose to reveal what he did. Regardless of how random or planned it might have been, the probability of him revealing that there's at least one girl is 1. Because that's what he did.
Chickencha on December 31, 2008 2:39 PMChickencha: It matters how Jeff chose to reveal what he did because, eg, if he was asked "do you have at least one girl?" then he would have definitely said yes, even if one of the children was a boy. But if he was asked "Randomly pick one of your children and tell me its sex" then he might have said "boy" even though he has a girl as well.
xooorx on December 31, 2008 2:44 PMClassic Monty Hall problem: 66%
Alex on December 31, 2008 2:45 PMTo the 66%ers mentioning that the possible combinations are BB, GB, BG, GG, and that knowing one is a girl removes the BB option, you do realise that knowing one is a girl also removes one of the BG/GB options as well? As such, I'm going for 50% based on my interpretation of the question and the assumption that child birth results in an even distribution of boys/girls over a large sample.
BootLace on December 31, 2008 2:47 PMIts NOT Monty Hall.
Monty never opens the door on the car.
xooorx on December 31, 2008 2:47 PMI'm switching back to 50%. Here's why.
i'm going to make up my own rules (because I can). Pick a parent of two children at random. They pick one of their children at random. They tell me the gender of that child, and I guess whether they have one of each.
The probability that they have one of each is 50% (as established so many times above). The probability that they have one of each and say "girl" is 25%. They would choose their girl half the time.
So, by Bayesian theory, the probability that they have one of each GIVEN that they said "girl" is equal to .25/.50 = .50.
QED
Michael L Perry on December 31, 2008 2:47 PM0%. I just met this guy, and he's probably lying. I'm going to check my pockets to ensure nothing's missing.
Owen on December 31, 2008 2:49 PMThe real problem is that the title of this post implies that he will never let this game finish...
Practicality on December 31, 2008 2:51 PMAbsolutely no way to tell from the information given.
Some possibilities besides the ones listed above:
The person SAYS they have two children, and SAYS that one of them is a girl. What if the person is delusional and has no children? Or is simply lying?
That's a non-zero possibility. As such, it's going to mess with the probabilities such that it's not going to be 1, 1/2, or 2/3, or any of the other possibilites given.
If we assume that the information given is accurate -- and that's an assumption -- we also have to consider HOW it was given. Was it phrased in such a way that this information was simply gathered incidentally? If so, then the fact that one of the children is a girl is almost irrelevant -- I suppose that the fact that identical twins exist would SLIGHTLY push the chances of the other child being a girl up, but there aren't that many identical twins, so it probably wouldn't matter much. So the most likely situation is that the odds that the other child is a boy is the same odds that a random birth will be a boy, whatever those odds are.
In other words, if the situation is that you've established through conversation that the person has two children, and then, later, the parent mentions that they're worried that their older child will become pregnant, then that information is irrelevant to the sex of the younger child.
If the person says, "I've got two kids -- one daughter", then, in almost all cases, that means that the person is saying that they have ONLY one daughter, and that the other child is either a son or intersexed or something -- most likely a son, and the odds are NEARLY 100% that their other child is a boy -- except that there is the chance that they're lying, or that the other child is intersexed, or some other situation.
Ian Osmond on December 31, 2008 2:54 PMChance of having a girl (.5) x Chance of having a boy (.5) = .25 = 25%
Chance of having a boy AND a girl = 25%
kevin on December 31, 2008 2:56 PM@Matt
Appeal to authority is a logical fallacy. Just because wikipedia (or your statistics textbook) says this is the solution does not make it true.
Practicality on December 31, 2008 2:59 PMThere are three possibilities:
boy/boy
boy/girl (same as girl/boy)
girl/girl
thus it's 33% because we can't rule out boy/boy as we don't know if he/she's lying or not.
Patrick on December 31, 2008 3:02 PMFor the 50% crowd that says that "order doesn't matter" or "two possible outcomes (BG,GG), you have to take into account the how likely each of the outcomes is. Since there are two ways of getting a boy and a girl, and only one way of getting two girls. Having one of each is twice as likely.
mike on December 31, 2008 3:10 PMThe probability is 100%.
Why?
They told you they have two children. If they have two children, they can also have three. Or four. Or five. Or an infinite amount of children, in theory.
If they have an infinite amount of children, they will "almost surely" have a boy.
Do I win a prize?
Casey on December 31, 2008 3:13 PMLet's try this. I just read a blog post by someone who mentioned they have two children. They then reveal mention the genders of each one. I've randomly picked to reveal to you the gender of the oldest: a son. Now before you follow this link, make a bet with yourself if the children have the same or different genders: <http://contrarianedge.com/2008/12/31/frame-of-reference/>.
Or imagine if I scoured the internet for a reference to an article in which there are two children and one of them is a boy. Totally different bet. In that case, I've already eliminated 1/4 of the options and you would likely call me a cheater. In essence, you've restricted reality to conform to your question, which isn't nice. In that case, I'd expect the question to be explicit about your selection method, since it is not natural.
Jon Ericson on December 31, 2008 3:18 PMi was in the 50% column until I ran
double boys = 0;
double girls = 0;
Random r = new Random();
while(girls < 1000000 )
{
int first = r.Next(0, 2);
int second = r.Next(0, 2);
if ( first == 1 || second == 1 )
{
if (first == 0 || second == 0) boys++;
girls++;
}
}
double percentage = boys/girls;
and got .667199
I guess knowing the ordering matters. If you know the ordering it changes the percentage to .50 Weird
alex on December 31, 2008 3:18 PM50%
The fact that one is a girl has nothing to do with the probability of the event of the other being a boy.
Anyone saying odds are better than that, I live in chandler Arizona and would love to play poker with you.
True, this is not exactly monty hall, but it can be looked at the same way. There are essentially 4 'doors' in this problem: gg gb bg bb. By saying that at least one is a girl they essentially 'open' the bb door. This leaves 3 doors, two of which have one boy and one girl behind them. probability 2/3.
Could also be solved as follows:
P(girl then girl) = .5*.5 = .25
P(girl then boy) = .5 * .5 = .25
P(boy then girl) = .5 * .5 = .25
P(boy then boy) = .5 * .5 = .25
thus
P(girl and boy) = P(boy then girl) + P(girl then boy) = .5
so gg = .25 bg = .5 bb = .25
eliminating the possibility of bb, you need to get the probability of bg from the remaining choices:
bg/(gg+bg) = .5/.75 = .66
@Bobson
>if(numberOfGirls == 1 && numberOfBoys == 1)...
>else if(numberOfBoys == 1 && numberOfGirls == 1)...
>There is a very clear difference between those two cases - Where you'd crash with the following definitions:
>numberOfGirls=0
>numberOfBoys="one"
>See? Order does matter :p
We already know numberOfGirls > 0 so that one is out from the start.
I wasn't trying to show all the possibilities, just my opinion that saying BG != GB is silly.
Greg Davis on December 31, 2008 3:22 PM@Chickencha: Actually the probability that he would reveal one gender is 1, since that is what he did. The probability that he would reveal it was a girl is unknown until we understand why he chose to reveal a gender. I think some people are adding information we do not currently posses to come up with their answers. Having thought about it more, I've decided I'm one of those people.
My current answer is undefined until we hear more about Jeff's motivation for asking this question. See <http://steve-yegge.blogspot.com/2008/12/programmers-view-of-universe-part-2.html>.
Jon Ericson on December 31, 2008 3:29 PMi have to revise my answer to 1/3 because my answer was for probability of both children being girls.
Same cards analogy, let A seeing green on first side, B = seeing RED on other side (not green as my original post had it).
P(A and B) = 1/6, not 1/3 because there are six possible ways of drawing one card (3 cards * 2 sides per each card). So
P(B|A) = P(A and B)/P(A) = (1/6)/(1/2) = 1/3
arturo on December 31, 2008 3:30 PMOf course, the closer answer is 68.75%.
The natural birth sex ratio being 1.1 boy/girl, probabilities for pairs are:
bb 27.44%
bg 24.94%
gb 24.94%
gg 22.68%
Discarding bb and considering the remaining population:
bg 34.38%
gb 34.38%
gg 31.25%
so bg|gb = 68.75%
---
Ok, I cheated: I did a web search to find the sex ratio there:
http://en.wikipedia.org/wiki/Human_sex_ratio#Natural_ratio
There are a ton of very different, very complicated answers to a question that a 4th grader can figure out.
They tell you a person has two children, and they ask you the odds of the person having one boy and one girl. Without any other information, the answer would be 50%(combos of: GG, GB, BG, BB).
They tell you that one of the children is a girl, so all they are asking for is the probability that the other child is a boy. There are only two choices to choose from(boy/girl), meaning you have a 50% chance of getting it right. Nothing else matters, probability does not change of the second child being a boy/girl no matter what the first child is.
Simple Example: I flip a coin, it comes up heads. I flip the coin again, what are the odds it comes up heads again?
It is completely irrelevant what happened the first time you flipped the coin, the odds don't change, it is still 50%. It's the same with children, you have a 50% chance of a baby being a boy or a girl.
Anon on December 31, 2008 3:32 PMThis problem is well documented:
See http://en.wikipedia.org/wiki/Boy_or_Girl
for the answer being 66% Have a good day
Kieth on December 31, 2008 3:32 PMThis problem is well documented:
See http://en.wikipedia.org/wiki/Boy_or_Girl
for the answer being 66% Have a good day
Kieth on December 31, 2008 3:32 PMHow you learned this fact affects the outcome.
Assume the probability of being born a girl or boy is exactly 1/2 (it's not but let's keep it simple.)
Scenario #1:
You're sitting enjoying coffee with your new friend who has just told you she has two children. You don't know their genders. A small child enters the room, walks up to your friend who explains this is her daughter Lisa.
The probability that the other child is male is 1/2.
Scenario #2:
You're sitting enjoying coffee with your new friend who has just told you she has two children. You ask, "Is at least one of them a girl?" She looks a little puzzled but replies, "Yes."
The probability that the other child is male is 2/3.
@david stafford.
The probability should be the same. the physical child doesn't change the problem.
Kieth on December 31, 2008 3:37 PM@Therac-25
"You tell me the right one is heads."
Poor wording on my part. I should have said, I tell you which one in heads.
Chase Seibert on December 31, 2008 3:41 PM@Kieth
Again, appeal to authority is a logical fallacy. Besides, stop appealing to wikipedia. Remember that people who erroneously think it is 2/3 could easily be editing that article. If you read the discussion there it is far from unanimously agreed upon.
Practicality on December 31, 2008 3:43 PMBootLace:
"To the 66%ers mentioning that the possible combinations are BB, GB, BG, GG, and that knowing one is a girl removes the BB option, you do realise that knowing one is a girl also removes one of the BG/GB options as well?"
No, if I was told "My first child is a girl" _or_ "My younger child is a girl" then it would remove one of the options. That's the crucial piece of information that makes it 66% rather than 50% -- I can't remove either of those options without knowing which child it is.
Trevel on December 31, 2008 3:49 PM@Kieth: But the extra information does. Scenario #1 eliminates two results {BG, BB}, but Scenario #2 only eliminates one: {BB}. The method of selecting the problem space matters greatly.
Jon Ericson on December 31, 2008 3:51 PMThanks to Trace for an excellent diatribe on the mental process of the uber-engineer.
50/50.
Each time a coin is tossed, there is a 50 percent chance it will come up tails, NO MATTER WHAT CAME BEFORE.
Each time conception occurs in the human womb, the same rule applies (give or take a percentage point or two).
Wombat on December 31, 2008 3:51 PM<i>This problem is well documented</i>
<a href="http://imgs.xkcd.com/comics/words_that_end_in_gry.png">as is the solution</a>.
VoiceOfUnreason on December 31, 2008 3:56 PM66%
If you disagree you fail at bayes theorem and logic. Have a nice day.
Waffle on December 31, 2008 3:58 PM@Practicality
Honestly, the answer 2/3 has been explained enough, that I just gave up. I hoped that would help to answer this debate, considering 2/3 is documenting in several of the textbooks on my bookself almost word for word.
Kieth on December 31, 2008 3:59 PM@jon Ericson
You still haven't removed bg. There is no way to say she doesn't have a teenage boy or a baby boy with his father.
Kieth on December 31, 2008 4:00 PMThe problem: "What are the odds that person has a boy and a girl?" can be reworded as "What are the odds of having two children of opposite genders?"
{BB, GG} vs. {BG, GB}
50%
I notice a lot of people mention the following combinations:
BB
BG
GB
GG
Isn't BG and GB the same combo? That means there are only three possible combinations... right?
For all the people who are arguing semantics and questioning Jeff's motives, Jeff didn't make this problem up. This is a very well-known problem:
http://en.wikipedia.org/wiki/Boy_or_Girl_paradox#Second_question
http://www.physicsforums.com/showthread.php?t=233255
http://www.cut-the-knot.org/bears.shtml
http://mathforum.org/library/drmath/view/52186.html
http://www.cut-the-knot.org/carroll.shtml
The details differ from scenario to scenario, but the basic setup is always something like this: "I have two WIDGETS. Each WIDGET is either BLACK or WHITE. At least one WIDGET is BLACK. What is the probability that the other WIDGET is WHITE?" (Or the opposite question would be, "What is the probability that the other WIDGET is BLACK?") For WIDGETS, you can substitute any object in the world that has a boolean property. For BLACK and WHITE, you can substitute some boolean property of whatever WIDGET you chose. It doesn't matter, as long as P(WIDGET is BLACK) = P(WIDGET is WHITE) = 0.5.
And, I am not listing those links as an appeal to authority. In fact, both answers (1/2 and 2/3) appear in those sources.
I am simply pointing out that the question has been asked before in many forms, so there's no need to wonder if it's a trick question, to question Jeff's motives, to dissect the semantics or to argue the real-world plausibility of the scenario.
If anything, Jeff should've written the question more clearly and precisely to avoid all of that, but too late for that, I guess.
BTW, if anyone is interested, here is a source which originally claimed the answer was 2/3, and has now revised its answer to 1/2:
http://www.quantdec.com/envstats/notes/class_04/prob_sim.htm#sibling
@luke
That list shows that there are 4 equal possibilities. If you collapse gb and bg that now has a higher weight than the others.
Kieth on December 31, 2008 4:03 PMafter seeing the wikipedia link, i'm going back to 2/3 since my card analogy is not quite correct. For the card analogy to work, it would have to be P[(first side = green and second side = red) or (first side = red and second side = green)] = 1/3 + 1/3 = 2/3
arturo on December 31, 2008 4:06 PM@Kieth,
Jon Ericson explains it.
To put it another way: How you sample the data can bias the result.
heh - what part of "no HTML" did I fail to understand...
VoiceOfUnreason on December 31, 2008 4:11 PMLuke, the BG GB distinction is introduced only to demonstrate that the probability of one boy and one girl is 50% while the probability of two boys or two girls are 25% each.
BB - 25%
BG/GB - 50%
GG - 25%
Since BB is eliminated (at least one is a girl)
BG/GB - 50%/75% = 66.7%
GG - 25%/7% = 33.3%
Naturally, if the statement was "the first is a girl" it would be
GB - 25%/50% = 50%
GG - 25%/50% = 50%
Which is the question answered by most 50%ists.
Trevel on December 31, 2008 4:13 PM100% No explanation needed. All the information is there.
jim maida on December 31, 2008 4:20 PMIt is both a boy and a girl until you see it.
Chambered on December 31, 2008 4:21 PMLuke wrote: "Isn't BG and GB the same combo? That means there are only three possible combinations... right?"
This has been explained many, many, many times. BG and GB are listed separately because it's easier to do so and assign a 25% probability to each of them (same as GG and BB). If BG was treated the same as GB, you would have to assign a 50% probability to BG, which is slightly harder to explain. Of course, all of those probabilities are calculated without the constraint that one child is a girl.
Consider two independent coin flips (I don't care whether they are successive or simultaneous). There are 2 x 2 possible outcomes:
HH
HT
TH
TT
When the outcomes are listed that way (with HT and TH being distinct, even if I don't CARE which coin came up heads), then each outcome has an EQUAL probability of occurring. That way I can easily calculate the probability of {HT, TH} (1 H, 1 T, order isn't important) by counting the specified outcomes (2) and dividing by the size of the sample space (4), so the answer is 0.50.
In the same way, I can answer the question, "What's the probability that at least one coin came up heads?". The answer is the size of the solution set {HH, HT, TH} (3), divided by the the size of sample space (4), or 0.75.
Now imagine we apply the faulty logic of combining the HT and TH outcomes and asking the question "What's the probability of getting 1 head and 1 tail?" (Notice I did not put any other constraints in the question, for simplicity's sake). If you do that, then you get:
TT
HH
HT/TH (Incorrect!)
And using the faulty math employed by many here, you would