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$


$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!


  • 9
    $\begingroup$ In this example, you don't need to sum the infinite series. For each birth, the probability of a boy is 50% and the probability of a girl is 50% (for the purposes of this exercise; the real world is more complicated). Therefore, the ratio for all births must be 50:50. The number of previous births in each family, and the genders of those children, is irrelevant. $\endgroup$
    – Mike Scott
    Commented Feb 4, 2011 at 17:28
  • 8
    $\begingroup$ There is a thorough discussion of this question at mathoverflow.net/questions/17960/… for anyone who's interested. $\endgroup$ Commented Feb 4, 2011 at 17:29
  • 1
    $\begingroup$ As the MathOverflow discussion Qiaochu linked to points out, your approach will get the approximately right answer but for the wrong reasons. The expected ratio of boys to girls is not necessarily equal to ratio of the expected number of boys to the expected number of girls. $\endgroup$
    – user856
    Commented Feb 4, 2011 at 23:21
  • $\begingroup$ thebigquestions.com/2010/12/22/a-big-answer-2 why is this not the answer? $\endgroup$
    – KevinDTimm
    Commented Oct 7, 2014 at 21:03
  • $\begingroup$ @MikeScott Why does then ratio is not 1 when family is finite? $\endgroup$
    – Suraj Jain
    Commented Jul 29, 2018 at 5:45

7 Answers 7


This is a trick question!

This question is very simple if you just learn to accept that most of the information given is completely irrelevant...

It doesnt matter how many families continue to have children and how many stop at 1 or 2...its no more relevant than what car they drive...

None of the information provided alters the statistical probability of a child born being male or female...its still 50%


Mike Scott is correct that you don't need to sum the series, but suppose you want to. Each family has 1 boy-that is easy. Each family has 50% chance of no girls, 25% chance of 1, etc. So the average number of girls is $$\sum_{i=0}^\infty \frac{i}{2^{i+1}}$$ The way to sum this is to remember that $$\sum_{i=0}^\infty a^{-i} = \frac{1}{1-1/a}=\frac a{a-1}$$ Now if you take the derivative with respect to $a$: \begin{align} \frac{d}{da}\sum_{i=0}^\infty a^{-i} &= \frac d{da}\frac a{a-1} \\ \sum_{i=0}^\infty{-i}a^{-(i+1)} &= \frac {a-1-a}{(a-1)^2} = \frac{-1}{(a-1)^2} \\ \sum_{i=0}^\infty \frac{i}{a^{i+1}} &= \frac{1}{(a-1)^2} \end{align} For $a=2$, $$\sum_{i=0}^{\infty}\frac{i}{2^{i+1}}=1$$ So there is an average of one girl per family as well.

  • $\begingroup$ You've got an even number of sign mistakes that cancel each other out. The derivative is going to have a negative sign for each term because the exponent is negative. Same for the derivative of the sum, it's clearly a descending function so the derivative should be negative. I think your answer would benefit from showing more steps of the calculation, in particular how the derivative relates to the first expression. That would also have made this mistake more obvious. $\endgroup$
    – Dici
    Commented Nov 24, 2018 at 19:39

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.)

  • $\begingroup$ I understand your expression for 1 family. How did you get the expression for 2 or more families? I saw the post from mathoverflow.net/questions/17960/… but I don't quite get where the formula came from $\endgroup$ Commented Apr 15, 2020 at 19:48

If the probability is 50% then we can expect from four families to typically have:

B B, B G, G B, G G

However because families stop when they have a boy, we do not gain the boy from the first row or the girl from the second row: B B, B G,

Therefore we actually get three girls and three boys.

From 8 families we would expect:

B B B, B B G, B G B, G B B, B G G, G B G, G G B, G G G

and we would actually keep: B, B, B, GB, B, GB, GGB, GGG,

for a total of 7 G and 7 B.

I expect proportion to remain 50% for each expected outcome from larger numbers of families but haven't proved anything as such. This is a lot simpler though and doesn't require summation notation or any advanced maths.


When I first heard this puzzle (not here), I was convinced that you would end up with more girls. My intuition was of course wrong. I love the proof that this is not the case, but for those that enjoy a demonstration to enhance the intuition, this is some python code I wrote to convince myself that this is indeed the case.

import random

class family():
    boys  = 0
    girls = 0

    def haveKids(self):
        while not self.boys:
            if random.randint(0, 1):
                self.boys += 1
                self.girls += 1

population = [family() for f in range(1000000)]

map(lambda f: f.haveKids(), population)
boys = sum(map(lambda f: f.boys, population))
girls = sum(map(lambda f: f.girls, population))

print "boys:", boys, "girls:", girls
print "difference:", abs(boys - girls)
print "percentage difference: %" + str(abs(float(boys - girls)/(boys + girls)))

This simulates a population of 1 million families. The difference between the number of girls and boys is indeed nominal. The percentage difference is typically around 0.001% for 1,000,000 families.


The ratio is 1:1. Your summing of an infinite series provides the result of the chance that there is a boy in the family (theoretically 1 because births are repeated infinitely until a boy is born); as you approach 1 in your answer to this, you approach zero in the chance that there are no girls in the family. This is all this sum actually tells us about the families.


Let's model the births as "rounds" of childbirthing. All families have their first child on round 1, their second (if applicable) on round 2, etc.

With 10 families, the first children had may be:

$$B, G, G, B, B, G, B, B, B, G$$

And will be around 50% boys and 50% girls.

Now, let's look at the second round of births. Of course, only the families who did not have a boy will have a second child.

$$ \begin{align*} \text{First round: }& \hspace{10pt} B, G, G, B, B, G, B, B, B, G \\ \text{Second round: }& \hspace{20pt} B, G, \hspace{20pt} B, \hspace{30pt} G \end{align*} $$

Note that in the second round, again, 50% of the births are girls and 50% are boys. Since this will continue for each round, 50% of births being boys and 50% being girls (on average), the grand total will also be 50-50.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .