EXCEL正态分布
C++:利用随机函数,根据高尔顿原理产生正态分布。 (打开Excel,利用图表现的向导look)
已有 199 次阅读 2010-12-26 15:36
#include
#include
#include
using namespace std;
//Golton板仿真,将随机数加工为正态分布
int Golton(int theMidPlace,int theLevel)
{
if ((rand()/10%2)==1)
{
if (rand()%2==1)
{
theMidPlace++;
}
else
theMidPlace--;
}
for (int i = 0;i>midpl...全部
C++:利用随机函数,根据高尔顿原理产生正态分布。
(打开Excel,利用图表现的向导look)
已有 199 次阅读 2010-12-26 15:36
#include
#include
#include
using namespace std;
//Golton板仿真,将随机数加工为正态分布
int Golton(int theMidPlace,int theLevel)
{
if ((rand()/10%2)==1)
{
if (rand()%2==1)
{
theMidPlace++;
}
else
theMidPlace--;
}
for (int i = 0;i>midplace;
cout>level;
for(int j = 0;j=0&&x<=100)
count[x]++;
else continue;
}
for(int i = 0;i<101;i++)
{
fp<收起