Greg Strong <NoJunk@NoJunk4UČ.com> wrote:

: On 22 Sep 2005 18:50:13 GMT, Thelma Lubkin <th****@alpha2.csd.uwm.edu>

: wrote:

:> You reintialize the random number generator each time it's

:> called.

: Ok. So why is this wrong?

If you reintialize each time, you're telling it

to begin at the same place in the randomization

algorithm as it did the time before, so it chooses

the same random number: remember, these aren't truly

'random': they are repeatable computations if you begin

at the same initial conditions--and you're asking it to

restore the initial conditions every time you ask for

a number.

Apparently 'randomize' makes the same

:> initialization each time. Even if that weren't so, you

:> don't want to initialize your generator each time you

:> choose a random, so take the randomize step out of the

:> function and run it once, before you begin your select.

: Well I want a different random number each time. I passed the ID to the

: random function and it created a different number each time.

The 'random function' doesn't include the randomization

step. That step is used to *initialize* the random sequence

that you will generate with repeated calls to the random

function. If you initialize again you reset the

algorithm to again begin at the first random number in

this sequence. There is yet another function

that you can use to reset the entire sequence so that

the random function gets you a different set of numbers.

--thelma

: Regards,

: Greg Strong