这个题其实很简单的。。思路快的话2分钟就做出来了。。比较难一点的版本。。toss a fair coin, what is the expected number of tosses to get m consecutive heads?
继续更难一些(这个没遇到过的估计要翻资料才能做出来了)
toss a fair coin n times, what is the probability to get at least m (m (more...)
引用下卷心菜兄弟的解法
-* 1/2
+-* 1/4
++-* 1/8
.....
+++++...+- (total m) 1/(2^m)
+++++...++ (total m) 1/(2^m)
x= (1/2)(x+1) + (1/4)(x+2) +... +(1/(2^m))(x+m)+(1/(2^m))*m
=> x = 2^(m+1) - 2
+-* 1/4
++-* 1/8
.....
+++++...+- (total m) 1/(2^m)
+++++...++ (total m) 1/(2^m)
x= (1/2)(x+1) + (1/4)(x+2) +... +(1/(2^m))(x+m)+(1/(2^m))*m
=> x = 2^(m+1) - 2