Coffeehouse Thread
16 postsForum Read Only
This forum has been made read only by the site admins. No new threads or comments can be added.
100%

http://www.codinghorror.com/blog/archives/001203.html
"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?"
I don't quite understand how there can be 2500 comments (he made another post about answering the question and came up with the wrong result) arguing about this when the answer is presented in the 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?"
So only one of two is a girl. So the other must be a boy then. Though what if the boy had a sex change operation? I can't be bothered to think about the odds of that. Another possibility could be that there was some kind of mutation that resulted in neither I suppose. 
Yeah, but if the statement meant "only one of them is a girl", the question is not interesting. What do you think the answer is if we assume the question means "at least one is a girl, I'm not telling about the other"?

It's 50%.
The sex of the second child is not affected at all by the sex of the first child; knowing that one of the children is a girl is irrelevant in detemining the sex of the other.
Trust me, I'm a Doctor (of biology)
Herbie 
I agree... the selection process has no memory. It doesn't remember the sex of the first element when choosing the second. This is like throwing a coin. Each throw is independent, since the coin has no memory. It is not like opening two doors where behind one is a prize. In that case after opening the first one, the second one will hold the prize because there's "memory" involved.Dr Herbie said:It's 50%.
The sex of the second child is not affected at all by the sex of the first child; knowing that one of the children is a girl is irrelevant in detemining the sex of the other.
Trust me, I'm a Doctor (of biology)
Herbie
You could easily transform this given problem into the coin scenario. But you can't into a door problem because the mother can't say: OK first one was a boy/girl therefore the second one is of the opposite sex
Also, Mr. Biologist, the odds are not 5050. There are slightly more girls on this world 
It depends on how you interpret the question.Dr Herbie said:It's 50%.
The sex of the second child is not affected at all by the sex of the first child; knowing that one of the children is a girl is irrelevant in detemining the sex of the other.
Trust me, I'm a Doctor (of biology)
Herbie
If you interpret the question as: my first child is a girl. Now my wife is pregnant, what are the odds of the other one being a boy? Then it's 50%.
However, if you interpret it as: we already have two children, one of whom is a girl. How likely is it that the other is a boy? Then we must consider the following: the likelyhood of having two boys is 50% * 50% = 25%. The likelyhood of having two girls is also 50% * 50% = 25%. The likelyhood of having a boy and a girl is 50% * 50% + 50% * 50% = 50%.
With the added information that one child is a girl, we know that two boys are impossible. We are therefore left with either boy and girl at 66% or two girls at 33%. So in 66% of the remaining scenarios, the second child is a boy.
The disagreement people are having is one of semantics, not maths. 
Here's experimental validation of the second interpretation:Sven Groot said:Dr Herbie said:*snip*
If you interpret the question as: my first child is a girl. Now my wife is pregnant, what are the odds of the other one being a boy? Then it's 50%.
However, if you interpret it as: we already have two children, one of whom is a girl. How likely is it that the other is a boy? Then we must consider the following: the likelyhood of having two boys is 50% * 50% = 25%. The likelyhood of having two girls is also 50% * 50% = 25%. The likelyhood of having a boy and a girl is 50% * 50% + 50% * 50% = 50%.
With the added information that one child is a girl, we know that two boys are impossible. We are therefore left with either boy and girl at 66% or two girls at 33%. So in 66% of the remaining scenarios, the second child is a boy.
The disagreement people are having is one of semantics, not maths.
const int runs = 10000000;
Random rnd = new Random();
int[] children = new int[2];
int twoGirls = 0;
int boyGirl = 0;
for( int x = 0; x < runs; ++x )
{
// 1 = boy, 2 = girl
children[0] = rnd.Next(1, 3); // 1 or 2
children[1] = rnd.Next(1, 3);
// We're ignoring the two boy situation.
if( !(children[0] == 1 && children[1] == 1) )
{
if( children[0] == 2 && children[1] == 2 )
twoGirls++;
else
boyGirl++;
}
}
Console.WriteLine("Two girls: {0}%", twoGirls / (float)(twoGirls + boyGirl) * 100);
Console.WriteLine("Boy/girl: {0}%", boyGirl / (float)(twoGirls + boyGirl) * 100);
That prints:
Two girls: 33,3692%
Boy/girl: 66,6308%
Or numbers close to that (obviously it won't be exactly the same every time). 
Makes sense. But, next time, you need better math notations </joking>Sven Groot said:Dr Herbie said:*snip*
If you interpret the question as: my first child is a girl. Now my wife is pregnant, what are the odds of the other one being a boy? Then it's 50%.
However, if you interpret it as: we already have two children, one of whom is a girl. How likely is it that the other is a boy? Then we must consider the following: the likelyhood of having two boys is 50% * 50% = 25%. The likelyhood of having two girls is also 50% * 50% = 25%. The likelyhood of having a boy and a girl is 50% * 50% + 50% * 50% = 50%.
With the added information that one child is a girl, we know that two boys are impossible. We are therefore left with either boy and girl at 66% or two girls at 33%. So in 66% of the remaining scenarios, the second child is a boy.
The disagreement people are having is one of semantics, not maths. 
If we leave the question of math and biology out of it, we can view it linguistically.
Various theories in pragmatics, a branch of linguistics, have a theory of effective communication that started with Grice's conversational maxims, a set of observations about how people communicate. These are not laws on how to speak, but rather observations on how people communicate. From these maxims, you can posit that people will usually say the most they can to describe their point, but no more. The result of this supposition is that people usually assume that the conversation has followed these Gricean patterns.For example, let's say I describe an actor as an Oscar nominee. This is %100 true even if that actor actually won the Oscar, but our Gricean assumptions say that if he had won, he would have been described as an Oscar winner not a nominee.
How is all this blather relevant, then? If someone says that they have two children, and one of them is a girl, we assume that they mean that only one of them is a girl, even though the sentence would be %100 true if they had two girls  just because people don't speak in a rational, logical manner  they speak in patterns that evolved to maximize information delivery while minimizing cognitive processing complexity. 
Dr Herbie said:It's 50%.
The sex of the second child is not affected at all by the sex of the first child; knowing that one of the children is a girl is irrelevant in detemining the sex of the other.
Trust me, I'm a Doctor (of biology)
Herbie
Dr Herbie said:...The sex of the second child is not affected at all by the sex of the first child...
Well, unless they are monozygotic twins, then the sex of the second is determined by the sex of the first and the probability of the second being a girl is, for all practical purposes, 100%

True, but we were to perform the math based entirely on the information at hand. The odds of identical twins, one kid being horribly mutated so as to fit as a "both" or a "neither", etc etc. are so incredibly small it's unlikely to affect a percentage when displayed as ("###"), which is how we've been displaying it.jonathansampson said:Dr Herbie said:*snip*
Well, unless they are monozygotic twins, then the sex of the second is determined by the sex of the first and the probability of the second being a girl is, for all practical purposes, 100%

Hey, do you know how I hate the fact of having to think bout this whenever I'm 'communicating'? I'm all the logic type of a person for me it'd be the 66% thing, then if I recall that stuff again I have to reconsider. That's all fine and all, but what bothers me is, I know wether if someone meant something the way they said it, or not, but they just say something without thinking about it, that's so confusing when youYggdrasil said:If we leave the question of math and biology out of it, we can view it linguistically.Various theories in pragmatics, a branch of linguistics, have a theory of effective communication that started with Grice's conversational maxims, a set of observations about how people communicate. These are not laws on how to speak, but rather observations on how people communicate. From these maxims, you can posit that people will usually say the most they can to describe their point, but no more. The result of this supposition is that people usually assume that the conversation has followed these Gricean patterns.For example, let's say I describe an actor as an Oscar nominee. This is %100 true even if that actor actually won the Oscar, but our Gricean assumptions say that if he had won, he would have been described as an Oscar winner not a nominee.
How is all this blather relevant, then? If someone says that they have two children, and one of them is a girl, we assume that they mean that only one of them is a girl, even though the sentence would be %100 true if they had two girls  just because people don't speak in a rational, logical manner  they speak in patterns that evolved to maximize information delivery while minimizing cognitive processing complexity.canhave to read peoples minds... people only heavily think about what they say when they're lying or confused...
It just sucks, that when I'm talking to people they do just assume the stuff according to the communication rule, not considering the fact that other possibilities are there, even though their probability being less and that really bothers me.
Would there be a logically or programmatical way of solving such things in the full complexity? Sven's code would just stochastically calculate the probability from random values... that'd be interesting 
The sex of the second child is not affected at all by the sex of the first child;Dr Herbie said:It's 50%.
The sex of the second child is not affected at all by the sex of the first child; knowing that one of the children is a girl is irrelevant in detemining the sex of the other.
Trust me, I'm a Doctor (of biology)
Herbie
Ah, but a woman's body isn't a coin flip
I have read about the result of a study that shows likely hood of homosexuality in 2nd born boy is much higher than 1st born boy. And it doesn't matter that the 2nd born boy is #2, #3, or not...
The hypothesis is that, as a species, we don't want too many alpha males. I don't know the mechanism in humans that flips XX & XY... but to expand (w/out personal merit) the study, can we say that if the couple already has a boy, then the chance of the next child being a girl is > 50%?

Dodo said:Yggdrasil said:*snip*
canhave to read peoples minds... people only heavily think about what they say when they're lying or confused...
It just sucks, that when I'm talking to people they do just assume the stuff according to the communication rule, not considering the fact that other possibilities are there, even though their probability being less and that really bothers me.
Would there be a logically or programmatical way of solving such things in the full complexity? Sven's code would just stochastically calculate the probability from random values... that'd be interestingDodo said:It just sucks, that when I'm talking to people they do just assume the stuff according to the communication rule, not considering the fact that other possibilities are there, even though their probability being less and that really bothers me.
There are languages, artificial languages, that were developed in order to be clear and unambiguous. Why are they not in common usage? Because they appeal mostly to that small subset of humanity whose minds work in a more logical and less associative fashion. You can find quite a few of those dealing with computers, not surprisingly. I've had conversations with people here on C9 itself that had a hard time acknowledging the lack of consistent parseability inherent in human communication.Myself, as someone who deals with words as much as with code, I enjoy the amorphous, ambiguous ambivalence of language. You just gotta remember that it's not based on irrationality, it's just that the ambiguity is an acceptable sideeffect of the language development process.
Sven Groot said:It depends on how you interpret the question.Dr Herbie said:*snip*
If you interpret the question as: my first child is a girl. Now my wife is pregnant, what are the odds of the other one being a boy? Then it's 50%.
However, if you interpret it as: we already have two children, one of whom is a girl. How likely is it that the other is a boy? Then we must consider the following: the likelyhood of having two boys is 50% * 50% = 25%. The likelyhood of having two girls is also 50% * 50% = 25%. The likelyhood of having a boy and a girl is 50% * 50% + 50% * 50% = 50%.
With the added information that one child is a girl, we know that two boys are impossible. We are therefore left with either boy and girl at 66% or two girls at 33%. So in 66% of the remaining scenarios, the second child is a boy.
The disagreement people are having is one of semantics, not maths.
Sven Groot said:With the added information that one child is a girl, we know that two boys are impossible. We are therefore left with either boy and girl at 66% or two girls at 33%. So in 66% of the remaining scenarios, the second child is a boy.
Ooh, nice one!
I get it now; I think my biology was getting in the way of the logic. Good thing my PhD wasn't in maths.
Herbie
Was your Ph.D. in awesomeness? Because you are awesome. Don't assume sarcasm! This a random complement.Dr Herbie said:Sven Groot said:*snip*
Ooh, nice one!
I get it now; I think my biology was getting in the way of the logic. Good thing my PhD wasn't in maths.
Herbie
Thank you for your compliment, I shall keep it in a jar on the shelf where I can see it.Bass said:Was your Ph.D. in awesomeness? Because you are awesome. Don't assume sarcasm! This a random complement.Dr Herbie said:*snip*
And you avatar is pretty cool (that's a compliment response compliment, but still a 100% compliment).
Herbie
Conversation locked
This conversation has been locked by the site admins. No new comments can be made.