Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,42 @@
call sample 100
call sample 1000
call sample 10000
end
sub sample n
dim samp(n)
for i =1 to n
samp(i) =rnd(1)
next i
' calculate mean, standard deviation
sum = 0
sumSq = 0
for i = 1 to n
sum = sum + samp(i)
sumSq = sumSq + samp(i)^2
next i
print n; " Samples used."
mean = sum / n
print "Mean = "; mean
print "Std Dev = "; (sumSq /n -mean^2)^0.5
'------- Show histogram
bins = 10
dim bins(bins)
for i = 1 to n
z = int(bins * samp(i))
bins(z) = bins(z) +1
next i
for b = 0 to bins -1
print b;" ";
for j = 1 to int(bins *bins(b)) /n *70
print "*";
next j
print
next b
print
end sub