E denote the expected no of children they have until they seen at least one boy and one girl .
E1 denote the expected no of child until they seen at least one girl.
E2 denote the expected no of child until they seen at least one boy.
now we can write E as,
E =1/4(E1+2) +1/4(E2+2)+¼ *2 +¼ *2
now lets understand the equation,
1/4(E1+2) → this implies we have seen two Boys(BB) now if we get one girl we met the requirement. we have to calculate E1 though. we add 2 with E1 because we have already seen two child now whatever be the expected value E1 we have to add the first two child with it.
1/4(E2+2) → this is same explanation as the above one just we have already seen two girl now we just need to see at least one boy.
By symmetry E1 and E2 are same .
now ¼ *2 → we have got one girl and one boy . Expected no of child for this scenario =2. we do this twi times because we have two cases ( BG or GB).
now calculate E1.
now E1 mean expected no of children until we get at least one girl.
E1= ½ *1 +1/2(E1+1)
E1=2
similarly for E2 =2.
now substituting this values in E,
E= 1/4(2+2)+1/4(2+2)+1
E=3
so expected value is 3.