Designing a Random Number Generator

2071 Words5 Pages

Designing a Random Number Generator

Introduction
Random Number Generator is a computational routine or a physical device that produces numbers which don’t have any pattern in them. Although using computational algorithms involves adding pattern to the resulting sequence of numbers.
We focussed on generating uniformly distributed random numbers between (0,1) since the same distribution can be used to get numbers from different ranges. We all know that LCG is well known method for giving a sequence of randomized numbers using linear equation but it still has some issues.
We have done 9 different tests on our RNG and have come up with quantitative results. Some of the tests performed are single level test and some are two level tests. we would also like to tell that some of these tests are Diehard tests [http://en.wikipedia.org/wiki/Diehard_tests].
Single level test- It’s a 1st level test observes the p-value, where p is a measure of uniformity. If p-value is extremely close to 0 to 1 then the generator fails since it produced value with very high uniformity (close to 1) or it is not uniform at all.
Two level test- Creating ‘N’ independent copies of base test having n sample size ‘n’ each. So, total sample size is ‘N*n’.
The Test gives us a ‘p’ value(Ref-http://shazam.econ.ubc.ca/intro/diehard.htm.), we would like present here a discussion on the p-value of the test.
Those p-values are obtained by p=F(X), where F is the assumed distribution of the sample random variable X---often normal. But that assumed F is just an asymptotic approximation, for which the fit will be worstin the tails. Thus you should not be surprised with occasional p-values near 0 or 1, such as .0012 or .9983. When a bit stream really FAILS BIG, you w...

... middle of paper ...

... of the Utility called TestU01 which has some predefined test suites for sequences of uniform random numbers over the interval (0,1).

Conclusion
We designed an RNG which is combination of 4 simple generators. we have tested and shown that the final RNG gives uniform distribution and passes 9 different complex tests which suggests that the designed RNG is enough random and can be used for simulation studies or other purposes.
Empirical studies also proves that by combining two or more simple generators, by means of a simple operations such as +, -, * or (exclusive-or), provides a composite with better randomness than either of the components[ G. Marsaglia. A current view of random number generators, 1984].

References
1. G. Marsaglia. A current view of random number generators, Computer Science and Statistics: 16th Symposium on the Interface, Atlanta, 1984.

Open Document