Verify distribution uniformity/Naive: Difference between revisions
Content added Content deleted
(Liberty BASIC entry) |
|||
Line 881: | Line 881: | ||
LB cannot pass user-defined function by name, so we use predefined function name - GENERATOR |
LB cannot pass user-defined function by name, so we use predefined function name - GENERATOR |
||
<lang lb> |
<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 |
n=1000 |
||
print "Testing ";n;" times" |
print "Testing ";n;" times" |