Re: randomize
- From: "Ralph" <nt_consulting64@xxxxxxxxx>
- Date: Tue, 27 Sep 2005 09:24:41 -0500
"Martin Nemzow" <mnemzow@xxxxxxxxxx> wrote in message
news:5f874$43394d05$4076e846$13317@xxxxxxxxxxxxx
> VB RND and RANDOMIZE is flawed. It is really called a "pseudo random
number
> generator" and it is statistically poor at best. Yes it repeats, and
> repeats, and repeats. If you create a function as described in the VB help
> file samples, all you are really doing is scaling the result between an
> upper and lower range limit. The pattern is still the same and repeats and
> repeats and repeats, just linearly scaled.
>
> There are different types of randomness from patterns repeatable to
> surprise!!! Different requirements require different types. There is
nothing
> wrong with either, just wrong in how you implement the type of randomness
> for your requirements.
>
> If you really need world class surprise randomness, you will need to
> implement the Microsoft CryptoAPI, RSA, some other encryption package with
a
> random number generator, wrap calls to the built-in hardware random number
> generator built into just about CPU since the Pentium, or buy a hardware
> encryption coprocessor.
>
> Hope that helps.
>
>
> "PC" <Onzin@xxxxxxxxxx> wrote in message
> news:%23DnXUJ1wFHA.2880@xxxxxxxxxxxxxxxxxxxxxxx
> > i understand that the randomize statement initializes the rnd() function
> > by experimenting i found that for each different argument i give the
> > randomize statement, a different sequence is generated by the rnd()
> > function, but for the same argument always the same sequence
> > but experimenting only goes so far
> > my question is,
> > a) is there a lower/upper bound for the argument
> > b)does every different argument always generate a different sequence
than
> > every other argument
> >
> >
Good advice, but I would take exception to the word "flawed". They are
"Pseudo-random sequence generators" and have never been advertised to be
anything else. All core language libraries provide one. VB's version is
little different from one provided by the standard CRT or a thousand dollar
math library.
The tools you mentioned will produce statistically better results because as
you said they are wrapped around a statistically better 'seed' generator.
The actual sequence generator in all these tools is also a "Pseudo-random
sequence generator" and is little different than than all the others. They
merely pull seeds from more random sources and change it more frequently. It
is possible however, to achieve very similar results by managing your own
modest seed generator.
-ralph
.
- References:
- Re: randomize
- From: Martin Nemzow
- Re: randomize
- Prev by Date: Re: Re-size Print Preview
- Next by Date: Re: End is bad, mmkay?
- Previous by thread: Re: randomize
- Next by thread: Re: OCX not registered correctly
- Index(es):
Relevant Pages
|