【概率论】【POJ 3682】【King Arthur's Birthday Celebration】
题意:进行翻硬币实验,若k次向上则结束,进行第n次实验需花费2*n-1的费用,询问期望结束次数及期望结束费用设F[i]为第i次结束时的概率F[i]= c(i-1,k-1)*p^k*(1-p)^(i-k)sigma(f[i])==1p^k*sigma(c(i-1,k-1)*(1-p)^(i-k))=1sigma(c(i-1,k-1)*(1-p)^(i-k))=1/(p^k)ans1=sigma(i*