62 RANDOM NUMBERS 3.3.2 D. Poker test (Partition
Saturday, April 28th, 200762 RANDOM NUMBERS 3.3.2 D. Poker test (Partition test). The classical poker test considers 72 groups of . . five successive integers, (Ys3, Ysj+l, . . . , Ysj+4) for 0 5 j < n, and observes which of the following seven patterns is matched by each quintuple: All different: abcde Full house: aaabb One pair: aabcd Four of a kind: aaaab Two Pairs: aabbc Five of a kind: aaaaa Three of a kind: aaabc A chi-square test is based on the number of quintuples in each category. It is reasonable to ask for a somewhat simpler version of this test, to facilitate the programming involved. A good compromise would simply be to count the number of distinct values in the set of five. We would then have five categories: 5 different = all different; 4 different = one pair; 3 different = two pairs, or three of a kind; 2 different = full house, or four of a kind; 1 different = five of a kind. This breakdown is easier to determine systematically, and the test is nearly as good. In general we can consider n groups of k successive numbers, and we can count the number of k-tuples with T different values. A chi-square test is then made, using the probability p = d(d-l)...(d--+l) 7 dk that there are r different. (The Stirling numbers {F} are defined in Section 1.2.6, and they can readily be computed using the formulas given there.) Since the probability p, is very small when r = 1 or 2, we generally lump a few categories of low probability together before the chi-square test is applied. To derive the proper formula for p,, we must count how many of the d k-tuples of numbers between 0 and d - 1 have exactly T different elements, and divide the total by dk. Since d(d - 1). . . (d -T + 1) is the number of ordered choices of r things from a set of d objects, we need only show that {F} is the number of ways to partition a set of k elements into exactly T parts. Therefore exercise 1.2.6-64 completes the derivation of Eq. (5). E. Coupon collector s test. This test is related to the poker test somewhat as the gap test is related to the frequency test. The sequence Yo, Yr, . . . is used, and we observe the lengths of segments YJ+l, Yy+s, . . . , YJ+r required to get a complete set of integers from 0 to d -1. Algorithm C describes this precisely:
Note: If you are looking for cheap and reliable webhost to host and run your web application check Vision coldfusion web hosting services