PROGRAM FILE 138: COUPON COLLECTOR TEST OF RND FUNCTION.
    ANSI STANDARD 8.4

SECTION 138.1: COUPON COLLECTOR TEST OF RND FUNCTION.

THIS PROGRAM TESTS HOW MANY RANDOM NUMBERS MUST BE GENERATED
(UP TO A MAXIMUM) TO GET AT LEAST ONE OF EACH TYPE. A TYPE IS
DETERMINED BY WHICH FRACTION OF THE 0 - 1 SEGMENT THE VALUE
OF THE NUMBER FALLS WITHIN. CHI-SQUARE IS COMPUTED AND
DISPLAYED TO SEE WHETHER IT IS COMPATIBLE WITH THE
EXPECTED DISTRIBUTION FOR UNIFORM RANDOM NUMBERS.

***** THIS TEST IS INFORMATIVE ONLY *****

                 BEGIN TEST

SEARCH LENGTH  ACTUAL COUNT   EXPECTED COUNT

 5              65             76.8 
 6              161            153.6 
 7              189            199.68 
 8              214            215.04 
 9              200            209.019 
 10             226            190.956 
 11             164            167.633 
 12             153            143.278 
 13             99             120.226 
 14             92             99.5831 
 15             86             81.724 
 16             61             66.6201 
 17             58             54.0433 
 18             52             43.6839 
 19             36             35.2171 
 20             23             28.3359 
 21             17             22.7661 
 22             23             18.2713 
 23             15             14.6521 
 24             14             11.7427 
>= 25           52             47.1289 

FOR 20 D.F., SHOULD HAVE 10.8508 <= CHI-SQ <= 31.4104
(5% TAIL AT EACH END.)

ACTUAL CHI-SQ =  21.8524 

*** INFORMATIVE TEST PASSED ***

                 END TEST

END PROGRAM 138

Program interrupted at line 880
