Keywords: Goodness-of-fit test, Chi-square test, Overlapping m-tuple test, Serial test. One shortcoming of the Pearson chi-square test is that it only examines the distribution of experiment outcomes, but not their interdependence. For example, the test statistic is invariant against re-ordering the outcomes. To remedy the shortcoming, G. Marsaglia suggested combining consecutive outcomes to form tuples and then examining the distribution of the tuples. The statistic of the test is a quadratic form in the weak inverse of the covariance matrix of the counts of all tuples. As consecutive tuples overlap, we call this test the overlapping chi-square test. Compared with the conventional one, this test checks the interdependence as well as the distribution of experiment outcomes and is thus more comprehensive. Marsaglia stated that the statistic of the overlapping chi-square test follows a chi-square distribution with the degrees of freedom equal to the rank of the covariance matrix. He sketched the background theory but did not publish any proof. This paper gives a detailed derivation for the distribution of the test statistic.