#include #define D 2147483647.0 #define pi 3.1415926 { long int r1,r2; int seed; double sd,rf1,rf2,norm; cout << "Enter a seed" << endl; // each time program is run new random numbers cin >> seed; // are generated. srandom(seed); cout << "Enter standard deviation" << endl; cin >> sd; for (i=0;i < n ;i++) // generate a bunch of random numbers { r1 = random(); r2 = random(); rf1 = r1/D; rf2 = r2/D; // convert to random float in (0,1) norm = sd*sqrt(-2.0*log(rf1))*cos(2*pi*rf2); ...... } ........ }