Re: Random Numbers
- From: nospam@xxxxxxxxxxxxx (Richard E Maine)
- Date: Thu, 29 Jun 2006 12:41:53 -0700
Pierre Asselin <pa@xxxxxxxxxxxxxxxxxxxxx> wrote:
Does the standard specify what you can or cannot pass to
random_seed(put=) ? I mean the content, not just the size. I was
bitten once by an implementation that was very picky about the
contents of its seed vectors. I did as you show, asking random_seed()
for the size and filling the array with some sequence salted by a
small user input. The resulting sequence was anything but random !
IIRC the standard promises that you can call random_seed(get=) and
use the result in a random_seed(put=), but as far as I know you
can't construct your own seed.
The standard says just that the seed from put "is used in a
processor-dependent manner tocompute the seed value accessed by the
pseudorandom number generator". It also goes on to elaborate how, in
essense, the internal seed might be different from the one input.
There is no restriction, or even suggestion, that the seed value for put
has to come from a previous get. I would argue that a processor that
failed to accept arbitrary integer values was non-conforming. Of course,
the quality of the resulting random numbers is a quality of
implementation issue. I guess you did say just that the results had
"poor quality" instead of that it failed to work at all. I would expect
that a quality implementation should suitably map the input values onto
"reasonable" seeds if needed. I picture that as part of the business
about using the input values to compute the internal seeds rather than
necessarly literally being the internal seeds.
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
.
- References:
- Random Numbers
- From: CTallant
- Re: Random Numbers
- From: dpb
- Re: Random Numbers
- From: Richard E Maine
- Re: Random Numbers
- From: Steven G. Kargl
- Re: Random Numbers
- From: Pierre Asselin
- Random Numbers
- Prev by Date: Re: How to Find Memory Used (IVF 9.1, WinXP)
- Next by Date: Re: Random Numbers
- Previous by thread: Re: Random Numbers
- Next by thread: Re: Random Numbers
- Index(es):
Relevant Pages
|