Thursday, January 10, 2013

Normal Distribution


# Normal distribution simulation with mean=300 and standard deviation = 60


graphsize 600,600
sd=60
mean=300
dim bar(600)
for n = 0 to 99999    
number = int(mean + sd*sqr(-2*log(rand))*cos(2*pi*rand))   
bar[number]=bar[number]+1
plot number,500-bar[number]
next n


No comments:

Post a Comment