返回题库

连续 10 个正面的期望抛掷次数

Ten Consecutive Heads

专题
Probability / 概率
难度
L4

题目详情

平均而言,公平硬币需要抛多少次才能首次出现连续 10 个正面?

On average, how many times must a fair coin be flipped to obtain 1010 consecutive heads?

解析

经典结果:首次出现 nn 连正面的期望抛掷次数为 2n+122^{n+1}-2

代入 n=10n=10

2112=2046.2^{11}-2=2046.

Original Explanation

We are going to solve this more generally for nn consecutive heads. Let fkf_{k} be the expected number of flips of the coin needed to obtain nn heads when you have 0kn0 \leq k \leq n heads consecutively obtained already. Our boundary condition is that fn=0f_n = 0, as you already have all nn heads obtained. We can see that fn1=121+12(1+f0)=1+12f0f_{n-1} = \frac{1}{2} \cdot 1 + \frac{1}{2} \cdot (1 + f_0) = 1 + \frac{1}{2}f_0, as with probability 1/21/2, you reach nn heads, and with probability 1/21/2, you start over. Similarly, we have that

fn2=1+12fn1+12f0=1+12(1+12f0)+12f0=32+34f0f_{n-2} = 1 + \frac{1}{2}f_{n-1} + \frac{1}{2}f_0 = 1 + \frac{1}{2}\left(1 + \frac{1}{2}f_0\right) + \frac{1}{2}f_0 = \frac{3}{2} + \frac{3}{4}f_0

By doing this again, we obtain

fn3=1+12fn2+12f0=1+12(32+34f0)+12f0=74+78f0f_{n-3} = 1 + \frac{1}{2}f_{n-2} + \frac{1}{2}f_0 = 1 + \frac{1}{2}\left(\frac{3}{2} + \frac{3}{4}f_0\right) + \frac{1}{2}f_0 = \frac{7}{4} + \frac{7}{8}f_0

A pattern now arises. By recursively applying this process, we can see that

fnk=(212k1)+(112k)f0f_{n-k} = \left(2 - \frac{1}{2^{k-1}}\right) + \left(1 - \frac{1}{2^k}\right)f_0

By plugging in k=nk = n, we obtain

f0=f0(112n)+212n1    12nf0=212n1    f0=2n+12f_0 = f_0\left(1 - \frac{1}{2^n}\right) + 2 - \frac{1}{2^{n-1}} \iff \frac{1}{2^n}f_0 = 2 - \frac{1}{2^{n-1}} \iff f_0 = 2^{n+1} - 2

In particular, for n=10n = 10, our answer is 2112=20462^{11} - 2 = 2046.