连续两次正面的期望抛掷次数
Expected Number of Coin Flips to Get Two Heads in a Row
题目详情
开始反复抛一枚公平硬币。直到你第一次得到连续两次正面(HH)为止,期望需要抛多少次?
英文原题
You start flipping a fair coin. What is the expected number of flips until you get two heads in a row?
解析
设状态 A 表示“当前没有连续正面的前缀(上一轮不是 H)”,状态 B 表示“上一轮是 H”。令 分别为从状态 A/B 到达 HH 的期望抛掷次数。
从状态 A:下一次抛掷后
- 以 概率得到 T,仍在 A;
- 以 概率得到 H,进入 B。
因此
从状态 B:下一次抛掷后
- 以 概率得到 H,结束;
- 以 概率得到 T,回到 A。
因此
联立解得 ,所以答案是 。
英文解析
Set state A to "there is no current run of consecutive heads (the previous round was not H)", and state B to "The previous round was H". Make the expected number of tosses from status A/B to HH, respectively.
From State A: After the next toss
- T with a probability of , still in A;
- Get H with a probability of and enter B.
Therefore,
From State B: After the next toss
- H with a probability of , ending;
- Get T with a probability of and go back to A.
Therefore,
The answer is , so the answer is .