Google interview question

Google interview question

In a certain country, a family continues to have children until they get a boy.  When they get a boy, they have to stop having children.   Otherwise, they keep going.  Assuming there is always a 50/50 chance of a boy/girl when having any one kid and nobody stops ‘early’ – what’s the ratio of males to females in such a society?

Answer(spoilers):
At first your gut tells you there needs to be more females than males – after all, there’s going to be families out there with 2,3,4,5 or even more girls.  Yet only 1 boy.  However, if you start thinking about it this way, a shocking revelation comes:

A families first birth:
1/2 = boys -> they stop here, no girls at ALL in 1/2 the households
1/2 = girls -> they go on….

2nd birth for those families with one girl:
1/2 = boys -> they stop with 1 girl, and 1 boy
1/2 = girls -> they go on….

so now it becomes a sum of:
boys = 1/2 + (1/2)*(1/2)+ (1/2)*(1/2)*(1/2) + (1/2)*(1/2)*(1/2)….
girls = 1/2 + (1/2)*(1/2) + (1/2)*(1/2)*(1/2) + (1/2)*(1/2)*(1/2)…

Whaaaa?? – its the SAME.  Yep – the count of the number of boys and girls will be the same.  See, we forget that 1/2 of the families will have NO girls at all – and that’s a big smack to the overall number of girls.  Sure, there may be families with 2,3,4 or more girls, but always one boy – and that combined with the fact half the population’s families will only have a single boys child equals out.  Crazy but true.

Leave a Reply

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