Re: randomize




"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


.



Relevant Pages

  • Re: Random number question?
    ... > How does HLA's random number generator differ from traditional BASIC's ... Or the same individual number twice? ... > Some repeats, but not as bad as before. ... Runs of numbers and other patterns occur far more ...
    (sci.math)
  • Re: Random number question?
    ... > How does HLA's random number generator differ from traditional BASIC's ... > Some repeats, but not as bad as before. ... I needed a reliable RNG that didn't throw up repeats as ... I wanted to simulate a large DNA profile database ...
    (sci.math)
  • Re: PRNG
    ... that is a non periodic Pseudo Random Number Generator. ... so large that for all practical purposes it never repeats, ... Generator algorithm on a computer that lacks infinite memory. ... A cryptographically secure prng is quite an achievement. ...
    (sci.crypt)
  • Re: Random number question?
    ... > How does HLA's random number generator differ from traditional BASIC's ... definition as they all use an algorithm to compute the next ... Or the same individual number twice? ... Repeats are perfectly reasonable in a random number generator. ...
    (alt.lang.asm)
  • Re: random number question.
    ... between random numbers and pseudo-random numbers. ... They typically "gang up" on posters they think are female, ... the specifications for the generator. ... the chapter of Knuth's "The Art of Computer Programming" ...
    (comp.programming)