Boys and Girls

Question:

In a country where everyone wants a boy, each family continues having babies till they have a boy. After some time, what is the proportion of boys to girls in the country? (Assuming probability of having a boy or a girl is the same)

boys girls google interview puzzle

Answer:

“very simple”. Half the couples have boys first, and stop. The rest have a girl. Of those, half have a boy second, and so on.
So suppose there are N couples. There will be N boys.

1/2 have a boy and stop: 0 girls
1/4 have a girl, then a boy: N/4 girls
1/8 have 2 girls, then a boy: 2*N/8 girls
1/16 have 3 girls, then a boy: 3*N/16 girls
1/32 have 4 girls, then a boy: 4*N/32 girls

Total: N boys and
1N    2N    3N    4N
–  +  –  +  –  +  — +… = ~N

Therefore, the proportion of boys to girls will be pretty close to 1:1

5 Thoughts on “Boys and Girls

  1. Mohd Ayyoob on February 9, 2014 at 3:43 am said:

    plz clarify it litl bit more…

  2. Lets consider number of couple are 1000…
    at first half couple have boys means half couple have girls..
    G=1000/2(Continues…), B=1000/2(Stops…)
    at second half couple have boys means half couple have girls..
    G=1000/2 + 500/2(Continues…) B=1000/2+500/2(Stops..)
    and so on…
    at the end ratio of boys to girls is 1:1…

  3. Why are we assuming that at the first iteration, 0 girls would be produced? Isn’t it possible for 50% to be boys and 50% girls at the first step?

  4. what if no couple got a boy 1st?

  5. Does anyone second this logic??

    Let n be the number of girls a family has, on average, before having a boy. Then, on average,
    each family will have n girls and 1 boy –> The ratio of the country will be 1:n.

    Family has a baby and there are two possible outcomes: 1) boy, 2) girl.

    n is equal to the number of girls that they are likely to have in each case, divided by two (since each case will happen 1/2 of the time).

    In the first case, the family has a boy and a likelihood of 0 of having more girls. In the second case, the family has a girl and a likelihood of n of having more girls. Therefore, in the second case we have n + 1 girls.

    Therefore,
    n = 1/2*(0) + 1/2*(1 + n)
    –> n = (1+n)/2
    –> 2n = 1+n
    –> n = 1

    Over time the country will have 1:n = 1:1 ratio of boys to girls.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Post Navigation