返回题库

连续双正面计数

Number of Double Heads

专题
Probability / 概率
难度
L4

题目详情

抛硬币 10 次,把结果写成字符串。定义 “HH” 的出现次数允许重叠(例如 HHH 中 HH 的次数为 2)。

问:HH 的出现次数期望是多少?

A coin is tossed 10 times and the output written as a string. What is the expected number of HH? Note that in HHH, number of HH = 2. (eg: expected number of HH in 2 tosses is 0.25, 3 tosses is 0.5)

Hint

Recursion

解析

E(n)E(n) 为抛 nn 次的 HH 期望次数。对每个相邻位置 (i,i+1)(i,i+1),它为 HH 的概率是 1/41/4

一共有 n1n-1 对相邻位置,因此

E(n)=n14.E(n)=\frac{n-1}{4}.

n=10n=10E(10)=94=2.25E(10)=\frac{9}{4}=2.25


Original Explanation

Solution

Let the expected number of HH for n tossed is E(n). So, probability that an (n-1) toss experiments, ends in T is 1/2. So, E(n) = 1/2 * E(n-1) + 1/2 * ( 1/2 * (E(n-1)+1) + 1/2 * (E(n-1))) (The first case when it ends in T. & The second case when it ends in H. In the second case, if you get an H then, you get 1 more HH. ) So, E(n) = E(n-1) + 1/4, us E(2) = 1/4 So, E(n) = (n-1)/4 For n=10, E(10) = 2.25