连续抛100次硬币,有十次连续正面的概率是几多?给个思路?呵呵请写出思路,:))btw:sin361/great_wh两位能否提供一下,呵呵.
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/23 23:45:49
连续抛100次硬币,有十次连续正面的概率是几多?给个思路?呵呵请写出思路,:))btw:sin361/great_wh两位能否提供一下,呵呵.
连续抛100次硬币,有十次连续正面的概率是几多?
给个思路?呵呵
请写出思路,:))
btw:sin361/great_wh两位能否提供一下,呵呵.
连续抛100次硬币,有十次连续正面的概率是几多?给个思路?呵呵请写出思路,:))btw:sin361/great_wh两位能否提供一下,呵呵.
运行结果如下:
100 10
1 3 8 20 48 112 256 576 1280 2816 6144 13311 28667 61422 131016 278368 589392 1.
24406e+06 2.61862e+06 5.49811e+06 1.15177e+07 2.40778e+07 5.02395e+07 1.04645e+0
8 2.17616e+08 4.51879e+08 9.37034e+08 1.94059e+09 4.01415e+09 8.29412e+09 1.7119
6e+10 3.53014e+10 7.27263e+10 1.49697e+11 3.0788e+11 6.32722e+11 1.29935e+12 2.6
6649e+12 5.46847e+12 1.12078e+13 2.29571e+13 4.69965e+13 9.61568e+13 1.96639e+14
4.01924e+14 8.21133e+14 1.67682e+15 3.4227e+15 6.98348e+15 1.4243e+16 2.90377e+
16 5.91783e+16 1.20561e+17 2.4553e+17 4.99871e+17 1.01735e+18 2.06992e+18 4.2102
1e+18 8.56112e+18 1.74035e+19 3.53692e+19 7.18622e+19 1.45971e+20 2.96433e+20 6.
01845e+20 1.22164e+21 2.47915e+21 5.03001e+21 1.02034e+22 2.06934e+22 4.19596e+2
2 8.50645e+22 1.72418e+23 3.49413e+23 7.07974e+23 1.43424e+24 2.90503e+24 5.8831
4e+24 1.19124e+25 2.41168e+25 4.88173e+25 9.88015e+25 1.99936e+26 4.04535e+26 8.
18392e+26 1.65542e+27 3.34809e+27 6.77064e+27 1.36901e+28 2.76779e+28 5.59506e+2
8
0.0441372
即概率为0.0441372.
//---------------------------------------------------------------------------
#include
#include
#include
#pragma hdrstop
//---------------------------------------------------------------------------
#pragma argsused
int main(int argc,char* argv[])
{
int n,m;
scanf("%d%d",&n,&m);
double *p = new double[n + 1];
memset(p,0,(n+1)*sizeof(double));
for (int i = m; i