Simulation and modeling - Old Questions
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.
Answer
AI is thinking...
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 digits | 560 | 0.504*1000 = 504 | 56 | 6.22 |
One pair | 394 | 0.432*1000 = 432 | -38 | 3.343 |
Two pair | 32 | 0.027*1000 = 27 | 5 | 0.926 |
Three digits of a kind | 13 | 0.036*1000 = 36 | -23 | 14.694 |
Four digits of a kind | 1 | 0.001*1000 = 1 | 0 | 0.000 |
1000 | 1000 | Σ(Oi-Ei)2/Ei = 25.183 |
= 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.