Simulation and modeling - Old Questions

Question Answer Details

3.  Explain the independence test. A sequence of 1000 four digit numbers has been generated and an analysis indicates the following combinations and frequencies.

Combination(i)

Observed frequency (Oi)

Four different digits

560

One pair

394

Two pair

32

Three digits of a kind

13

Four digits of a kind

1

 

1000

Based on poker test, test whether these numbers are independent. Use α=0.05 and N=4 is 9.49.

10 marks
Asked in 2067

Answer

AI Generated Answer

AI is thinking...

Official Answer

Independent test determines whether a random number generator is producing independent random number in a sequence. Test for independence includes the three types of tests as given below:

1) Autocorrelation Test tests the correlation between numbers and compares the sample correlation to the expected correlation of zero.

2) Gap test Counts the number of digits that appear between repetitions of particular digit and then uses the Kolmogorov-Smirnov test to compare with the expected size of gaps,

3) Poker test: Treats numbers grouped together as a poker hand. Then the hands obtained are compared to what is expected using the chi-square test.

Now,

The probabilities associated with each of the given combination is given by

P (four different digits) = 4C4 * (10/10) * (9/10) * (8/10) * (7/10) = 0.504

P (one pair) = 4C2 * (10/10) * (1/10) * (9/10) * (8/10) = 0.432

P (two pair) = (4C2/2)*(10/10) * (1/10) * (9/10) * (1/10) = 0.027

P (three digits of a kind) = 4C3 * (10/10) * (1/10) * (1/10) * (9/10) = 0.036

P (four digits of a kind) = 4C4 * (10/10) * (1/10) * (1/10) * (1/10) = 0.001

Now the calculation table for the Chi-square statistics is:

Combination(i)

Observed

Frequency(Oi)

Expected

Frequency(Ei)

(Oi-Ei)(Oi-Ei)2/Ei
Four different digits5600.504*1000 = 504
566.22
One pair3940.432*1000 = 432
-383.343
Two pair32 0.027*1000 = 27
50.926
Three digits of a kind130.036*1000 = 36
-2314.694
Four digits of a kind1 0.001*1000 = 1
00.000

10001000
Σ(Oi-Ei)2/Ei = 25.183

\\begin{displaymath}x_0^2 = \\sum_{i=1}^n \\frac{(O_i - E_i)^2} {E_i} \\end{displaymath} = 25. 183

and Given  α, N = 0.05, 4= 9.49

Here the calculated value of chi-square is 25.183 which is greater than the given tabulated value of chi- square so we reject the null hypothesis of independence between given numbers.