2016 Update

This commit is contained in:
Tina Müller 2016-12-05 22:15:40 +01:00
parent 948b86eafa
commit dcf5d15da3
7965 changed files with 139854 additions and 31002 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