By csgillespie
The German Federal Office for Information Security (BSI) has established
criteria for quality random number generator (rng):
- A sequence of random numbers has a high probability of containing no identical consecutive elements.
- A sequence of numbers which is indistinguishable from true random’ numbers (tested using statistical tests.
- It should be impossible to calculate, or guess, from any given sub-sequence, any previous or future values in the sequence.
- It should be impossible, for all practical purposes, for an attacker to calculate, or guess the values used in the random number algorithm.
Points 3 and 4 are crucial for many applications. Everytime you make a
phone call, contact to a wireless point, pay using your credit card random
numbers are used.
Designing a good random number generator is hard and as a general rule you should never try to. R comes with many good quality random generators. The default generator is the Mersenne-Twister. This rng has a huge period of (how many random numbers are generated before we have a repeat).
Linear congruential generators
A linear congruential generator (lcg) is a relatively simple rng (popular in the 60’s and 70’s). It has a simple form of
where $latexr_0$ is the initial number, known as the seed, and (a,b,m) are the multiplier, additive constant and modulo respectively. The parameters are all integers.
The modulo operation means that at most different numbers can be generated
before the sequence must repeat – namely the integers . The
actual number of generated numbers is , called the period of
the generator.
The key to random number generators is in setting the parameters.
RANDU
RANDU was a lcg with parameters and <img …read more
Source:: r-bloggers.com