Simulation and modeling - Old Questions

Question Answer Details

3.  What is the main objective of gap test? Explain gap test algorithm with example.

10 marks
Asked in 2068

Answer

AI Generated Answer

AI is thinking...

Official Answer

The gap test is used to determine the significance of the interval between recurrence of the same digit. A gap of length x occurs between the recurrence of  some digit. It Counts the number of digits that appear between repetitions of a particular digit and then uses the Kolmogorov-Smirnov test to compare with the expected number of gaps. 

The probability of a particular gap length can be determined by a Bernoulli trail.

\\begin{displaymath}P ({\\rm gap ~of} ~ n) = P(x \\ne 3) P(x \\ne 3) ... P(x \\ne 3) P (x = 3) \\end{displaymath}

If we are only concerned with digits between 0 and 9, then

\\begin{displaymath}P ({\\rm gap ~of} ~ n) = 0.9^{n} 0.1 \\end{displaymath}

The theoretical frequency distribution for randomly ordered digits is given by

\\begin{displaymath}P (gap \\le x) = F(x) = 0.1 \\sum_{n=0}^x (0.9)^n = 1 - 0.9^{x+1} \\end{displaymath}

Steps involved in this test are:
Step 1:
   Specify the cdf for the theoretical frequency distribution given by Equation above based on the selected class interval width.
Step 2:
   Arrange the observed sample of gaps in a cumulative distribution with these same classes.
Step 3.
   Find D, the maximum deviation between F(x) and SN(x) as in equation D = max |F(x)-SN(x)|
Step 4.
   Determine the critical value, Dα, from Table( K-S critical value) for the specified value of  α and the sample size N.
Step 5.
   If the calculated value of D is greater than the tabulated value of Dα, the null hypothesis of independence is rejected.