is there a such thing as a randomly accessible pseudo-random number generator? (preferably open-sour
Posted
by lucid
on Stack Overflow
See other posts from Stack Overflow
or by lucid
Published on 2010-06-10T23:08:26Z
Indexed on
2010/06/10
23:12 UTC
Read the original article
Hit count: 322
first off, is there a such thing as a random access random number generator, where you could not only sequentially generate random numbers as we're all used to, assuming rand100() always generates a value from 0-100:
for (int i=0;i<5;i++)
print rand100()
output:
14
75
36
22
67
but also randomly access any random value like:
rand100(0) would output 14 as long as you didn't change the seed
rand100(3) would always output 22
rand100(4) would always output 67
and so on...
I've actually found an open-source generator algorithm that does this, but you cannot change the seed. I know that pseudorandomness is a complex field; I wouldn't know how to alter it to add that functionality.
Is there a seedable random access random number generator, preferably open source? or is there a better term for this I can google for more information?
if not, part 2 of my question would be, is there any reliably random open source conventional seedable pseudorandom number generator so I could port it to multiple platforms/languages while retaining a consistent sequence of values for each platform for any given seed?
© Stack Overflow or respective owner