TITLE: Famous puzzle: Girl/Boy proportion problem (Sum of infinite series)
QUESTION [15 upvotes]: Puzzle
In a country in which people only want boys, every family continues to have children until they have a boy. If they have a girl, they have another child. If they have a boy, they stop. What is the proportion of boys to girls in the country?
My solution (not finished)
If we assume that the probability of having a girl is 50%, the set of possible cases are:
Boy (50%)
Girl, Boy (25%)
Girl, Girl, Boy (12.5%)
...
So, if we call G the number of girls that a family had and B the number of boys that a family had, we have:
$B = 1$
$P(G = x) = (1/2)^{x+1}*x$
So
$G = \Sigma (1/2)^{x+1}*x$
I feel like the sum of this infinite serie is 1 and that the proportion of girls/boys in this country will be 50%, but I don't know how to prove it!
Thanks!

REPLY [3 votes]: Google and other interviewing companies made an important assumption — that there are infinitely many families. Under this assumption, we have their clever and simple answer: In expectation, there are as many boys as girls. 
However, it turns out that the answer depends on the number of families there are in the country. If there is a finite number of families, then in expectation, there'll be more boys than girls.
Consider the extreme scenario where there's only one family, then 1/2 the time the fraction of girls is 0 (B in our only family), 1/4 the time it's 1/2 (GB), 1/8 the time it's 2/3 (GGB), 1/16 the time it's 3/4 (GGGB) etc. And so the expected fraction of girls is:
$$\frac{1}{2}\times 0+\frac{1}{4}\times \frac{1}{2}+\frac{1}{8}\times \frac{2}{3}+\frac{1}{16}\times \frac{3}{4}+\dots = 1 - \ln 2 \approx 0.307.$$
If there are 4 families, the expected fraction of girls in the country is about 0.439; and if there are 10, it's about 0.475.
See this Math.Overflow answer for more details.
(By the way, this puzzle also appeared in Thomas Schelling's Micromotives and Macrobehavior, 1978, p. 72.)