Technical Interview

Tips, questions, answers and puzzles at
www.technical-interview.com

Friday, February 9, 2007

In a country in which people only want boys, every family continues to

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?

15 comments:

  1. If both having a boy or a girl are equal probable then the ratio should be 1.

    ReplyDelete
  2. Thanks for the post

    ReplyDelete
  3. I think the answer should be 1/2.

    ReplyDelete
  4. Take this scenarios, we have x families. If we assume the having a boy or a girl is equal-probable. Then x/2 families will have boys and x/2 families will have girls. Next time x/4 family will have boys and x/4 family will have girls and so on. At the end, we get (x/2+x/4+x/8+...) boys and (x/2+x/4+x/8+...) girls and the ratio is 1. This is considering we have no twins, triples,....

    ReplyDelete
  5. The ratio is 1 if the family population is an odd value. The ratio is 1 plus 1 boy if the family population is an even value. In fact, in the case of an even family population the last two families will have 1 boy and 1 girl and the family with a boy stops, while the family with a girl makes another baby. This baby will be a boy since that family has already had a girl.

    ReplyDelete
  6. If the chance of having a boy and a girl is not equal....
    Say P(birth is male)=p

    The number of girls had by each family is distributed as a geometric random variable. The expected number of female births before a male birth is then (1-p)/p.

    Thus, for every 1 boy, there are (1-p)/p girls.

    ReplyDelete
  7. We have to compute the number of girls according to the distribution:
    sum(P(having k girls) * k) = sum (k=0 -> infinite, k/2^(k+1)) = 0*1/2 + 1*1/4 + 2*1/8 + 3*1/16 ...
    while the number of boys according to the distribution is 1.
    Computing the mathematical serie for the girls gave me that the average number of girls according to the distribution is 1.
    So there are 50% girls and 50% boys, but the answer is bit tricky to compute in the lands of probabilities.

    ReplyDelete
  8. If we assume certain things [no twins, no fertility issues such as no Y chromosomes, etc.,] the chance of having a boy is always 50% - regardless of the couple's previous track record. That is, couple xy's first, second, third, etc., child has a 50/50 chance of being a boy [and 50 percent chance of being a girl - assume no mutants :)]. So the proportion in this assuming country is 1:1. If there are fertility issues, the ratio skews more in favor of girls because couples that are incapable of having boys will continue manufacturing girls until the cows come home.

    ReplyDelete
  9. Assume that having a girl or a boy is a 50/50 chance.
    let's take 4 families as an example

    1) boy - stop
    2) girl + boy - stop
    2) boy - stop
    4 girl + boy - stop

    Total 4 boys 2 girls.
    Hence the proportion is 2:1

    ReplyDelete
  10. It should be
    No of girls to no of boys =
    No of girls in the village : No of families

    Consider the following sample space:
    Family 1: GB
    Family 2: B
    Family 3: GGGB
    Family 4: GGGGB
    Family 5: GGB
    Family 6: B

    Hence we have 10 girls and 6 boys (no. of families in the village is also 6)

    Important: Question asked is not the probablity of a girl to the probablity of a boy, its instead the proportion of the no. of girls in the village to the no. of boys.

    probablity is chance of an event likely to happen
    proportion is something to do with magnitudes of 2 entities involved..
    and importantly, proportions stands for something which exists... like boys to gals ratio in a class..
    wheras probablity of boys to gals in a class is an invalid question..
    yes it can be made valid by extending it to "probablity of a boy topping the class to a gal"

    ReplyDelete
  11. 10:6 is wrong because the sample space is infinite, and the frequency of certain couples are higher than that of others. Here is an easier solution:
    Let us define E(Babies)= # babies an average family has

    E(Babies)= 1/2*1+ 1/2*(2+1/2(3+1/2(4...))))
    The second parenthesis is like starting over again, but you have to add 1 to the expectation.

    E(Babies)=1/2*1+1/2(E(Babies)+1)
    E(Babies)*1/2=1
    E(Babies)=2

    E(Girls)=E(Babies)-E(Boys)=2-1
    E(Girls):E(Boys)=1:1

    This, I believe, is the how you derive the (1-p)/p (which is correct if boys and girls aren't equally likely)

    ReplyDelete
  12. b=0:1
    gb=1:1
    ggb=2:1
    gggb=3:1
    .
    .
    .
    .
    .so the answer must be X:1

    ReplyDelete
  13. 出逢いという奇跡を起こす真の「出逢い」系サイトの誕生です。友達、割り切り、恋愛…十人十色の目的に対応した真面目系恋人探し専用出逢い掲示板で、あなたの運命の人を探してみませんか?

    ReplyDelete
  14. hey i dont think this one has an answer...its hugely probabilistic. it cant even be (1-p)/p because it is dependant on probability.

    ReplyDelete
  15. Let b= probability of a boy=0.5
    g= probability of a girl=0.5
    b + gb + ggb + gggb + ggggb.....
    =b(1+g+gg+ggg+gggg+.....)
    =b(1/(1-g))
    =b/(1-g)
    =0.5/0.5
    =1

    ReplyDelete