用公平硬币模拟 1/3 与 2/3
simulate an event that has probability , and an event that has probability .
题目详情
概率题:用公平硬币模拟 1/3 与 2/3。
英文原题
You have a fair coin and you want to simulate an event that has probability , and an event that has probability . How do you do it?
解析
抛两次硬币:
- HH → 事件 A(概率 )
- HT 或 TH → 事件 B(概率 )
- TT → 丢弃重来
因为在去掉 TT 后,HH/HT/TH 三种结果等概率,因此得到 与 。
英文解析
To simulate an event with probability using a fair coin, toss the coin twice. If you get , let that be your event with probability . If you get or , let that be your event with probability . If you get , then ignore it, and toss twice again. By removing from the sample space, the outcomes are restricted to three equally likely possibilities.