9

是否可以使用概率或 NProbability 函数从 4 次抛硬币中计算出 3 次或更多正面的概率。

这不是关于这个问题的简单答案的问题,更多的是了解如何使用 Mathematica 使用分布来解决这类问题。

所以使用分布 P 中的 4 个随机变量

我希望这样的事情可以解决问题,但它不起作用。我得到0。

P = BernoulliDistribution[0.5];
vars = List[Distributed[a,P],Distributed[b,P],Distributed[c,P],Distributed[c,P]];
NProbability[Count[ {a,b,c,d}, 1] >= 3,  vars]

任何想法将不胜感激。

4

2 回答 2

10

不是在这里使用 Mma 进行统计的专家,但这似乎有效:

l = TransformedDistribution[
       x + y + w + z, {x \[Distributed] BernoulliDistribution[0.5], 
                       y \[Distributed] BernoulliDistribution[0.5], 
                       z \[Distributed] BernoulliDistribution[0.5], 
                       w \[Distributed] BernoulliDistribution[0.5]}];

Table[NProbability[x > i, x \[Distributed] l], {i, -1, 4}]
(*
{1, 0.9375, 0.6875, 0.3125, 0.0625, 0.}
*)
于 2011-10-19T12:27:12.407 回答
8
In[10]:= Probability[a + b + c + d >= 3, vars]

Out[10]= 0.3125

用 BinomialDistribution 更容易描述硬币翻转:

In[12]:= Probability[m >= 3, m \[Distributed] BinomialDistribution[4, 0.5]]

Out[12]= 0.3125
于 2011-10-19T20:58:16.140 回答