Pseudo-random numbers in [0, n), covering all numbers in n steps?

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Thu Feb 25 10:32:41 PST 2016


On 02/25/2016 01:19 PM, John Colvin wrote:
> I don't think that's a good idea. A prng is closed path through a state
> space and it doesn't matter where you start on said path, you're going
> to follow the same closed path through the state space.

That's totally fine for some applications - those that simply want to 
iterate the input at most once in a random order. Far as I can tell this 
is the most frequent. I don't care for a second iteration to guarantee a 
different iteration schedule. And if I did, I'd have no trouble 
reseeding the generator. -- Andrei



More information about the Digitalmars-d mailing list