# Conditional expectation and partitioning

1. Jan 19, 2010

### Kate2010

1. The problem statement, all variables and given/known data
I'm told that of n couples, each of whom have at least one child, with couples procreating independently and no limits on family size, births single and independent, and for the ith couple the probability of a boy is p_i and of a girl is q_i with p_i + q_i = 1.

1. Show the expected family size if the ith couple stop when have had both sexes is 1/(p_iq_i) - 1.

2. If all n couples stop when have children of both sexes, what is the expected number of girls.

2. Relevant equations

E(X) = Sum(i=1..n) E(X|A_i) P(A_i)
E(X|A) = Sum(over x) xP(X=x|A)

3. The attempt at a solution

So for 1 I've got:
Let X be the number of births until a girl and boy
A1 = boy born 1st
A2 = girl born 1st
E(X) = E(X|A_1)P(A_1) + E(X|A_2)P(A_2) = (p_i/q_i) + (q_i/p_i) = 1/(p_iq_i) -2
Do I add 1 as I'm considering 2 births not 1?

For 2:
I'm not too sure how to go about this at all, I can use the second formula with X being the number of girls and A being that both sexes are born, but how do I know P(X=x|A)?

Earlier in the question I calculated the expected family size if the family stopped after a boy or a girl.

Thanks.

2. Jan 19, 2010

### tiny-tim

Hi Kate2010!
hmm … start again …

(with these problems, it's just a question of how to count …)

what's the probability that the first n-1 births are the same sex, and the nth birth is different?

3. Jan 19, 2010

### Kate2010

Would this be (p_i ^(n-1))q_i + (q_i ^(n-1))p_i ?

4. Jan 19, 2010

### tiny-tim

(have a sigma: ∑ and try using the X2 and X2 tags just above the Reply box )

Yup!

So the expected family size is … ?

5. Jan 19, 2010

### Kate2010

I still dont know where to go from here. Do I use E(X) = ∑ xP(X=x)?

6. Jan 19, 2010

### tiny-tim

Yes.

7. Jan 19, 2010

### Kate2010

π²³ ∞ ° → ~ µ ρ σ Ω √ ∫ ≤ ≥ ± ∃ … · θ φ ψ ω Ω α β γ δ ∂ ∆ ∇ ε λ Λ Γ ô

E(X) = ∑ n (pin-1qi + qin-1pi)?

If this is correct, which I'm really not sure about, how do I do it?

8. Jan 19, 2010

### tiny-tim

The left-hand part is qi times ∑ npin-1

how can you calculate that ∑ ?

9. Jan 19, 2010

### Kate2010

Would I do it as a geometris series which then differentiates to 1/(1-pi)2?

So it would be altogether qi/(1-pi)2 + pi/(1-qi)2 , but this equals 1?

10. Jan 19, 2010

### tiny-tim

(i'm going out for the evening now, so this is my last post for some hours)

I haven't checked it properly, but did you take care to start your ∑ pn from the right point (ie does it start at n = 0, n = 1, or n = 2) ?

11. Jan 20, 2010

### Kate2010

I'm sorry I'm still struggling with this question.
I have qi∑ npin-1 + pi∑ nqin-1
These are geometric sums so can I use the formula ∑ (to infinity) xn = 1/(1-x) so ∑ (to infinity) nxn-1 = d/dx(1/(1-x)) = 1/(1-x)2 . However, I'm confused about what I'm summing from and 2. Am I summing from n=2 to infinity?

12. Jan 20, 2010

### tiny-tim

oh no, this is long and complicated and i don't want to have to write it all out myself …

you write it all out, including the ∫s and the ∑n=?s and i'll check it

13. Jan 20, 2010

### Kate2010

I want qi∑$$^{n=infinity}_{2}$$ npin-1 + pi∑$$^{n=infinity}_{2}$$ nqin-1

∑$$^{infinity}$$ xn= 1/(1-x) so ∑$$^{infinity}$$ nxn-1[/SUP = 1/(1-x)2

So qi∑$$^{infinity}_{n=1}$$ npin-1 + pi∑$$^{infinity}_{n=1}$$ nqin-1 = qi/(1-pi)2 + pi/(1-qi)2 = 1/qi + 1/pi = 1/piqi

I now need to subtract the sum to 1 of each, i.e. qi∑$$^{n=1}_{1}$$ npin-1 + pi∑$$^{n=1}_{1}$$ nqin-1 = 1+1 = 2

So I get 1/piqi -2, but I wanted 1/piqi -1.

I've only done discrete random variable so far and have not used $$\int$$ in probability.

Last edited: Jan 20, 2010
14. Jan 20, 2010

### Kate2010

The third line down the sums should be the other way around but I can't make it format properly.

15. Jan 20, 2010

### tiny-tim

(have an infinity: ∞ )
No, pi0 = qi0 = 1, so it's qi + pi = 1.

(and no need to say "the sum to 1", just say "the first term" !)

16. Jan 20, 2010

### Kate2010

Thank you so much!

For question 2:
If all n couples stop when have children of both sexes, what is the expected number of girls.

Do I use the forumula E(X|A) = $$\sum$$$$_{x}$$ xP(X=x) where X = number of girls and A = both sexes?

If so, I'm not sure how to calculate P(X=x), is it just 1/2? And would I sum from 2 to n (I'm considering n couples)?

17. Jan 20, 2010

### tiny-tim

Each family is independent, so just add the expectation for each family, i = 1 to n.

Use a similar method as before … if the last birth is a girl, the number is 1, if it's a boy, the number is … ?

18. Jan 20, 2010

### Kate2010

Is P(X=x|A) always 1 as if there have been both sexes born there will always be a girl? Then it would just be $$\sum$$x? But I don't know what to sum between.

19. Jan 20, 2010

### tiny-tim

I'm confused … where does A come into it?

Just use E(X) = ∑x xP(X=x)

20. Jan 20, 2010

### Kate2010

I thought I should use conditional expectation.

If I use E(X) = ∑x xP(X=x) with X being the being the number of girls, do I do ∑$$^{n}_{x=1}$$ xqi?

This would be qin(n+1)/2?