
Bin1 for the range of 0 to 0.001, bin2 for the range of 0.001 to 0.002, etc. At the end of the experiments, plot the histogram for the range of random numbers and the population (i.e., total number of random numbers collected in that bin). It should generate a flat histogram, emphasizing the uniformity of the generator.
Every programming language has in-built RNG. However, the efficiency is relatively poor. The efficiency here is referred to the periodicity of the RNG. Usually, they have the periodicity in the order of 232-1. There are many systems, which need a higher periodicity of the RNG for the simulation. The one, which has a significantly higher periodicity, is MT19937 RNG, with periodicity equals to 2 19937 -1, developed by Nishimura and Matsumoto (Ref: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html ). For a general discussion on the random number generator, reader may refer the book by Knuth (The art of computer programming, vol-2)
Usage of RNG: random number generator need to be initialized with a seed number, which must be an integer. The sequence of random numbers depends on the seed value. Therefore, one has to change the seed number before the beginning of every simulation. To avoid such limitation, one can use the ‘current time' as the seed number. Current time is continuously changing. Therefore, it is not required to make any changes. In C/C++, the argument will be time(NULL) . Header file “time.h” needs to be included.