Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Statistics 计算这些概率的公式是什么?_Statistics_Probability - Fatal编程技术网

Statistics 计算这些概率的公式是什么?

Statistics 计算这些概率的公式是什么?,statistics,probability,Statistics,Probability,从袋子中随机选择红色大理石的概率为0.6。从袋子中随机抽取6个弹珠样本(样本具有适当的二项分布。) 这些弹珠中有四个是红色的概率是多少 这些大理石中有两个或两个以下为红色的概率是多少?概率取决于: 因此,要使用python从头计算6个红色大理石中的4个的概率,它将是: n = 6 k = 4 p = 0.6 import scipy.special # the two give the same results scipy.special.binom(n, k)*(p**k)*((1-p)

从袋子中随机选择红色大理石的概率为0.6。从袋子中随机抽取6个弹珠样本(样本具有适当的二项分布。)

这些弹珠中有四个是红色的概率是多少


这些大理石中有两个或两个以下为红色的概率是多少?

概率取决于:

因此,要使用python从头计算6个红色大理石中的4个的概率,它将是:

n = 6
k = 4
p = 0.6

import scipy.special
# the two give the same results 
scipy.special.binom(n, k)*(p**k)*((1-p)**(n-k))

0.31104000000000004
我们可以使用scipy的二项分布:

from scipy.stats import binom
binom.pmf(4,6,0.6)

0.31104
对于两个或更少的红色弹珠,基本上是0,1,2的概率

sum(binom.pmf([0,1,2],6,0.6))
0.17920000000000008
或者您可以使用cdf:

binom.cdf(2,6,0.6)

概率取决于:

因此,要使用python从头计算6个红色大理石中的4个的概率,它将是:

n = 6
k = 4
p = 0.6

import scipy.special
# the two give the same results 
scipy.special.binom(n, k)*(p**k)*((1-p)**(n-k))

0.31104000000000004
我们可以使用scipy的二项分布:

from scipy.stats import binom
binom.pmf(4,6,0.6)

0.31104
对于两个或更少的红色弹珠,基本上是0,1,2的概率

sum(binom.pmf([0,1,2],6,0.6))
0.17920000000000008
或者您可以使用cdf:

binom.cdf(2,6,0.6)

我投票结束这个问题,因为它应该在stats.stackexchange.com上被问到。我投票结束这个问题,因为它应该在stats.stackexchange.com上被问到