返回题库

用公平硬币模拟 1/3 与 2/3

simulate an event that has probability 1/31 / 3 , and an event that has probability 2/32 / 3 .

专题
Probability / 概率
难度
L4

题目详情

You have a fair coin and you want to simulate an event that has probability 1/31 / 3 , and an event that has probability 2/32 / 3 . How do you do it?

解析

抛两次硬币:

  • HH → 事件 A(概率 1/31/3
  • HT 或 TH → 事件 B(概率 2/32/3
  • TT → 丢弃重来

因为在去掉 TT 后,HH/HT/TH 三种结果等概率,因此得到 1/31/32/32/3