Friday 1 July 2016

Calculating Expected Offspring

Once again we are back in the beautiful world of probability! This time we are asked to find the expected number of offspring with a dominant phenotype (i.e. having at least one dominant allele), for a given population of couples, in which every couple receives exactly 2 children. The population consists of the following couples:

1. AA-AA
2. AA-Aa
3. AA-aa
4. Aa-Aa
5. Aa-aa
6. aa-aa

The problem mentions the formula for calculating the expected value of a uniform random variable. However, in the case above, the random variable is not uniform since the probability that couple 1 receives a child with a dominant phenotype is not the same as for couple 4, 5 and 6. We must instead take into account the probability of each type of couple when calculating the expected values. The expected values of the couple types can then be multiplied with the amount of couples of each type and finally added together to give the overall expected value for the population. Note that since there is a 0 probability that a couple 6 receives any child with a dominant allele so their expectation vallue also becomes 0 and we can exclude them from the calculations. The following is the code I wrote to perform the calculations. P1-5 are the number of couples in each type, E1-5 is the expected value for the couples (as you can see E6 would have been 2*0).

P1, P2, P3, P4, P5 = 19100, 18788, 17003, 18906, 16994
E1, E2, E3 = 2, 2, 2                                  
E4 = 2 * 0.75                                         
E5 = 2 * 0.5                                          
E = E1 * P1 + E2 * P2 + E3 * P3 + E4 * P4 + E5 * P5   
print(E)                                              

No comments:

Post a Comment