On Mon, 11 Dec 2017 22:08:03 +0000, Farley, Peter x23353 wrote:
>
>I do not see any "modulus" operation available in the SORT manual, so it 
>apparently isn't possible to post-process the IEBDG numbers with SORT to 
>convert each of the random numbers modulo the limit value.  I suppose division 
>and truncation and subtraction may work, though I haven't figured out how yet.
>
Modulus has been considered an inferior way to generate random numbers within
a given range because with many RNGs the low-order bits are less random than
the high-order.  For example for some congruential RNGs the low order n bits 
simply
repeat with a cycle of 2**n.  Better to multiply and take the integer part.

Modern RNGs with cryptographic strength may not suffer this deficiency.

The better suggestion was to generate random keys and sort.

>The other hard problem is to guarantee that there is exactly one occurrence of 
>each number and that no numbers in the range are left out.
>
Longer random keys greatly reduce the probability of duplicates.  How does 
performance
of DFSORT vary with key length?  (TANSTAAFL)

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to