LET'S TALK TECHNICAL

This blog is intended to help people prepare for the job interviews and improve their analytical skills. We have posted difficult datastructures and algorithm questions and puzzles. Interview experiences section is for the people to post their interview experiences.Views expressed here are of their personal and the blog author doesn't take any responsibility for the same.

-

Followers

Jobs

Thursday, November 22, 2007

Ratio of boys and girls.

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?

Solution:

50:50.

probability of a boy/girl is always 2 irrespective of the number of conditions.

for the above problem we can prove it with simple probability theory.

Lets assume P(b) be the probability of having a boy. P(g) be the probability of having a girl.

Total expectation of a boy is equal to (probability of having a boy at first instance + probability of having a girl then a boy + probability of having 2 girls followd by a boy + etc... )
E(b) = 1/2 + 1/2*1/2 + 1/2*1/2*1/2 + ......
it comes down to 1 ( infinite series sum = a/1-r = 1/2/1-1/2 = 1).

E(g) = 0 + 1/2 + 1/4 + 1/8....
it comes down to 1.

It means there are equal number of girls and boys in the village.

No comments:

Post a Comment

Popular Posts