834 CHAPTER 39. STATISTICAL TESTS
As to the last assertion, (a1 +a2 + · · ·+ar)n =
(a1 +a2 + · · ·+ar)(a1 +a2 + · · ·+ar) · · ·(a1 +a2 + · · ·+ar)
where there are n products. Thus this product equals a sum of terms of the form av11 av2
2 · · ·avrr
where ∑k vk = n. How many are there for a given choice of exponents v1,v2, · · · ,vr? it isthe number of ways of picking v1 factors from the above product to go with av1
1 ,v2 factorsto go with av2
2 and so forth. Thus the total number associated with a particular term of thisform is n!
v1!v2!···vr! and this proves the second part. ■
Proposition 39.6.2 Let pk,Vk be as described above where F (x) is a given distributionfunction. Then if n is large, Q(n) is distributed approximately as X 2 (r−1) where thereare r disjoint intervals covering R.
Proof: Assume the Xk are samples from F (x). Then the Vk have a multinomial distri-bution. That is
P(V1 = v1,V2 = v2, · · · ,Vr = vr) =n!
v1!v2! · · ·vn!pv1
1 · · · pvrr , ∑
kvk = n.
Indeed, the probability that any Xk is in Si is pi and so the probability that there are vi ofthem in Si is as claimed above. Then consider the moment generating function
M (t1, · · · , tr) ≡ E
(exp
r
∑k=1
tkVk
)
= ∑v1+···+vr=n
n!v1!v2! · · ·vn!
pv11 · · · p
vrr et1v1 · · ·etrvr
By Lemma 39.6.1 this equals (p1et1 + · · ·+ pretr
)n (39.16)
Now consider the moment generating function of the vector(V1−np1√
np1· · · Vk−npk√
npk
).
Then
E
(∑k
tkVk−npk√
npk
)= e−∑k tk
npk√npk E
(∑k
tk√npk
Vk
)From 39.16, this equals
Mn (t1, · · · , tr) = e−∑k tk
npk√npk
(p1e
t1√np1 + · · ·+ pretr√npr
)n
Taking ln of this, and simplifying a little,
ln(Mn) =−∑k
tk√
pkn+n ln(
p1et1√np1 + · · ·+ pre
tr√npr
)