''
'' cosc611HW4p2.sim
'' simc cosc611HW4p2.sim
''
PREAMBLE
define i as integer variable
define exponential as real 1-dim array
define laplace as real 1-dim array
define total1 as real variable
define total2 as real variable
define total3 as real variable
END
MAIN
'' file output
open 3 for output, name="data.txt"
use 3 for output
reserve exponential(*) as 6
''reserve laplace(*) as 6
'' exponential
for i=1 to 6
do
let exponential(i)=exponential.f(12.21, dim.f(seed.v))
loop
print 1 line as follows
Exponential number distribution:
List exponential
'' LaPlace
let total1 = exponential(1) - exponential(2)
let total2 = exponential(3) - exponential(4)
let total3 = exponential(5) - exponential(6)
print 1 line as follows
LaPlace number distribution:
List total1
List total2
List total3
'' end main
end