Jump to content

Verify distribution uniformity/Naive: Difference between revisions

m
(Liberty BASIC entry)
Line 881:
LB cannot pass user-defined function by name, so we use predefined function name - GENERATOR
<lang lb>
'for i = 1 to 20
' print GENERATOR()
'next
'end
'[RC] Verify distribution uniformity/Naive
'Create a function to check that the random integers returned from a small-integer generator function have uniform distribution.
 
'The function should take as arguments:
' The function (or object) producing random integers.
' Since LB cannot pass a function, we 'll use given name GENERATOR
' The number of times to call the integer generator.
' A 'delta' value of some sort that indicates how close to a flat distribution is close enough.
 
n=1000
print "Testing ";n;" times"
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.