Rosalind第66题:Counting Disease Carriers

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值