Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Random-numbers/Metafont/random-numbers.metafont
Normal file
19
Task/Random-numbers/Metafont/random-numbers.metafont
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
numeric col[];
|
||||
|
||||
m := 0; % m holds the mean, for testing purposes
|
||||
for i = 1 upto 1000:
|
||||
col[i] := 1 + .5normaldeviate;
|
||||
m := m + col[i];
|
||||
endfor
|
||||
|
||||
% testing
|
||||
m := m / 1000; % finalize the computation of the mean
|
||||
|
||||
s := 0; % in s we compute the standard deviation
|
||||
for i = 1 upto 1000:
|
||||
s := s + (col[i] - m)**2;
|
||||
endfor
|
||||
s := sqrt(s / 1000);
|
||||
|
||||
show m, s; % and let's show that really they get what we wanted
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue