Google Interview questions:
In a country with a preference for boys, every family wants to have a boy, and if the child is a girl, regenerate one, until the boy is born, so the proportion of men and women in such a country will be much.
Answer: 1:1
Analysis:
The probability of birth is 50%, so the sex ratio is the same for each birth.
Topic of Ali:
A country is very patriarchal, if a family gave birth to a girl, then another, until the birth of a boy, assuming that the probability of male and female students equal, I would like to ask the average number of girls per family.
And Google's problem is actually the same.
If there are n couples in this country, then n couples will give birth to n boys, these n boys are born in this way, assuming that the probability of the birth of a boy is 50%, then n/2 a boy is the first child, and there will be n/2 a girl born, n/2 couples will continue to live, of which n/4 couples born boys, n /4 of couples continue to give birth to girls, then N/8 couples get boys, and n/8 couples give birth to girls, and so on, this country will give birth to N/2 + N/4 + N/8 + ... Girls, so the ratio of male to female is N: (n/2 + N/4 + n/8 + ...) = N:n = 1:1
The process is the same, the probability of birth of both boys and girls is 50%, so the ratio of each birth is the same.
Original address: http://www.java2000.net/p11054