39.6. GOODNESS OF FIT 833

it. These methods come from Pearson around 1900. Again, they involve massaging thingsto use a known distribution, this time a chi-squared distribution.

To do this right, you should be using characteristic functions, but everything of interestin this book will have a moment generating function and it is just less fussy to do everythingin terms of moment generating functions. However, the complex variable material in thisbook is sufficient for you to do in terms of characteristic functions, except even then, thereare more advanced and theoretical theorems needed which involve much harder techniques.These are related to convergence of the characteristic functions leading to convergence ofthe distributions. Because of these considerations, I will give a discussion to make themain result plausible based on moment generating functions. To see a full discussion of thetheory about to be presented, see [9]. The following is the situation of interest.

1. F (x)≡ P(X ≤ x) so F is the distribution function of X which has a density f (x).

2. There are r disjoint intervals S1, · · · ,Sr whose union is R and pi ≡ P(X ∈ Si).

3. For n large, there is a random sample X1, · · · ,Xn and Vi will denote the number ofthese samples which end up in Si. Thus the expected number for Vi would be npi.

4. The determination whether it is reasonable to consider the Xk as coming from theprobability distribution F is dependent on consideration of

Q(n)≡r

∑k=1

(Vk−npk)2

npk

If this is small, then there isn’t much difference between the observed value Vi andthe expected value npi and it would be reasonable to think that the sample is fromthe given probability distribution. On the other hand, if it is large, then it would notbe reasonable to consider the sample as coming from the given distribution.

Of course, the problem is in quantifying these issues and this involves the next majorproposition. First is a lemma about counting.

Lemma 39.6.1 The number of ways of selecting subsets having v1, · · · ,vr elements where∑k vk = n, from a set having n elements is

n!v1!v2! · · ·vr!

Also(a1 +a2 + · · ·+ar)

n = ∑v1+···+vr=n

n!v1!v2! · · ·vr!

av11 av2

2 · · ·avrr

Proof: There is nothing to prove if r = 1. In case r = 2, it was shown earlier. Recallthat n!

v1!(n−v1)!= n!

v1!v2! is the number of ways to select a set having v1 elements and a sethaving v2 elements from a set having n elements. In general, the number of ways to obtainsubsets of size v1,v2, · · · ,vr is the number of ways to select subsets of size v1,v2, · · · ,vr−1from a set of size n− vr times the number of ways to select the set of size n− vr which, byinduction is

(n− vr)!v1!v2! · · ·vr−1!

n!(n− vr)!vr!

=n!

v1!v2! · · ·vr!.