PROGRAM FILE 140: RUNS TEST FOR THE RND FUNCTION.
    ANSI STANDARD 8.4

SECTION 140.1: RUNS TEST FOR THE RND FUNCTION.

THIS PROGRAM COUNTS HOW MANY RUNS OF A GIVEN LENGTH OCCUR
WITHIN A SERIES OF RANDOM NUMBERS. A RUN IS A SUBSEQUENCE
OF THE NUMBERS WITHIN WHICH THE VALUES ARE IN ASCENDING
ORDER. THE RESULTS ARE COMPARED WITH THE EXPECTED OUTCOME
FOR UNIFORM RANDOM NUMBERS, AND CHI-SQUARE IS COMPUTED
AND DISPLAYED. ALL RUNS OF LENGTH >= 6 ARE CONSOLIDATED
INT ONE CATEGORY.

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

                  BEGIN TEST

RUN LENGTH     ACTUAL COUNT   EXPECTED COUNT
 1              823            833.335 
 2              1049           1041.66 
 3              449            458.334 
 4              135            131.945 
 5              33             28.7698 
>= 6            4              5.9524 

FOR 6 D.F., SHOULD HAVE 1.63539 <= CHI-SQ <= 12.5916
(5% TAIL ON EACH END.)

ACTUAL CHI-SQ =  6.66211 

*** INFORMATIVE TEST PASSED ***

                 END TEST

END PROGRAM 140
