but if it's for something like selecting truck drivers for 'random' drug
testing you ought to be advised that CEERAN0 doesn't necessarily have as
long a sequence as we might like.
From what I have been able to extrapolate from the various documents,
including the one you included here (Bruce Viking) CEERANO will produce non
repeatable numbers that run into the thousands.
Drug testing reg's require that no less than 50% of the fleet be drug tested
in a given year and each time a sampling is generated you must run it over
the entire fleet, it is possible that the same driver could be selected
theoretically each month for an entire year.
So if you have a fleet of say 5,000 drivers you must test no less than 2,500
in a given year and with most companies doing this on a monthly basis, you
are selecting on average 209 drivers per month (of course that is dependent
on the actual number of active drivers in that month).
I would be hard pressed to think that you would get the same number
generated twice in the same run with that low of a number. Of course you
have me thinking now that a test would be interesting.
Douglas
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [
mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Buck
Sent: Wednesday, April 04, 2007 1:39 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Floating point conversion
I think I have a far clearer understanding now.....
One last thing to think about is the reason you want random numbers. I
don't recall seeing the business case for the random number, but if it's
for something like selecting truck drivers for 'random' drug testing you
ought to be advised that CEERAN0 doesn't necessarily have as long a
sequence as we might like.
CEERAN0 generates it's numbers via an algorithm, which makes it
pseudo-random. That is, it appears to be random. But if you track the
numbers long enough, you'll find that the sequence starts all over again
from the beginning. How long that takes is the sequence length.
Read this IBM page (Thanks Bruce Vining!) for an alternative API that
has a longer sequence than CEERAN0.
http://www-912.ibm.com/s_dir/slkbase.NSF/0/00599805bfa9117f86256c48005989f6?
OpenDocument
I had to do this very thing in Ye Olde Days. I used the October 1988
issue of Communications of the ACM, article on random numbers authored
by Stephen K Park and Keith W Miller as the basis of my routine (which
held up in court, as it turned out.)
As an Amazon Associate we earn from qualifying purchases.