A slightly different situation to the previous section is if
we have a random sample of n objects each of which can fall into exactly
one of K `categories' (for example, roll a die 60 times; each time
the die can be one of 6 values) and for the ith category
we observe
occurrences among the n objects. Now we let
represent the hypothesized proportion of objects in the
whole population of objects that fall into the ith category.
Now we expect
occurrences of category i and we can
measure the distance between observed and expected results by
the same
statistic as above. The only difference in the
procedure is that the degrees of freedom is now K-1 rather than K.