''
'' cosc611HW4p3.sim
'' simc cosc611HW4p3.sim
''
PREAMBLE
define i as integer variable
define norm as real 1-dim array
define stdnorm as real 1-dim array
define stdcauchy as real 1-dim array
define cauchy as real 1-dim array
END
MAIN
'' file output
open 3 for output, name="data.txt"
use 3 for output
reserve norm(*) as 6
reserve stdnorm(*) as 6
reserve stdcauchy(*) as 5
reserve cauchy(*) as 5
'' normal
for i=1 to 6
do
let norm(i)=normal.f(12.21, 11.6836, dim.f(seed.v))
loop
print 1 line as follows
Normal number distribution:
List norm
'' Standard Normal
for i=1 to 6
do
let stdnorm(i)=((norm(i) - 12.21) / 11.6836)
loop
print 1 line as follows
Standard Normal number distribution:
List stdnorm
'' Standard Cauchy
for i=1 to 5
do
let stdcauchy(i) = stdnorm(i) / stdnorm(i+1)
loop
print 1 line as follows
Standard Cauchy sum value:
List stdcauchy
'' Cauchy
for i=1 to 5
do
let cauchy(i) = 5+10*stdcauchy(i)
loop
print 1 line as follows
Standard Cauchy sum value:
List cauchy
'' end main
end