0
4.1kviews
Why it is necessary to test the properties of random numbers? How would you generate random numbers.

Similar questions

Explain various methods for random number generation.

1 Answer
0
81views
  • It is necessary to test random numbers because the random numbers we generate are pseudo random numbers and not real and pseudo random number generator must generate a sequence of such random numbers which are uniformly distributed and they should not be correlated, they should not repeat itself.

  • In short we can say test is necessary to determine whether the stream of number is random.

  • Hypothesis testing is used to test uniformity and independence properties of random numbers. Kolmogorov Smirnov (K-S) test and Chi-Square is used to compare distribution of the set of numbers generated to a uniform distribution.

  • Methods for generation of pseudo Random numbers are as follows

  1. Linear Congruential Method

  2. Combined Linear Congruential Method.

    • Linear Congruential method can be divided into Mixed L.C.M and Multiplicative L.C.M Method.

    • Linear Congruential Method:The linear method was initially proposed by lehmer in 1951. This method produces a sequence of integers, X1, X2… between zero and m-1 by following a recursive relationship.

    $X_{i+1}$=(a$X_i$+c)mod m, i=0,1,2,…

    Where $X_0$ is called as seed.

    a is the multiplier

    c is increment,

    and m is modulus.

    • If c is not equal to 0 then the form is called as mixed congruential method.

    • And when c is equal to 0 the form is called as multiplicative congruential method. The selection of values for a, c, m, and X0 drastically affects the statistical properties and cycle length.

    • Combined Linear Congruential Method: Due to increase in complexity, reliability and problem size the generator with longer period is required. This problem is overcome by combine L.C.M. Here random numbers are generated by following relation.

    Xi= ∑($(-1)^{j-1}X_{i,j}$) mod $m_1$-1

Then $R_i= X_1/m_1$ ; $X_i$>0

=$(m_1-1)/m_1$ ; $X_i=0$

Maximum possible period for such generator is

P=$((m_1-1)*(m_2-1)*...(m_k-1))/2^{k-1}$

Please log in to add an answer.