836 CHAPTER 39. STATISTICAL TESTS

and so

A =

1− p1 −√p1 p2 · · · −√p1 pr

−√p1 p2 1− p2 · · · −√p2 pr...

. . . . . ....

−√pr p1 −√pr p2 · · · 1− pr



A = I−

√

p1√p2...√

pr

( √

p1√

p2 · · · √pr

)

This is of the form I−aaT where aTa= |a|2 = 1. Now(I−aaT )(I−aaT )= I−2aaT +aaTaaT = I−2aaT +aaT = I−aaT

Thus A2 = A and so by Lemma 39.4.4 the matrix A has only 0 and 1 as eigenvalues. Nownote that (

I−aaT )a= 0

and so there is a 0 eigenvalue. In fact multiples of this single eigenvector are the only oneswhich deliver 0 as an eigenvalue. I show this now. If

(I−aaT

)b= 0, then b= aaTb

and so |b|= |a|∣∣aTb

∣∣≤ |a|2 |b|= |b| and so you must have (a ·b) = aT b= |a| |b| whichmeans that the only eigenvectors b which have 0 as an eigenvalue are multiples of a. Recallthat this was the condition for equality in the Cauchy Schwarz inequality. Therefore, therank of A is r− 1. This is because A is symmetric so there is a basis of eigenvectors. ByCorollary 38.9.9, and the fact that if the moment generating functions converge, then so dothe random variables having the given moment generating function, it follows that for large

n, the distribution of ∑rk=1

(Vk−npk)2

npkis X 2 (r−1) as claimed. ■

Example 39.6.3 A die is half of a pair of dice. It is cubic and has numbers from 1 to 6 onthe sides. They are suppose to come up with equal probability. Now you have a die and itis rolled 60 times. The following table summarizes the outcomes.

1 2 3 4 5 66 5 9 10 23 7

Is it reasonable to conclude that the die is fair, doing what it is supposed to do bygiving the same probability to each possible outcome? Well, obviously not, but lets see howto quantify this conclusion.

Let S1 = (−∞,1],S2 = (1,2],S3 = (2,3],S4 = (3,4],S5 = (4,5],S6 = (5,∞). Then thepi are each 1/6. We compute the thing which will have a X 2 (5) distribution.

r

∑k=1

(Vk−npk)2

npk=

((6−10)2

10 + (5−10)2

10 + (9−10)2

10

+ (23−10)2

10 + (7−10)2

10

)= 22

Now from a table or using MATLAB and data cursor you find that the probability that aX 2 (5) random variable is less than 14.35 is .98. However, here we have that the randomvariable is 22 so I can say with probability .98 that the die is unfair.

836 CHAPTER 39. STATISTICAL TESTSand sol-p, —/pip2 ++) —\/P1PrA —J/Pip2 1l-p2 ++ —/p2Pr—VPrP1 ~V/PrP2 PrVPI1V P2A=I-— ; ( vir JP2 Vpn )VPrThis is of the form J— aa! where a’ a = lal? = 1. Now(1—aa") (I—aa’) =1—2aa!’ +aa' aa!’ =1—2aa’ +aa’ =I—aa’Thus A? = A and so by Lemma 39.4.4 the matrix A has only 0 and 1 as eigenvalues. Nownote that(I _ aa’ ) a=0and so there is a 0 eigenvalue. In fact multiples of this single eigenvector are the only oneswhich deliver 0 as an eigenvalue. I show this now. If ([—aa’)b=0, then b= aa’band so |b| = |a||a7b| < |a|” |b| = |b| and so you must have (a:b) = a” b = |a| |b| whichmeans that the only eigenvectors b which have 0 as an eigenvalue are multiples of a. Recallthat this was the condition for equality in the Cauchy Schwarz inequality. Therefore, therank of A is r—1. This is because A is symmetric so there is a basis of eigenvectors. ByCorollary 38.9.9, and the fact that if the moment generating functions converge, then so dothe random variables having the given moment generating function, it follows that for largestributi r (Ve=npr)? ; 2(p_ :n, the distribution of Yy_; {5 *— is 2“ (r—1) as claimed. iExample 39.6.3 A die is half of a pair of dice. It is cubic and has numbers from I to 6 onthe sides. They are suppose to come up with equal probability. Now you have a die and itis rolled 60 times. The following table summarizes the outcomes.1}2|)3)4 |5 |66|5|91| 10) 23|7Is it reasonable to conclude that the die is fair, doing what it is supposed to do bygiving the same probability to each possible outcome? Well, obviously not, but lets see howto quantify this conclusion.Let S} = (—2, 1],S2 = (1,2],.53 = (2,3],S4 = (3,4],S5 = (4,5],So = (5,00). Then thepj are each 1/6. We compute the thing which will have a 2°? (5) distribution.r 6-10)? , (5-10)? , (9-10)reel Tak=l—4qy2 42NPK +B) 40 7)Now from a table or using MATLAB and data cursor you find that the probability that a2? (5) random variable is less than 14.35 is .98. However, here we have that the randomvariable is 22 so I can say with probability .98 that the die is unfair.