Codeforces Round #259 (Div. 2)(二)

2015-07-20 18:01:25 · 作者: · 浏览: 12
of each outcome is 0.25, that is expectation equals to:

\

You can read about expectation using the following link: http://en.wikipedia.org/wiki/Expected_value

#include
     
      
#include
      
        int main() { int m,n; scanf("%d%d",&m,&n); double ans=0; for(int i=1;i<=m-1;i++) ans+=pow(1.0*i/m,n); printf("%.12lf\n",m-ans); return 0; }