连续扔n次硬币,只有最后3次是连续head的概率?(ie 前n-3次中没有出现过连续3次h
ead)
if (n>4)
let m=n-4 // minus 4 is because the last 4th one must be 0
then we have total sample 2^n;
the total 3 heads within 2^m samples will be:
h(m)=(m-2)*2^(m-3)-(m-2-1) //note m-2=Cm-2^1 (with subscript m-2)
so the non 3 head number is: 2^m-h(m)
we get the P=(2^m-h(m))/2^n;
when n==4 --> P=1/2^4
n is impossible <=3
so .......
p=1/16 (n=4)
P=(2^m-h(m))/2^n; (n>4,m=n-4)