用偏硬币模拟公平硬币
Simulating a Fair Coin with an Unfair One
题目详情
一枚硬币正面概率 ,反面概率 。只用这枚硬币,设计方法模拟一次公平抛硬币(正反各 )。
A coin is biased such that it comes up heads with probability and tails with probability . Using only this coin, design a method to simulate a fair coin, i.e., to get heads and tails with equal probability of .
解析
冯·诺依曼方法:连续抛两次。
- 若结果为 HT,则输出“正”。
- 若结果为 TH,则输出“反”。
- 若为 HH 或 TT,则丢弃并重来。
因为 与 相等,所以在条件事件 {HT,TH} 下输出正反各为 。
Original Explanation
To simulate a fair coin using the biased coin, follow this procedure:
- Flip the coin twice and observe the outcome.
There are four possible outcomes:
- HH
- HT
- TH
- TT
Now examine their probabilities:
Both HT and TH have the same probability, namely .
So, define your fair coin outcome as follows:
- If you get HT, declare the result as "Heads"
- If you get TH, declare the result as "Tails"
- If you get HH or TT, discard the outcome and flip again.
This method ensures that the resulting outcomes are equiprobable because , thereby simulating a fair coin with a biased one.