Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Then I just worked with E[N_n|F_1]. So we can write $$ E[N_i|F_1] = 1 + \sum_{j = \{i+1, i, i-1\}} p_{ij}|F_1 E[N_j|F_1] $$ $p_{ij}$ is the transition probability from state $i$ to $j$ and we are conditioning this on $F_1$
By weighted, do you mean conditioned on the chance $c$ will be the final color? I arrived at the same equation, but it look me like a lot of work :(. I basically did $$ E[N_n] = \sum_{i=1}^{n} E[N_n|F_i]P(F_i) $$ where $F_i$ is the event that all balls will end up the $i-th$ color and $N_n$ is the number of steps needed to make all balls the same color. Thus we have $$ E[N_n] = E[N_n|F_1] = \cdots = E[N_n|F_n] $$
@DouglasZare I enumerated out a bunch of terms and it seems to simplify to what you have. For example, I enumerated the probability of family 1 having 1 girl and the probability of family 2 have 1,2,3,4, etc... girls and finding the joint probability and the values (proportion of girls) among the 2 families, and then did it for family 1 having 2 girls, and so on. Is that what you did, or did were you able to come up with that formula by inspection? If it's the latter, could you go into some of your thought process on how you got that formula quickly?
@DouglasZare Could you please explain where you got the expression from for 2 families? I understand the expression for 1 family, which is simply just the formula for expected proportion of girls for a family.