Problem
To model the Hardy-Weinberg principle, assume that we have a population of diploid individuals. If an allele is in genetic equilibrium, then because mating is random, we may view the chromosomes as receiving their alleles uniformly. In other words, if there are dominant alleles, then the probability of a selected chromosome exhibiting the dominant allele is simply .
Because the first assumption of genetic equilibrium states that the population is so large as to be ignored, we will assume that is infinite, so that we only need to concern ourselves with the value of .
Given: An array for which represents the proportion of homozygous recessive individuals for the -th Mendelian factor in a diploid population. Assume that the population is in genetic equilibrium for all factors.
Return: An array having the same length as in which represents the probability that a randomly selected individual carries at least one copy of the recessive allele for the -th factor.
为了模拟Hardy-Weinberg原理,假设我们有 二倍体个体。如果等位基因处于遗传平衡中,则由于交配是随机的,我们可能会看到染色体均匀地接受等位基因。换句话说,如果有 显性等位基因,则选定染色体显示显性等位基因的概率很简单。
因为遗传平衡的第一个假设指出种群太大而被忽略,所以我们假设 是无限的,所以我们只需要关心自己的价值 。
鉴于:一个数组 为此 代表纯合隐性 个体在二倍体种群中的第一个孟德尔因子。假设所有因素的种群均处于遗传平衡中。
返回:数组 与...长度相同 在其中 表示概率 ,一个随机选择的个体携带的至少一个拷贝的隐性等位基因的-th因素。
Sample Dataset
0.1 0.25 0.5
Sample Output
0.532 0.75 0.914