0
3.1kviews
Using appropriate test check whether the numbers are uniformly distributed in a random number generator

Using appropriate test check whether the numbers are uniformly distributed.

N=50, $\alpha$= 0.05, $\chi _{0.05,9}$= 16.9.

{6,7,0,6,9,9,0,6,4,6,4,0,8,2,6,6,1,2,6,8,5,6,0,4,7,1,3,5,0,7,1,4,9,8,6,0,9,6,6,7,1,0,4,7,9,2,0,1,4,8}

1 Answer
0
79views

Solution:

  1. Define the hypothesis for testing uniformity

    $H_0: R_i \quad \nu \quad U[0,1]$

    $H_0: R_i \quad \not{\nu} \quad U[0,1]$

  2. Normalize the data points (single digit numbers) to (0,1) for chi-square test (here 50 digits are given so chi-square test is more relevant). This results in following 50 data points.

    0.6, 0.7, 0.0, 0.6, 0.9, 0.9, 0.0, 0.6, 0.4, 0.6, 0.4, 0.0,

    0.8, 0.2, 0.6, 0.6, 0.1, 0.2, 0.6, 0.8, 0.5, 0.6, 0.0,

    0.4, 0.7, 0.1, 0.3, 0.5, 0.0, 0.7, 0.1, 0.4, 0.9, 0.8,

    0.6, 0.0, 0.9, 0.6, 0.6, 0.7, 0.1, 0.0, 0.4, 0.7, 0.9,

    0.2, 0.0, 0.1, 0.4, 0.8

  3. Given that

    Degree of freedom = $ n - 1 = 9 \rightarrow 0$

    $n = 9 + 1 = 10$

    Arrange the normalized data into $n=10$ intervals of equal length namely, [0, 0.1], [0,0.2], ..., [0, 0.9]

  4. Compute test statistics

Interval $O_i$ $E_{1}=\frac{N}{n}=\frac{50}{10}$ $\frac{(0 i-E+)^{2}}{E J}$
[0, 0.1] 8 5 1.8
[0.1, 0.2] 5 5 0
[0.2, 0.3] 3 5 0.8
[0.3, 0.4] 1 5 3.2
[0.4, 0.5] 6 5 0.2
[0.5, 0.6] 2 5 1.8
[0.6, 0.7] 11 5 7.2
[0.7, 0.8] 5 5 0
[0.8, 0.9] 4 5 0.2
[0.9, 1.0] 5 5 0

$ \therefore \chi_{0}^{2}=\sum_{i=1}^{n} \frac{\left(0_{i}-E_{i}\right)^{2}}{E_{j}}=15 \cdot 2$

  1. Given that the critical value = $\chi_{0.05,9}^2 = 16.9$

  2. Since $\alpha_0^2 = 15.2 \lt \chi_{0.05,9}^2 = 16.9$

$H_0$ is accepted i.e. set of random numbers are uniformly distributed.

Please log in to add an answer.