经典结果:首次出现 n 连正面的期望抛掷次数为 2n+1−2。
代入 n=10 得
211−2=2046.
Original Explanation
We are going to solve this more generally for n consecutive heads. Let fk be the expected number of flips of the coin needed to obtain n heads when you have 0≤k≤n heads consecutively obtained already. Our boundary condition is that fn=0, as you already have all n heads obtained. We can see that fn−1=21⋅1+21⋅(1+f0)=1+21f0, as with probability 1/2, you reach n heads, and with probability 1/2, you start over. Similarly, we have that
fn−2=1+21fn−1+21f0=1+21(1+21f0)+21f0=23+43f0
By doing this again, we obtain
fn−3=1+21fn−2+21f0=1+21(23+43f0)+21f0=47+87f0
A pattern now arises. By recursively applying this process, we can see that
fn−k=(2−2k−11)+(1−2k1)f0
By plugging in k=n, we obtain
f0=f0(1−2n1)+2−2n−11⟺2n1f0=2−2n−11⟺f0=2n+1−2
In particular, for n=10, our answer is 211−2=2046.