Prng
PRNG - Pseudorandom number generator, A pseudorandom number generator (PRNG), also known as a deterministic random bit generator (DRBG),[1] is an algorithm for generating a sequence of numbers that approximates the properties of random numbers.
Random
This tag is for questions pertaining to random numbers and their generators, whether pseudo-random or truly random.
Non-random behaviour reflection
Example |
---|
"Then you use it as seed in random which is less good that one is a non-cryptographic prng and its output may exhibit some structure which will not register in a statistical measurement tool but might be exploited by an intelligent attacker" from question High quality, simple random password generator |
"The non-random random behaviour is more a reflection on the quality of the rand prng â it is often not very good" from question PRNG program failure. Cannot enter random amount of choices and will always answer with 2 from the PRNG |
Others
Example |
---|
But a large period prng takes up more memory for maintaining the internal state and also takes more time for generating a random number due to complex transitions and post processing from question Random Engine Differences |
It can be simply done by generating random numbers from the range 0 ... 127 and then doing some arithmetic this will likely be faster than invoking prng multiple times from question C++ how do I generate random numbers between -32 to 32 or -64 to 64 and excluding the value zero? |
A prng entropy source has much higher quality than what random uses but its entropy source s not guaranteed to be cryptographically secure from question Guid.NewGuid() VS a random string generator from Random.Next() |
Hat is where prngs are used to stretch the real entropy to produce more pseudo random numbers from the smaller amount of entropy provided by the trng;the real entropy is used to seed the prng and the prng produces more numbers based on that seed from question How can a pseudorandom number generator possibly be non-repeating? |
He f#.net journal articles numerical libraries special functions interpolation and random numbers 16th march 2008 and numerical libraries linear algebra and spectral methods 16th april 2008 tested quite a bit of functionality and nmath was actually the slowest of all the commercial libraries;all the commercial libraries prng was slower than all others and 50 slower than the free math.net library some basic functionality was missing the ability to calculate gamma -0.5 and other basic functionality the gamma-related functions all the commercial libraries did provide was broken from question The speed of .NET in numerical computing |
Rogram output 9 8 4 5 1 10 7 3 6 2 the library s prng is not very random but for many cases that is not important;if program output 9 8 4 5 1 10 7 3 6 2 the library s prng is better algorithms are available from question How can I use the rand() function to generate a different number that hasn't been generated before? |
Now the probability that a random value is rejected is guaranteed to be smaller than 50 resulting in a very efficient algorithm just like your bit masking approach;for small bounds the probability that prng is called more than once is extremely small from question Quality of PRNG when not using all bits at once |
It s well known that rand is often not a high quality prng pseudo-random number generator but i m a little surprised by this apparently systematic behaviour with seeds that differ by 1 each time;on my mac when i changed srand to srandom and rand to random i got better as in more unpredictable results from question Suggestion about unique values generation |