The Children In Puzzletown

OK, time for the simple solution to the puzzletown problem. It was an interesting problem to pose to my officemate, who immediately thought that there would be more boys than girls (every family has at least one boy, after all), but then he realized that since the parents stop as soon as they have one boy, they will never have two boys, but sometimes they will have multiple girls before having a boy. Naturally this led him to conclude that there would be more girls than boys. Lets see what the math gives us.

First, since every family has exactly one boy, we need only ask how many girls a family has on average. We could similarly ask what is the average family size. A family is size 1 with probability 1/2 (they had a boy right away) size 2 with probability 1/4 (girl then boy) size 3 with probability 1/8 (GGB) and size N with probability 1/2N. The average family size is therefore
Σ N/2N

N summed 1 to infinity.
A sum of the form
Σ N/xN+1

Is just
d/dx Σ -1/xN
=d/dx Σ -(1/x)N
=-d/dx 1/x*1/(1-1/x))
=d/dx 1/(1-x)
=1/(1-x)2

(If my sum confused you, remember the sum is running 1 to infinity, not 0 to infinity). So the average family size is
2 Σ N/2N+1
=2

So, an average family has 1 girl and 1 boy. Thus the ratio is 1:1.
When this was posted on the xkcd forums, some people said that this answer is obvious, that since each child has expectation 1:1 value of boy:girl ratio, that no matter what criterion the parents use to decide to stop having children, the ratio will be 1:1, simply by linearity of expectation. This argument is quite correct, and is quite similar to the logic from the card flipping problem some time ago.

Some people on the forums then refuted this method of arriving at an answer by posing the following problem:
Each family will have children until they have had more male children than female children, then they will stop having children. On a given birth, it is equally likely that the child will be a boy or a girl. What is the ratio of boys to girls among the children in puzzletown?

This is a slight difference, as now every family will be guaranteed to have more boys than girls. Since it is true for each family, it must be true for the average of the families. One might ask the question of "what if they keep having children and they never have more boys than girls?" however this is not an issue, random walk theory will guarantee that given enough children, every family will at some point have more boys than girls.

The question here is, in this new problem, what happened to the linearity of expectation argument? Every family will have more boys than girls for certain. Therefore, the town will have more boys than girls, what went wrong?

7 comments:

McAnerbot said...

I'm inclined to believe it is something due to the introduction of paths with fixed absorbing states (the number of girls in a family dictate exactly how many boys there are, but the order in which boy sand girls arrive varies.

Lionel Brits said...

In the original problem, you only get male:female parity because the grand canonical ensemble is infinite. In other words, you have probability 1/2 to have a family of 1 boy child, and probability 1/2 (1/2 + 1/4 ...) otherwise. So here boys eke out girls in any finite-number-of-offspring canonical ensemble, but girls make up for it in bulk.

I wonder if the difference in the second problem similarly goes away in the limit, but this is me just speculating.

McAnerbot said...

Huh. Unless I did something wrong, my analysis says that the expectation of family size is infinite. Which means the ratio between boys and girls, although every family certainly has one additional boy than girl, is still 1:1 assuming that the following is true
lim(n->infinity) (n+1)/2 : (n-1)/2
= n/2 : n/2 = 1:1

So in summary:
Your FACE went wrong Kory.

McAnerbot said...

So this is one of those problems that the answer is only going to satisfy you at all if you are utterly convinced that 0.9999-repeating is exactly equal to 1.

Yay.

Kory Stevens said...

Basically, yeah. I guess there are some people who have a particular problem with that point of mathematics, and would be fine with the solution to this problem, but I doubt there will be many of those.

Really, it is about a correct understanding of limits, so yea, if you don't like 0.9999..., you won't like this.

JonBen said...

So here's something that got me the right answer without having to solve the problem the 'right' way.

The probability of having a girl is
P=sum^{infinity}_{k=1} (1/2)^k = 1

From this it seems clear that every family will have 1 girl (though not all families will have a girl, and not all families will have only one girl... thanks a lot probability theory). And we already forced every family to have exactly one boy so the ratio has to be 1:1.

I like the follow on problem, even if it causes my head to hurt.

Kory Stevens said...

I guess that the expectation value of the number of girls a family will have, the probability the family will have at least one girl is 1/2. Looks like you added the probability of having each girl, times the number of girls that that girls is (which is 1), so you get the average number of girls per family. Its a legitimate way to get the answer.