Here is another interesting problem I was trying to address a while ago:

*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 expected proportion of boys to girls in the country?*

Apparently, this problem was originally posted by Google, as this post suggests. Here is a link to another stream, trying to tackle the problem. I will try to provide a solution that (in my opinion, of course) looks easier to comprehend.

At any given moment of time, the total number of couples (with children) can be divided into two categories *C _{Total} = C_{1boy} + C_{no boys}*, where

*C*- number of couples with

_{1boy}*1*boy (this is actually the limit, as it is stated in the problem) and

*C*- number of couples having only girls (and thus, still trying to have a boy). We don't count the couples with no children as they don't add any value to the calculations below.

_{no boys}The number of boys in this case (or at any given moment of time) is *N _{b}= C_{1boy}*.

The number of girls is *N _{g}=N_{1}⋅C_{1boy} + N_{2}⋅C_{no boys}*, where

*N*- average number of girls in a family with

_{1}*1*boy and

*N*- average number of girls in a family with no boys. Let's find these averages.

_{2}The probability for a family with one boy to have *1* girl is *P(1 girl & 1 boy) = (1 ⁄ 2)⋅(1 ⁄ 2)*

The probability for a family with one boy to have *2* girls is *P(2 girls & 1 boy) = (1 ⁄ 2)⋅(1 ⁄ 2)⋅(1 ⁄ 2)*

...

The probability for a family with one boy to have *n* girls is *P(n girls & 1 boy) = 1 ⁄ 2 ^{n+1}*

So, the average number of girls in a family with *1* boy is (find the formula for this series here) *N _{1}=E(X) = ∑m⋅P(m) = ∑m ⁄ 2^{m+1} = (1 ⁄ 2)⋅∑m ⁄ 2^{m}= (1 ⁄ 2) ⋅ (1 ⁄ 2) ⁄ (1 - 1 ⁄ 2)^{2} = 1*.

Now...

The probability for a family with no boys to have *1* girl is *P(1 girl) = 1 ⁄ 2*

The probability for a family with no boys to have *2* girls is *P(2 girls) = (1 ⁄ 2)⋅(1 ⁄ 2)*

...

The probability for a family with no boys to have *n* girls is *P(n girls) = 1 ⁄ 2 ^{n}*

The average number of girls in a family with no boys is *N _{2}=E(Y) = ∑k⋅P(k) = ∑k ⁄ 2^{k} = 2*.

As a result *N _{b} ⁄ N_{g}= C_{1boy} ⁄ (C_{1boy} + 2⋅C_{no boys})*. This expression is equal to

*1*only when

*C*, i.e. when all the families reach the target. However, if

_{no boys}=0*C*then

_{no boys}= C_{1boy}*N*.

_{b}⁄ N_{g}=1 ⁄ 3