Simulation and modeling - Old Questions
3. What are the properties of random number? The sequence of numbers 0.54, 0.73, 0.98, 0.11 and 0.68 has been generated. Use the Kolmogorov-Smirnov test α=0.05 to determine if the hypothesis that the numbers are uniformly distributed on the interval 0 to 1 can be rejected. (Note that the critical value of D for α=0.05 and N=5 is 0.565).
Answer
AI is thinking...
Random numbers are samples drawn from a uniformly distributed random variable between some satisfied intervals, they have equal probability of occurrence.
Properties of Random Numbers
1. Uniformity:
- The random numbers generated should be uniform. That means a sequence of random numbers should be equally probable every where.
- If we divide all the set of random numbers into several numbers of class interval then number of samples in each class should be same.
- If ‘N’ number of random numbers are divided into ‘K’ class interval, then expected number of samples in each class should be equal to ei = N / K.
2. Independent:
- Each random number should be independent samples drawn from a continuous uniform distribution between 0 and 1.
- The probability density function is given by:
f(x) = 1, 0 <= x <= 1
= 0, otherwise
3. Maximum Density:
- The large samples of random number should be generated in a given range.
4. Maximum Cycle:
- It states that the repetition of numbers should be allowed only after a large interval of time.
Now,
Given sequence of number,
0.54, 0.73, 0.98, 0.11 and 0.68
Arranging the given number in ascending order:
0.11, 0.54, 0.68, 0.73, 0.98
Here, N = 5
Calculation table for Kolmogorov-Smirnov test :
i | ||||
1 | 0.11 | 0.2 | 0.09 | 0.11 |
2 | 0.54 | 0.4 | - | 0.34 |
3 | 0.68 | 0.6 | - | 0.28 |
4 | 0.73 | 0.8 | 0.07 | 0.13 |
5 | 0.98 | 1 | 0.02 | 0.18 |
Now, calculating
= 0.09
= 0.35
= 0.35
Given, Critical value = 0.565
Since the computed value, D = 0.35, is less than the tabulated critical value, = 0.565, the hypothesis of no difference between the distribution of the generated numbers and the uniform distribution is not rejected.