选择有偏见的硬币的概率

机器算法验证 可能性 自习 条件概率
2022-04-03 12:21:21

假设你有一袋 100 枚硬币,其中 1 枚硬币正面朝上。你从袋子里取出一枚硬币,扔了三下。所有三轮投掷的结果都是正面。选择的硬币有偏差的概率是多少?

我的答案:-

P(selecting a biased coin) = 1/100
P(getting a head thrice with the biased coin) = 1

P(selecting an unbiased coin) = 99/100
P(getting a head thrice with the unbiased coin) = 1/8

P(selecting a biased coin|coin toss resulted in 3 heads) = 
          P(selecting a biased coin and getting heads thrice)/
          [P(selecting a biased coin and getting heads thrice) +
           P(selecting an unbiased coin and getting heads thrice)] 

= (1/100)/[(1/100) + (99/800)]
= (1/100)/(107/800)
= 8/107
= 0.0747

这个对吗?谢谢。

3个回答

你的回答是对的。可以使用贝叶斯定理得出解决方案:

P(A|B)=P(B|A)P(A)P(B)

您想知道的概率。P(biased coin|three heads)

我们知道什么?

硬币。是公平的,是偏向双方为首的。100991

使用公平的硬币,三个正面的概率是0.53=1/8

选择有偏硬币的概率:P(biased coin)=1/100

所有三个抛掷的概率都是正面:P(three heads)=1×1+99×18100

给定有偏硬币的三个正面的概率是微不足道的:P(three heads|biased coin)=1

如果我们使用上面的贝叶斯定理,我们可以计算

P(biased coin|three heads)=1×1/1001+99×18100=11+99×18=81070.07476636

是一篇描述与此非常相似的东西的文章。贝叶斯方法是正确的方法。

一般来说,P(biased coin|k head) = (2^k)/[(2^k) + 99] 其中 k 是连续正面的数量

所以如果把戏法硬币扔了 3 次 (2^3)/[(2^3) + 99] = 8/(8+99) = 8/107 = 0.07