Testing the Radio Shack Random Number Generator to

University of Central Florida
Retrospective Theses and Dissertations
Masters Thesis (Open Access)
Testing the Radio Shack Random Number
Generator to Produce Uniform and Non-Uniform
Random Numbers
Spring 1981
Enrique Menendez
University of Central Florida
Find similar works at: http://stars.library.ucf.edu/rtd
University of Central Florida Libraries http://library.ucf.edu
Part of the Engineering Commons
STARS Citation
Menendez, Enrique, "Testing the Radio Shack Random Number Generator to Produce Uniform and Non-Uniform Random
Numbers" (1981). Retrospective Theses and Dissertations. Paper 575.
This Masters Thesis (Open Access) is brought to you for free and open access by STARS. It has been accepted for inclusion in Retrospective Theses and
Dissertations by an authorized administrator of STARS. For more information, please contact [email protected].
TESTING THE RADIO SHACK RANDOM NUMBER GENERATOR TO
PRODUCE UNIFORM AND NON-UNIFORM RANDOM NUMBERS
BY
ENRIQUE MENENDEZ
B.S.E., I.T . E.S.M., Monterrey N. L. Mexico, 1978
RESEARCH REPORT
Submitted in partial fulfillment of the requirements
for the degree of Master of Science
in the Graduate Studies Program of the College of Engineering
at the University of Central Florida; Orlando, Florida
Spring Quarter
1981
ACKNOWLEDGEMENTS
The author wishes to extend his sincere appreciation to Mr.
Charles James White, M.S.E., for his direction and help in this
study.
Special thanks is also extended to Dr. Gary E. Whitehouse
and Dr. Darrell G. Linton who provided valuable guidance and help
in this research effort.
Sincere appreciation is expressed to all my family for their
help, both financially and spiritually, and for their inspiration
throughout my graduate program and life.
; ii
TABLE OF CONTENTS
LIST OF FIGURES.
vi
LIST OF TABLES
. vii
Chapter
I.
I I.
INTRODUCTION
1
TES TI NG TRS-80 RANDOM NUMBERS. .
6
Goodness of Fit Test . . . .
Kolmogorov-Smirnov Test . . . . . . .
Runs Above and Below the Mean Test .. .
Runs of Length for Above and Below the Mean
Test . . . . . . . .
Autocorrelation Test •.
Gap Test ..
Poker Test . . . . . .
Yule's Test . . . . .
Results. . . . . . . .
III.
GENERATION OF RANDOM NUMBERS
Pseudo-Random Numbers . . . . .
Uniformly Distributed Numbers.
TRS-80 Uniform Random Numbers . . . .
Additive Conoruential Generator ..
Non-Uniformly Distributed Numbers.
Normally Distributed Random Numbers . . .
Exponentially Distributed Random Numbers
IV.
NON-PARAMETRIC TEST. . . . .
Median of a Distribution .
Central Limit Theorem . . .
Runs Above and Below the Median ..
Wald-Wolfowitz Run Test . . . . .
iv
.·
6
7
8
9
10
11
12
13
15
17
17
19
20
22
24
24
28
33
35
38
39
43
V.
VI.
SIMILAR METHODOLOGIES.
45
CONCLUSIONS.
47
APPENDICES
A.
COMPUTER PROGRAM AND PRINTOUT FOR TESTING THE
TRS-80 RANDOM NUMBERS . . . . . . . . . . .
49
B.
COMPUTER PROGRAM AND PRINTOUT FOR GENERATION
AND A NON-PARAMETRIC TEST. . . .
119
C.
NORMAL AND WALD-WOLFOWITZ TABLES .
143
LIST OF REFERENCES . . . . . . . . . . . . . . . . . . . . 146
v
LIST OF FIGURES
I.
The density function of the uniform distribution. .
21
2.
The density function of the normal distribution
26
3.
The density function of the exponential distribution.
30
4.
The cumulative distribution function of the exponential distribution .
. .
31
5.
The median of a distribution. .
37
6.
A two-tailed test of hypothesis .
42
vi
LIST OF TABLES
1.
Results of Testing TRS-80 Numbers.
2.
Wald-Wolfowitz Tables.
144
3.
Normal Table .
145
vii
. . . 15
ABSTRACT
Random numbers are a basic part in a Simulation Model,
and they are also used in random sampling.
These techniques
are employed by quality engineers in the successful execution
of their jobs.
The every-day use of random numbers, however,
often leads to a sense of complacency in the mind of engineers
toward the exacting requirements that should be satisfied by
the random number process to generate a genuine random number.
Microcomputers have become a common and powerful tool that
helps managers and engineers in their simulation experiments by
providing sequences of random numbers.
This research presents a sequence of eight tests to test the
Radio Shack microcomputer system random number generator for uniformity and randomness; then, this Radio Shack random number
generator is used to generate uniform and non-uniform deviates
and a non-parametric test is performed to test these deviates
for randomness.
Two computer programs written in the BASIC language are used
to test for randotmess.
The first one to test the Radio Shack
random number generator and the second one to test the uniform
and non-uniform deviates.
CHAPTER I
INTRODUCTION
Simulation consists basically of synthesizing or duplicating
reality in a simplified form.
This simplified version of reality
is then subjected to intensive study and experimentation in an
attempt to better understand the physical environment that is
represented by the simulation model.
Simulation is a practical, application-oriented procedure.
In order to use it, however, one must construct an abstraction of
the problem, transfer the problem to a foreign device, the computer,
and then obtain indications pertaining only to the representation
of the system.
In order to have a complete success in the simulation, it is
necessary to have a very high quality abstraction of the problem;
this establishes a very reliable model and as a consequence, a
highly reliable result.
Computers are powerful tools in solving the simulation models.
They are easy to use, fast, reliable and not too expensive.
How-
ever, to run a simulation model in a computer, it is required that
the simulation model be processed several times in order to observe and understand the behavior of the model i n differ ent si tuations.
This implies money, because each time the model is
2
processed it has a certain cost assigned.
Therefore, the model
has to be highly reliable in its design, and
~he
computer proce-
dures also have to be highly reliable in order to minimize the
total cost.
One of the basic components in a computer simulation run is
the random numbers.
These numbers usually are generated by the
computer and are used by an engineer in his simulation model, but
before drawing any conclusion from the model, it is necessary to
test the randomness of those numbers.
The simulation process is being used by industry and small
and large business more and more every day; first, because it
is very helpful, and, second, because it is not too costly when
it is used properly.
A lot of these industries and businesses use
microcomputers that are replacing the big qnes, because they
are equally reliable and a lot more inexpensive.
This research presents two computer programs written in
BASIC for a microcomputer, the TRS-80 from Radio Shack.
The pro-
gram generates and tests the random numbers that are going to
be used in a simulation model, or for any other use.
Chapter II in this research presents a sequence of tests
to test the function RND(O) for randomness, before using this
function in any other method.
A computer program was made to
test the function and eight tests were used:
the goodness of
fit test, the Kolmorogov-Smirnov test , the test for runs above
and below the mean, the test of length for above and below the
3
mean, the test for autocorrelation, the gap test, the poker test,
and the Yule's test.
Chapter III in this research presents the methods that are
used in order to generate or provide the random numbers.
are three methods:
There
the first one is internal, the program will
provide the random number as a choice of the user from two different distributions, uniform and non-uniform distributions; thesecond method is also internal and it is a mix from two distributions uniform and non-uniform; and finally the third one is external - the user provides the numbers that are to be tested.
In the first metnod, the numbers generated by the uniform
distribution are produced from two sources:
using the ran-
dom generation function that is a function of the TRS-80 microcomputer system, or using an additive congruential method.
The
numbers generated by a non-uniform distribution are produced
from a normal distribution in which the user selects the mean
and standard deviation, or can be produced by an exponential
distribution in which the user selects the lambda value.
The second method will mix the two sources - uniform and
non-uniform - to produce a strange mix of numbers to be tested
by the program.
It will mix TRS-80 numbers with normal numbers.
Finally, the program will accept that the users input their
own random numbers in order to be tested.
that the user has indicates one thing:
All these choices
the program will test any
4
sequence of numbers and will show if the sample is random, or if
it is not random.
Chapter IV will approach the non-parametric test that is
used in order to test the sequence of numbers.
of two run tests:
The test consists
the first one is runs above and below the me-
dian and the second one is the Wald-Wolfowitz run test.
The non-randomness test is non-randomness in order of appearance along a single nominal scale.
In a sample, if the sample
numbers can be categorized into two distinct groups on a nominal
scale, the total number of runs test is appropriate and useful
to test for randomness of the sample.
In this second computer program, the two categories used
to group the data are:
first, above or equal to the median and
second, below the median of the sample.
The test, as stated, is
non-parametric and, therefore, is applicable regardless of the
underlying distribution.
In Chapter V the research will approach the subject of
similar methodologies ·that can be compared with the effort
realized in this research.
Finally, in Chapter VI, the author will list the conclusions
of this research, mentioning that these computer programs are a
great tool that can be used by administrators and engineers in
order to test the sequence of numbers that are to be used
in a simulation process.
The programs are easy to manage and
to input the data required, so any one can use it.
Besides,
5
it will not take too much time and will make any process highly
reliable.
CHAPTER I I
TESTING TRS-80 RANDOM NUMBERS
The TRS-80 microcomputer system generates uniform random numbers over the interval 0 to 1 by calling the function RND(O).
These numbers are to be used to generate
11
random" numbers for a
uniform and non-uniform distribution, so these TRS-80 random numbers have to be tested for randomness before using them in any
other application.
This random number generator is to be used to generate random
numbers in the second section of this research.
This generator
will produce the seeds to generate new random numbers.
A computer program is to be used to test for randomness using
eight different tests, 1 which came from the same reference. A
significance level of 1% will be used for each test.
This computer
program is included in Appendix A for reference.
Goodness of Fit Test
The Chi-square test goodness of fit test allows one to determine whether the observed frequencies in each class are sufficiently
close to the frequencies expected if the data did, in fact,
come from the uniform distribution.
The test statistic is given by:
1Joseph W. Schmidt and Robert E. Taylor, Simulation and Analysis of Industrial Systems (Homewood, IL: R. D. Irwin, 1970), pp.
215-254.
6
where:
Q.
1
= observed number in the ith cl ass
E·1 = expected number in the ith cl ass
n = number of classes
The value of
C is
to be compared with the value X2a(n-l)
which comes from a chi-square distribution of (n-1) degrees of
freedom with a level of significance of a.
If the test statis-
tic given by the above summation is less than X2a(n-l), the uniform generation can be approved.
The program uses 10 classes in which the expected number of
observations is the total number of observations over the number
of classes.
The number of expected observations in each class
is greater than five observations so that the test will work.
Kolmogorov-Smi rnov Test
:· The Ko Jmogorov-Smi rnov test, which involves the use of a
cumulative frequency distribution, is studied next.
Let F(Xo) =
Xo be the continuous cumulative distribution of T observations.
For any given observation, Xo, ST(Xo)
= m/T, where mis the
observed number of observations less than or equal to Xo.
The Kolmogorov-Smirnov test statistic is that D, which
equals the largest single deviation between F(Xo) and ST(Xo)
over the range (0,1) at a specified number of equal intervals.
8
This value of D must be compared with the critical value of
o1_a from the Kolmo90r0v-Smirnov table for the sample size given.
If D is less than Dl-a' then the hypothesis that the data came
from a true uniform distribution is accepted.
Runs Above and Below the Mean Test
First, it is necessary to define what a run is.
A run is
defined as a sequence of like events or symbols that are preceded
and followed by any event or symbol of a different type, or by
none at all.
number of events or symbols in a run is re-
The
ferred to as its length.
For this test, the program described runs as being above
or below the mean of the sequence of numbers to be tested.
Let
Nl and N2 be the number of individual observations above and
below the mean, respectively.
number of runs.
a will be defined as the total
1
For this test, the program uses a normal approx-
imation by the central limit theorem and the mean and the variance of a1 are given by:
ma1
2
a a
1
2*Nl*N2
= Nl
+
N2 + 1
2*Nl *N2 ( 2*Nl *N2 -:- Nl - N2 )
= (Nl + N2) 2*(Nl + N2 - 1)--
For either Nl or N2 greater than 20, a 1 is normally distributed, and for this case, the te; t statistic is given by:
z=
al - ma1
----
9
Since we are interested in the occurrence of either too
few or too many runs, a two-tailed test is used.
If the level
of significance is a, it is accepted as the hypothesis of randomness if:
Ho: IZI <Zl-a/ 2
The hypothesis
Hl: ~Z] ~ Zl-a/ 2
Run·s of Length for Above and
Below the Mean Test
As it was said, the number of events or symbols in a run is
referred to as its length.
This test will consist of a test of
hypothesis between the expected number of runs of a given length
against the observed number of runs of a given length.
A chi-
square test is performed in order to make a decision.
Let R. be the number of runs of length i in a sequence of
1
N numbers.
The expected value of Ri is given by:
where:
N = number of observations
nl = number of observations above the mean
n2 = number of observations below the mean
Now, if Qi is the observed number of runs of length i,
the test statistic is:
x2
= ~
i =1
pi - E( Ri)J 2
E( R;)
10
where:
=N
L
- 1
The statistic x2 is compared with the theoretical value of
x21_a
(L).
If x2 is less than
domness is accepted, where Ho:
x21_a(L), the hypothesis of ranx2 < x21-a (L) Hl: x2 -~ x21-a (L)
Autocorrelation Test
The test for autocorrelation examines the tendency of numbers to be followed by other numbers.
For this test, the program
checks for correlation every 5 numbers, starting with the first
number in the sequence.
In order to have the observed autocorrelation factor for
ev~ry sequence of the type ri, r(i.+m), r(i+ 2m), · · ·' r(i +(M+l)m),
it is necessary to use:
l
N-m
= N _ m i=l
r r.r(.+)
m
i
i m
p
where:
P m = autocorre 1at ion factor
N = total number of observations
m = interval to check for autocorrelation
r.
1
= ith number in the sequence
For N large relative to m, Pm is approximately normally
distributed with mean and variance given by:
E(Pm) = 0.25
VAR( Pm)
·
=
13N - 19m
144(N - m)2
11
A two-tailed test of hypothesis is made where the test statistic is:
Z
= Pm
- E(P_m)
I VAR( pm)
This value is compared with the theoretical value of Z(l-a/ 2)
and the comparison is made. If Ho: IZI < Z(l-a/ 2 )' the hypothesis
of randomness is accepted.
Gap Test
The gap test is used to determine the significance of the
interval between the recurrence of a given digit.
If the digit
K is followed by X non K digits before K occurs again, then a
gap of size Xis said to exist.
In general, for any given digit
K, the probability that the digit is followed by X non K digits
before K occurs again is given by:
p(X/K)
= p(K followed by exactly X non K digits)
= (.9) x(.1)
x = 0, 1, 2, ....
The program applies this procedure to a single digit between 0 and 9.
After recording the frequency with which each
gap occurs, it is compared to the observed relative cumulative
frequency via the Kolmogorov-Smirnov test.
Under the assump-
tion that the digits are randomly ordered, the theoretical cumulative frequency distribution is given by:
x
Fx(X) =
I
n=O ·
( .1)( .9)
n = 1 - ( ,9) x+l
for X = 0 to n
12
Then the program compares if:
relative cumulative .frequen.cyj
that the digits are
~andomly
The hypothesis Ho:
is less .than
o _~,
1
Dmax IFx(X)
the hypothesis
ordered is accepted.
Poker Test
The poker test is used to analyze the frequency with which
digits repeat in individual random numbers.
The computer program
works for the first 4 digits of the random number, and the program is interested in examining the frequency with which the
following occur in individual numbers:
1.
Four different digits
2.
One Pair
3.
Two pairs
4.
Three like digits
5.
Four like digits
To apply the poker test, first select a level of significance, a, and enumerate all of the different combinations indicating the degree of digit repetition.
Next, compute the pro-
bability of occurrence of .each of these . combinations.
The pro-
bability that each of the above outcomes occurs is given by:
P(Four different digits)
=
P(Second digit different from the first) x
P( Third digit different from the first and second) x
P(Fourth digit different from the first, second and third)
13
= (.9)(.8)(.7)
= .504
P(One pair)
= (~)(.1)(.9)(.8)
= .432
P(Two pairs) = (~)(.1)(.1)(.9)
= .027
P(Three like digits) = (j)(.1)(.1)(.9)
= .036
P(Four like digits)
= (4)(.1)(.1)(.1)
= .001
Then examine the observed frequency with which each combination occurs in the sequence of numbers analyzed.
The observed
frequency with which each combination occurs can be compared with
the expected frequency by application of the Chi-square test.
To obtain the number of times each of these combinations would
be expected to occur we multiply each probability by N.
The test of hypothesis would be, if the expected x2 value
2
is less than x ~ (l-a)(C-1), the hypothesis that the digits within
the random number are randomly ordered is accepted, where C-1
is the total number of combinations.
Yule's Test
The Yule's test is used to analyze the probabilities of the
sum of individual digits in each of the random numbers.
Let r
be a four-digit random variable such that each of the four digits
is uniformly distributed on the interval 0 to 9.
Let r be the
1
14
ith digit of the random variable:
P(r;)
= .1
r
1
i
= 0,
= 1,
1, ... , 9
2, 3, 4
Define 11 Y" as the sum of the four digits in r:
Y
=
4
2:
i =1
r.
1
The probability density function of Y, PY(Y), is given by:
(Y+3~ !
3!Y.
(110) 4
[(Y+3f !
Y=O,l, ... ,9
4(Y-7l ~
3! Y.11 - (Y-10 ! 3! ]
Py(V)=
39-Y
[ 36-Y ! 3 !
39-Y
36-Y ! 3 !
1
4
(10)
4(29-Y !
1 4
26-Y !3! ] (10)
4
1
(10)
y = 10, 11,
y = 19, 20,
e
I
e
'
... '
18
27
y = 28' 29' ... ' 36
If N random numbers are drawn, each number being comprised
of four digits, and if the random numbers are uniformly distributed on the interval 0 to 9999, then the expected number of times
the sum 11 Y11 occurs is given by NPY(Y).
The function of Yule 1 s test is to determine whether the
observed number of times the sum 11 Y11 occurs is significantly
different from NPY(Y).
EY
=
Let:
expected number of times the sum 11 Y" occurs
0 = observed number of times the sum "Y" occurs
y
If the random numbers are uniformly distributed, then the
quantity T is distributed as the Chi-square distribution with
36 degrees of freedom.
15
T=
36
L:
Y=O
If the hypothesis Ho: Tis less than X2(l-a)( 36 )' then the
hypothesis that the numbers are randomly ordered is accepted.
Results
Using sample numbers of 100, 200, 300, 400 and running each
sample 10 times with a significance level of 1%, it was found
that the Radio-Shack Random Number Generator fails to pass the
following tests that are shown in Table 1.
TABLE 1
RESULTS OF TESTING TRS-80 NUMBERS
Test
Goodness of Fit
Ko 1mogorov-Smi rnov
Runs Above and Below
Runs of Length
Autocorrelation
Gap
Poker
Yule's
Numbe·r ·o'f Rans
Samples
200's
300's
400's
Passes
Passes
Passes
Tota 1
% of
Fai 1ure
10
10
10
10
0
10
10
10
10
0
10
8
10
10
10
9
9
9
0
12.5
9
10
10
9
5
10
9
9
10
5
9
10
10
9
10
10
10
9
10
10
10
lOO's
Passes
10
5
2.5
16
The test runs of length for above and below the mean was
the one that fails more often, 12.5% of the times.
The test
for autocorrelation, the gap test and the poker test fails
5% of the times.
The Yule's test was found to fail 2.5% of
the times.
The TRS-80 random number generator can be considered a
good and reliable generator that generates uniform random numbers over the interval 0 to 1.
The computer listing for the
eight tests, as the computer printout for different samples,
is included in Appendix A for reference.
CHAPTER II I
GENERATION OF RANDOM NUMBERS
Pseudo-Random Numbers
A number of techniques have been applied to overcome the
inherent non-reproducibility of random sequences.
Before considering
some of these, it is useful to discuss some of the requirements to
a random number generator.
1.
The numbers produced must follow the uniform or non-uniform
distribution, because truly random events follow these
distributions.
Any simulation of random events must there-
fore follow it at least approximately.
2.
Numbers produced must be statistically independent.
The
value of one number in a random sequence must not affect
the value of the next number.
3.
The sequence of random numbers produced should be reproducible,
but not necessarily.
This implies replication of the simula-
tion experiment..
4.
The sequence must be non-repeating for any desired length.
This is not theoretically possible, but for practical
purposes a long repeatability cycle is adequate . The
repeatability cycle of a random number generator is known
as its period.
17
18
5.
Generation of the random numbers must be fast.
ln the
course of a simulation run, a large number of random numbers are usually required.
If the generator is slow, it
can greatly increase the time and thus the cost of the
simulation run.
6.
The method used in the generation of random numbers should
use as little memory as possible.
Simulation models gen-
erally have large memory requirements.
Since memory is
usually limited, as little as possible of this valuable
resource should be devoted to the generation of random
numbers.
With these requirements, it is not possible to evaluate the
approaches taken to compensate for the lack of reproducibility of
random sequence.
The first approach is to generate the sequence
by some means and to store it, say, on a tape or on a minidisk.
This approach is generally unsatisfactory because of the time involved, but it can be used as a request from the
user~
Each time
a random number is required for simulation or test, a read operation must be initiated, and this is
a ·· time-cons~rning
operation.
This technique also potentially suffers from a short repeatability
cycle unless a large sequence is stored.
The second approach is to generate a random sequence and
hold it in memory.
This approach would overcome the speed prob-
lem of the above technique; however, to store a list large enough
19
to satisfy the requirements of many simulation studies would require an inordinate amount of core.
The third and most common approach is to use a specified input value to generate numbers using some mathematical algorithm.
This technique overcomes the problems of speed and memory requirements but suffers from potential problems with independence and
repeatability.
The use of a .mathematical algorithm to generate random numbers seems to violate the basic principle of randomness.
For
this reason, numbers generated by a mathematical algorithm are
called synthetic or pseudo-random numbers.
These numbers meet
certain criteria for randomness but always begin with a certain
initial value called the seed and proceed in a completely deterministic, repeatable fashion.
That is why extreme care must be taken when using pesudorandom sequences to insure that a fair degree of randomness is
present and that the repeatability cycle is long enough.
Random
numbers are so important to simulation studies that much work
and effort has to be made in order to test the randomness of
those numbers.
Uniformly Distributed Numbers
Consider that a random number is needed from the interval
[a,b].
If the number selected is a random variable with an inte-
grating density function that is constant over the interval [a,b],
20
this distribution is called the uniform distribution.
The density function of the uniform distribution is given by:
1
b - a
a < t < b
=0
-oo
< a < b <
co
Otherwise
Because of the rectangular shape of the density function
(see Figure 1), the uniform distribution is also called the
rectangular distribution.
TRS-80 Uniform Random Numbers
The program will use the function RND(O) to produce uniform
random numbers.
The TRS-80 microcomputer system from Radio Shack
produces uniform random numbers over the interval 0 to 1, just
from calling or using the statement RND(O).
The function RND(O) will produce random numbers, and will
not reproduce the same sequence; each time the function is needed,
the computer will automatically generate a new seed to start
the process, and this seed value is not available to the user.
So every tirre RND'(O) is used, it is pqssible that it wil 1 generate
a different sequence of random numbers.
The program uses this uniform random number to produce
another kind of uniform random number using the additive congruential method, and will also use this number to produce random
21
1
Fi·g, 1.
The density function of the uniform distribution
22
numbers from a non-uniform distribution, in this case for a normal
distribution and for an exponential distribution.
·Additive Congruenti a1 .Generator
The second procedure to generate random numbers from a uniform distribution is using the. additive congruential method. The
congruential method, first proposed in 1951, 2 has become the most
widely used method for generating random numbers.
A strictly additive congruential method was introduced in
3
1959.
This method is also called the Fibonacci Method. In this
type of generator, the seed consists of a sequence of n numbers,
' Xn' that are random numbers from standard
tribution.
The next number, Xn+l' is obtained
Xn and reducing
by
di vi ding
by
largest integer in the machine.
11
m
11
by
unifor~
computing
x
dis-
1
+
For our purpose, m is the
11
•
11
This is the greatest integer
number that can be stored in the compute.r for the TRS-80 mi crocomputer from Radio Shack is 215 -1, or the number 32767.
When computing x1 + Xn' where O < x1 < 1 and O < Xn < 1,
then, as a .conclusion, O<(X 1+Xn)<2. If 11 m11 is the largest integer in the machine,
dividing by m is equivalent to retaining
the fractional portion of the sum.
11
11
The sequence of n seeds are
being generated using the function RND(o), explained in the last
section.
Specifically, the algorithm is:
2James R. Emshoff and Roger L. Sisson, Designing and Use of
Computer Simulation Models (New York: MacMillan, 1970), p. 176.
3 ..
Ibid., p. 177.
23
x.J = (x(J-. 1) .+ x(J-n
. )) Mod u1OS
m
The main advantage of this technique is speed; no multiplications are necessary.
11
m
11
;
It can yield to have periods greater than
to illustrate the procedure, follow the next example:
Let m = 10 and extend the sequence 1, 2, 4, 8, 6 of random
numbers already generated.
xl = 1
x2 = 2
x3 = 4
x4 = 8
x5 = 6
X5 = (X5 + Xl)Mod 10 = (6 + 1)/10 = 7
X7 = (X 6 + X2)Mod 10 = (7 + 2)/10 = 9
Xa = (X7 + X3)Mod 10 = (9 + 4)/10 = 3
x9 =
(X 8 + X4)Mod 10
X10 = (X 9 + X5 )Mod 10
= (X10
x12 = (x 11
x13 = (X 12
x14 = (X 13
x15 = (x 14
X11
xl 6
= (3
+ 8)/10
= (1
+ 6)/10
= (7
x7)Mod 10 = (4
+ X5)Mod 10
+ 7)/10
+
+ 9)/10
=1
=7
=4
=3
+ X8 )Mod 10 = (3 + 3)/10 = 6
X9 )Mod 10 = (6 + 1)/10 = 7
+ x )Mod 10 = (7 + 7)/10 = 4
10
+
=
At the present time, not very much is known about such an
additive number generator; before its . use can be recommended,
24
it will be necessary to develop the theoretical results necessary
to prove certain desirable randomness properties, and to carry out
extensive tests for particular values of x1 , x2 , ... , Xn or seeds.
It has been proved that when n is less than or equal to ~5 seeds,
the sequence fails to pass the gap test, although when n is equal
to 16 seeds, the test was satisfactory.
The program uses 16 seeds that are generated using the function RND(o) in order to solve the problem, and it uses as the modu1us,
11
m
11
,
the word size of the computer.
Non-Uniformly Distributed Numbers
The behavior of many real-system entities cannot be characterized by the uniform distribution.
In fact, other theoretical
distributions, such as the normal, exponential, and Garruna distributions, are encountered more frequently than is the uniform distribution.
In many other cases, no appropriate theoretical distribution
can be found, and an empirical distribution is used.
Thus, the
introduction of appropriate stochastic characteristics in simulations requires the use of the random number generators that
produce numbers with distributions other than the uniform one.
Normally -Distributed Random Numbers
In 1733, De Moiure4 discovered what is known nowadays as the
4 Isaac N. Gibra, Probability and Statistical Inference for
Scientists and Engineers (Englewood Cliffs, NJ: Prentice Hall,
19 73) ' p. 148 •
25
normal distribution.
A random variable X is said to be normally
distributed if its density function is specified by:
1
f ( t)
x
-00
< t <
0 >
co
0
Where a and µ are two parameters (constants) that denote the
standard deviation and the mean, respectively.
The density func-
tion is shown in Figure 2.
Random variables following a normal distribution are commonly encountered in simulation studies.
A number of techniques are
used in transforming standard uniform random numbers into normally
distributed random numbers.
The most common and the one that is used in the computer program for generating normally distributed random numbers is by
using the central limit theorem.
This theorem states that the sum
of identically distributed independent random variables x1 , x2,
... , X has approximately a normal distribution with a mean of nµ
n
and variance of no 2, where 11 and 0 2 are respectively the mean and
the variance of Xj.
If the variables X., J
J
uniform distribution, thenµ
= 1, 2, ... , n, follow the standard
= .5 and a = 1/12. Thus, summing
n standard uniform variables gives an approximate normal
26
f ( t)
x
t
+
-00
Fig. 2.
00
The density function of the normal distribution
27
distribution with mean .5n and variance of n/12.
The program
provides those Xj values from a uniform distribution by utilizing
the RND(o) function that has already been tested to be uniform.
The choice of n is largely up to the analyst.
Of course,
the larger the value of n chosen, the better the approximation
to the normal distribution.
Studies have shown that with n equals
12, the techniques provide fairly good results, while at the same
time . maintaining calculation efficiency.
This is because it
yields a equals one, so in the transformation from a non-standard
normal to the standard normal, a division operation is saved.
For a better understanding, suppose that using RND(o) we obtained the next 12 uniform random numbers:
0.1062, 0.1124,
0.7642, 0.4314, 0.6241, 0.8121, 0.2419, 0.3124, 0.5412, 0.6212,
0.0021, and 0.9443.
Generate a normal random number from a dis-
tribution with means 25 and a variance of 9 .
..-·
Summing the 12 standard uniform numbers gives y equal to
5.5135.
This number is from an approximate normal distribution
with mean of 6 and a variance of one.
The corresponding stan-
dard normal number is Z = y - 6 = -0.4865.
Now, transforming
this number to a normal distribution with mean 25 and a variance
af 9 generates the desired result:
x =µ + aZ = 25 + 3 ( -0 . 486 5) = 23 . 540 5
When the user selects to use the normal distribution, it is
necessary to input the value of the mean and standard deviation,
28
in order to have the desired sequence.
This is a very helpful
situation because those values depend on the user's needs.
Exponentially Distributed_ Random Numbers
A variable, X, is said to be exponentially distributed if
its density function is given by:
A > 0
=0
t > 0
otherwise
The exponential distribution is characterized by the following property known as complete lack of memory:
P(X >
r + s!X
>
r) = P(X
>
s)
where r and s are any positive numbers.
This means that P(X > s) is independent of r.
In other
words, if a piece of equipment has not failed during r time units,
its conditional probability of serving r + s or more time unit?
is independent of rand is equal to the probability of serving
s or more time units.
Stated differently, if time to failure
at a piece of equipment follows the exponential distribution,
then aging of the equipment is irrnnaterial.
The mean and the variance of the exponential distribution
areµ= l/A and a 2 = l/A 2 . It can be noted that the mean and
standard deviation of the exponential distribution are equal .
29
The density function and distribution function of the exponential distribution are shown in Figures 3 and 4, respectively.
The generation of exponentially distributed random numbers
is easily accomplished with the use of the inverse transformation
technique.
Recall that the cumulative distribution function for
an exponentially distributed random variable Xis:
Fx(t) = l - e-At
A> 0
t > 0
The inverse of F is then
F-l (a) =(-1/A)ln(l - a)
where a is a random number uniformly distributed, however, the
value of (l - a) is also uniformly distributed, and the desired
random numbers can be generated by using:
-1
F
(a) =(-1/A)ln(r)
r =1 - a
Thus, generating a standard uniform number r permits the formation of an exponentially distributed number.
The program gen-
erates the r random number by using the function RND(o) and subtracting one, as we said before RND(o) has been tested to be
uniformly distributed, so it is appropriate to use it, in order
to produce exponential random numbers.
Note that this method is simple to program, yet it is very
time-consuming because it involves the calculation of the natural
logarithm function.
For a better understanding of the process, suppose that it
is desired to generate random numbers from an exponential
~o
f·
(t)
t
0
Fig. 3. The density function of the exponential distribution
31
. Fx { t)
1.0
- - -
t
0
Fig. 4. The cumulative distribution function of the exponential distribution
32
distribution with A= 1.
Then:
Fx(t) = 1 - e-t
t >0
F- l (a) =(-l) 1n(l - a)
1
Now, if a uniformly distributed random number, say 0.0214,
is generated by using the function RND(o), the desired random number from the exponential distribution would be:
X
= (- } ) 1n ( 1 - 0. 0214) = - ( -3. 861 3)
x = 3.8613
If the user selects to use the exponentially random numbers
generator, it is necessary that he enter the value for A.
This is
very helpful for the user because he will have the numbers
that are really needed when the value of A is entered.
In Appendix S, a· copy of each of the s.ubro'utfries that
evaluate the four basic methods to generate random numbers.
These subroutines are part of the program, they are written in
BASIC, and can be used in almost every computer.
CHAPTER IV
NON-PARAMETRIC TEST
A non-parametric procedure is a statistical procedure that
has certain
desir~ble
properties that hold under relatively mild
assumptions regarding the underlying population from which the
data are obtained.
The rapid development of non-parametric statistical procedures may be traced in part to:
First, a non-parametric method
required from assumptions about the populations from which the
data are obtained.
Second, non-parametric techniques are often
easier to apply than normal theory counterparts.
Third, non-
parametric procedures are often quite easy to understand.
Fourth, non-parametric procedures are applicable in situations
where the normal theory procedures cannot be utilized; in other
words, many of the procedures required not the actual magnitudes
of the observations, but rather, their ranks.
Fifth, although
at first most non-parametric procedures seem to sacrifice too
much of the basic information in the sample, theoretical investigations have shown that this is not the case.
More often than
not, the non-parametric procedures are only slightly less efficient than their normal theory competitors when the populations
are normal, and they can be mildly and widely more efficient
33
34
than these competitors when the underlying populations are not
normal.
Some of the advantages of the non-parametric procedures are
given below:
1.
Since most non-parametric procedures depend on a minimum of assumptions, the chance of their being improperly
used is small.
2.
For some parametric procedures, the computations can be
quickly and easily performed, especially if calculations
are done by hand.
Thus, using them saves computation
time.
3.
Researchers with minimum preparation in mathematics and
statistics usually find the concepts and methods of nonparametric procedures easy to understand.
4.
Non-parametric procedures may be applied when the data
are measured on a weak measurement scale, as when only
count data or rank data are available for analysis.
Non-parametric procedures, however, are not without disadvantages.
The following are some of the more important disad-
vantages:
1.
Because the calculations needed for most non-parametric
procedures are simple and rapid, these procedures are
sometimes used when parametric procedures are more appropriate.
Such a practice often wastes information.
35
2.
Although non-pararretric procedures have a reputation
for requiring only simple calculations, the arithmetics
in many instances is tedious and laborious.
The computer program utilizes two kinds of non-parametric
tests; the first one, when the number of observations are greater
than 20, and the second one, when the number of observations in
the sample are less than or equal to 20.
The program selects
two categories used to group the sample data, above or equal to
the median and below the median.
Medi an of a Dis tri b_uti on
In many scientific problems, it is desirable to describe
the probability distribution of a random variable in a concise
form.
Some of the properties of the distribution function may
be used to describe some features of the random variable under
consideration.
In many situations, knowledge of these functions
or some of their properties is all that is needed in order to
make the required probability calculations.
Th e med i an of a random var i ab 1e X i s the va1ue
that fit)
=
1/2.
11
t 11 s uch
The median always exists if the random varia-
ble is continuous, whereas it may not exist if the random varNow, suppose that a sample (X 1 , x2, ... ,
X2n) of size 2n is drawn from a population having probability
density function f(x). The order statistics of this sample is
iable is discrete.
given by:
36
Figure 5 shows the representation of the order statistic,
in this case, the median value is the value that the variable
Xn+l takes.
The computer program uses 3 different subroutines in orde r
to evaluate a median from a sample of numbers.
First, sort the
numbers in ascending order . Second, calculate the median .
Third, find the values above and below the median .
The first subroutine that sorts the numbers in ascending
order works by comparing each of the numbers to one another;
this procedure takes a lot of time when the number of observations
increases, but it is necessary to do this in order to evaluate the
median in the following subroutine.
Calculating the median becomes easier when the numbers are -·
already ordered in ascending order; the program divides the total number of observations by two, and takes that value into an
integer variable, then divides the total number of observations
plus one by two and takes that value into another integer variable.
If these two variables have the same value, the program
takes the number that is represented by first integer variable
and is added to the number that is represented by the second
variable plus one and all this quantity is divided by two, and
that value becomes the median.
If the values of the two inte -
ger variables is not the same, the program takes the number that
37
ME = median
µ
ME
F~gf
5,
= mean
µ
The median of a distribution
38
is reported by the second variable and that value becomes the
median; a copy of these subroutines are available in Appendix B.
After the median is calculated, the next subroutine will
evaluate the number of observations that are above the median
and below the median
by simply comparing each number with the
value of the median already found, and as the numbers are ordered
in ascending order, the process becomes very easy, and the program stores in N the number of observations that are greater or
1
equal to the median and in N the number of observations that
2
are less than the median. '
Now, the program utilizes a subroutine to evaluate the number of runs.
The number of runs are the number of times the se-
quence of numbers changes in order.
Each number that is generated
or entered is compared with the median.
If the first number, for
example, is above the median, a run is counted.
ber is above the median, no run is counted.
If the next one is
below the median, a run is counted, and so on.
stores in
11
If the next num-
The program
IR 11 the number of runs that will be used in the non-
par amet r i c te s t.
... Central Limit Theorem
The central limit theorem plays an important role in the
non-parametric tests that the program uses in order to determine
the randomness of a certain sample of numbers.
Let the random variables x1 ,
x2,
... , Xn be independent
39
with means µ 1 , µ 2, ... , µn, respectively, and variance 0 2, 0 2,
1
2
2
... , 0n ' respectively. Consider· the random variable Zn··
n
zn
=
n
L:.1= 1 X.J - L: 1=
• l µ.1
Then, under certain regularity conditions, Zn is approximately normally distributed with zero mean and unit variance.
The sample means from random samples tend toward normality in
the sense just described ·by the central limit theory, even if
x.1
are not normally distributed.
It is difficult to establish sample sizes beyond which the
central limit theorem applies, and approximate normality can be
assumed for sample means.
This, of course, does not depend upon
the form of the underlying distribution.
From a practical
point of view, moderate sample sizes, like 10 or more, are often sufficient.
Runs Above and Below the Median
In many situations, it is desired to know and conclude that
if a set of numbers are random, this test will run above and
b~low
the median and will tell the user if the sample under
observation is or is not random.
The program uses a normal approximation for large samples;
and the assumption is that a large sample is the one that has
more than 20 observations in one sample.
40
The procedure to determine randomness is as follows:
sample of numbers can be drawn from different options.
The
One
would be generating "random" numbers from a uniform distribution,
utilizing the RND(o) function from the TRS-80, or using the additive subroutine.
A second would be generating "random" numbers
from a non-uniform distribution, utilizing the normal distribution,
or using the exponential distribution.
from all the distributions.
Another would be a mix
Finally, the last would be that the
user provides his own sample to be tested.
Once the numbers are in the program, the next step is to
calculate the median.
To calculate the median, first the pro-
gram uses the subroutine sort to order the numbers in ascending
order.
Then it is relatively simple to calculate the median.
At last the subroutine "values above and below the median" will
find the values for those variables N1 and N2 ; N1 number of observations above or equal to the median and N2 number of observations below the median.
Then the program uses the subroutine
to calculate the number of runs.
Now the program is ready to
use the non-parametric test.
The program asks if the total number of numbers or observations above or below the median is not greater than 20, if
so, it proceeds with the test, Runs Above and Below the Median,
using a normal approximation for large samples, based on the
central limit theorem.
41
Let U denote the total number of runs in the sample N ,and
1
N2 , the sample observations above or equal and below the median,
respectively.
The test statistic, U, is asymptotically normally distributed, if the ratio of N1 and N2 remains constant while both
approach infinity . Further, the mean and the variance of U is
given by:
Mean
E(U) =
Variance
VAR(U)
+ 1
2*Nl*N2(2*Nl*N2 - Nl - N2)
= .(N + N ) 2 *(Nl + N2 - 1)
2
1
The mean and variance are calculated in the program, and
then a test of hypothesis is made (see Figure 6).
The Null Hypothesis is:
Ho:
The observed sample is random
A two-tailed test for the hypothesis of randomness is made
at a 5% level of significance.
This means that 5% of the time
we are going to commit an error or reject the Null Hypothesis,
given that the Null Hypothesis is true.
The rejection rule for rejecting the Null Hypothesis is:
!Observed value of U - E(U) I -> Za/2
VAR (U)
...
where Za/2 is the value of the standard normal distribution,
and its value can be obtained from the Table in Appendix C, and
a means the significance level of 5%.
42
fig. 6. A two-tailed test of hypothesis
43
Z a/2
= Z.025 or Z.975 = 1 .96
so the rule stands as follows:
!observed U -
E(U)I~
1 .96
VAR(U)
If this happens, the sample is not random.
Otherwise there
is insufficient evidence to reject the Null Hypothesis and conclude that the sample is random.
Wa 1d-Wo1 fowi tz Run Test
Run theory can be used to test whether two random samples
come from continuous and identically distributed populations.
Now recall that the above test was used when the number of observations were greater than or". equal to 20, and the program
assumes that the above asymptotic normal approximation is not
valid for N1 or N2 less than 20.
For the values of N1 and N2 less than 20, the test and the
program uses tabulated values of the Wald-Wolfowitz total number of runs.
The program stores in the memory the following
quantities of W.025 and W.975 that are two different tables for
different values of N and N2, and it varies from N1 equals 2
1
to 20 and N2 equals 2 to 20. A copy of these tables are in
Appendix C.
A two-tailed test for the Hypothesis of randomness at the
5~
level of significance, where the Null Hypothesis is:
Ho:
The observed sample is random.
44
The r ejection rule is given by rejecting the Null Hypothesis.
If W.025 > observed value of U > W.975, the sample is not random.
Otherwise, conclude that there is insufficient evidence to reject
the Null
Hypothesi~
or the sample is random where U is the number
of runs.
The test will reject the Null Hypothesis either due to too
many runs (rapid fluctuations) or due to too few runs (slow undu1ations).
Both of these forms of non-randomness should be in-
vesti gated further for possible assignable causes.
When the to-
tal number of runs does not differ significantly from the expected
number of runs of a random sequence, the run test fails to detect some types of non-randomness.
Finally, the user has the option to select a hard copy of the
number already tested, so the final printout will include:
the
sample is not random or there is insufficient evidence to suggest
that the sample is not random, due to the test already done;
the number of numbers that already have been tested; the number
of runs; the values of N1 and N2; the value of the median; the
value of W.025 and W.975 if N or N are less than 20 observa1
2
tions; and finally, as an option a list of all the numbers already tested.
A copy of the computer printout is in Appendix
B for reference.
CHAPTER V
SIMILAR METHODOLOGIES
Much research has been done in generation and testing of
random numbers.
There are several authors that treat these subjects, such as Geoffrey Gordon, 5 Stanley Greenberg, 6 Joseph ··
Schmidt and Robert Taylor, 7 just to mention a few, that generate and test random numbers.
Several different tests have been proposed by various mathematicians and statisticians which provide the tools to statistically validate the randomness of the set of numbers for a given
set of conditions.
Most of these tests are related to two general
statistical tests:
A Chi-square test or the Kolmorogov-Smirnov
test.
The effect of random number generators on applications gen-
erates numbers from four different methods and uses seven different tests to test for randomness for an application system. 8
5Geoffrey Gordon, The Application of GPSS V to Discrete System Simulation (Englewood Cliffs, NJ: Prentice-Hall, 1975), pp.
333-336.
6stanley Greenberg, GPSS Primer (New York: John Wiley &
Sons, 1972), pp.. 34-37.
7Joseph W. Schmidt and Robert E. Taylor, Simulation and Analysis of Industrial Systems (Homewood, IL: R. D. Irwin, 1970, pp .
215-254.
8Edwin G. Landauer, "The Effects of Random Numbers on Appl ications11 (Research report, University of Central Florida, 1980).
45
46
This research report presents first a test for a microcomputer
random number generator using eight different tests via a computer
program and then presents a different way to generate random numbers from different sources.
numbe~
First, the user can select the
from a uniform or non-uniform distribution, from a mix of
those two distributions, or their own numbers.
This research uses a different kind of test for randomness.
A "non-parametric test" is used, no matter from which distribution they came; it can be uniform or non-uniform.
These programs
are very helpful, especially when the user wants to test a sequence
of numbers from an undertermined distribution.
CHAPTER VI
CONCLUSIONS
For the first computer program which is in Appendix A that
tests the Radio Shack random number generator for randomness, it
was found that this generator can be considered as acceptable
and reliable based on the sequences of eight tests performed.
The test runs of length for above and below the mean were found
to fail 12.5% of the tirre the program was processed.
The test
for autocorrelation, the Gap test and the Poker test fail 5% of
the time.
The Yule's test was found to fail 2.5% of the time
and for the goodness of fit test, the Kolmogorov-Smirnov test
and the test runs above and below the mean, it was found that
they had no failures.
This Radio Shack random number generator
is used to provide the seeds to generate uniform and non-uniform
numbers in a reliable form.
The second computer program, which is in Appendix B, provides uniform random numbers, non-uniform random numbers, a mix
of random numbers from these two distributions, and the user's
numbers to be tested for randomness using a non-parametric test
with two approximations:
for large numbers of observations,
the test runs above and below the median and for small numbers of
observations, the test Wald-Wolfowitz Runs test.
47
48
This non-parametric test is also highly reliable because
it can test any sequence of random numbers.
11
11
Therefore, it
really does not matter from which distribution the numbers
came from, they can be tested for randomness.
This can be very
helpful because a lot of times the users do not know from which
kind of distribution the numbers that are to be used came from,
and these computer programs give them the possibility to test
the number before drawing any conclusions, and makes their simulation experiments more reliable.
APPENDIX A
COMPUTER PROGRAM AND PRINTOUT FOR
TESTING TRS-80 RANDOM NUMBERS
I
•
PfiOG~AM
WILL TEST THE
FU~CTION
RN~<O>
FOR
RAi~DGMNE35
USING B OIF
(.2)
1
fLPRINT
.05•:Lf'RINT
FOf-( .oi·;o
NJNBiRs·:(rRINT •
FOH .os lm
LEVC:l. OF SlGNIFICAr.CE FOR lHE TESl'S
(1)
TESTING-;N;•
51Gt-!Ir' ICAH1~ E.r
LF'~INl
•
·T~STING
• l Lr·rGr. T. •
THE
FU~CTIO~
<' =. 799999
tHC> < =.~i9S999
A<C><=,69t;99~
THEN X7=X7+1S&OTG
2~0
290 NEXT C
THE.N X8 =XU ·t-1! GOTO 29(i
270 IF tHC, > =.B f.ND AH'h=.f399?'T'l HIF.N X'l=X9+UG010 290
200 IF A<C> > =.9 AN.:> A<C><=.991f991 TllE" XlJ=X0+1
1)i.fJ tH C >
AND
ANO
HIEN X6=X6+UGOTO 2.'10
290
;.'.9(j
X5=)(~dJGOTO
AMO A(C><=,39999c;
Xi=X~+1ft0f0
2~tt
T~EN
X2=~2+1SbOTO
~90
GOG~NE55
XJ=XJ+12GUTO
ThE
(\Nii A<C> < ==.'lc;9c;c;9 lHtt-4
A<C>-:..=,L9"'7'99 HIEN
lHEH
ThE~
USI~G
290
ANf1
210 IF A<C>>::1,2
220 IF A<C>>=.3
z::io IF A<C> >=.-'f
2'l0 IF A<C> >=.5
~50 IF A<C> >=.6
2td1 IF A< C >>=. 7
A<C><=,19999~
RND
X~=X3+1S&OHi
AN~
IF
A<C> > ~.1
~~O
tao FU~ C=1 TO N
190 IF A<C>>=O AN~ A<C><=,G99999
•
170
INT
u~
Fil' TEsr·:
l .f'RIN I'
l:JO GO'J 0 1 "10
1::19 LF HINl •
, 01 • :Lf'Rl.NT • •
LEV£L. OF SIGtHrI1\CNCC: FOH THE TESTS
: Lf'RINT • I
1qo FOR B=J 10 N
1::;11 XH == RNl> ( 0 >
1 ~; 1 A ( E: ) =XI~
1t',O NEX I' E.
161 fRIHT 1 TESTING THE FUNCTION RNJ USING ThE GOOO~i~S OF FIT TfST'IP~INT • •:PR
.i~U
LF'Rli-11' •
: LFfUNT • •
13'1 U1f'LT 'INeUT n~E: LEVEL OF
1~5 P~IhT • ":PRINT
130 IF 0=2 fHih 139
13~ LP~INT.
~(20)
1~0
IN?UT "HOW M~N¥ NUrilE~S VO YOU WANT TO TEST. F~EASC: USE HLiLTIPLE5 OF 1o•;N
132 &IM A(N+~O>rBiiN+2U),RCri>rS<N>rT<N>r~<N>,ALZ<H>rF3%<H>rF1<H>rB<N+20>rGJ<N>rI
12(j f'HHH
FEHE::NT TEt>Ts•
YO CLS
10fi DIM OD(JO>
110 PRINr ·THIS
U1
0
LPRINT • 1
3~0
INTERV~L
OES~"VEO
FROM ,OTO .099999 EXPECTEO NUH~ER OF DATA•;E;•
N0Ht£R OF DATA•JXllLPRI~T • •
301 LPRINT • 2 IHTERVAL FROM .1 TO .199979 EXPECTED NUMBER OF DATA•JEJ•
OBSERVED NUM B E~ OF OATh•JX21L~RINT • •
302 LPRINJ • 3 INIE~VAL F~UM .2 TO .~9~99~ EX~ E ClEO ~UH8ER OF OATA•;E;•
OESE~: VEiJ NLIM::£f\ OF OAT~\
. · c~ I U'RINT • •
303 L.F'RINT • .If INT ERV1·' L F"Orl .3 TO .:~.,,c;i•;99 EXF'f..CTEIJ NUl11:.n: OF CMl•'' a :1 •
or::~ifi~VEi) NUMBER Or DATA.: >.-i: Lf.'JU~T
• •
304 LPRINT • 5 INTERVAL FROM ,4 TG ,4999~9 EXPECTE~ NUM8ER OF DATA.#E;•
OB5~~VEL NUHB~R GF OATA•;x~:L~RINT • •
305 LPRINT • 6 INTERVAL FROM ,5 TU ,599999 EXPECTEG NU~BE~ OF OATA•JE;•
UB5iRVED NUHB~R OF OATA"1X61LPRihi • •
306 LPRI~T • 7 lNlER~AL FROH .6 TO .69i999 EXPECTED NLMBER OF DATA•JEJ•
OBSERVE~ NUH0ER OF DATA•Jx7:LPRINT • •
307 LPRINT • 9 INTEkVAL FROM ,7 TO ,79~999 EXPECTE~ NUHB~" Of DATA'JE;•
OES~RVE& NUHBER OF DATA";xa:LPRINT ••
309 LPRINT • 9 INTERV~L FROM .a TU .~99999 EXPECTED NUMBER OF OATA.IE;"
OSS~RVED N~MLER OF OATA•;x~:LP~INT • •
309 LPRI~T •to I~TERVAL FROH ,9 TO ,99~999 EXPECTE~ NUM~ER OF OATA.#EJ"
OE:SEf<V£t· NUlil::f.I' OF OAl H•; X0 I LPR.lt'4T • • l LF'h:It-t T • •
310 CS=(((X1-E>l2)/f.)+(((XZ-E>C2)/E)+(((X3-E>C2>1E>+<<<X1 - E>C2>JE>+<C<X5-E>C2>1E
>+<<<X6-E>l2>1E>+<<<X7-E)[2)/E)•(((XU-E>C2)/E)+<<<X9-E)[2)/E)+(((XO-E>C2J/E)
E=N/ 1 O
29~i
U1
........
~10
W~LUE·
JF!Lf'FUN
•
•oBS~RVED
Sf'F<HH • •
501 LPRIHT ·TESTING
•I Lf'RIIH • •
~90
THE FUNCTION RND USING THE
KOLHOROGOV-5HIR~UV
KOLHO~OGOV-SHIRNCV
TEsr·:LP~IHT
•
TFsr•tPRINT ••
CHI-SOUARE VALUE·;cs,•tHEORETICAL CHI-SGAURE VALUE·;r:LPRIN
LPRINT • •:tP~INT • •:tPRINT • •
500 PRINT ·TESTING THE FUNCTION RND USING THE
T •
160 LPRIHT
'170 LF'RlNT
Lf'~JNl •oeSERVED CHI-SQUARE VALUE·;cs,•THEORETICAL CHI-SOUARE VALUE•JF!LPRIN
T • •:tPRINT • •JLF'RINT • •:LPRINT • •
'151 GOTO 500
160 LPRINT •tHE FUHClIOh RND DID NOT PASS THE GOODHESS OF FIT TEST•
'150
'Mo Lf·rntn • •
'120 IF CS >F THEN '160
'130 LPRINT ·TH£ FUNCTION RNO PASS THE GOODNESS OF FIT TEsr·:co=C0+1
'HO F=Z 1•666
101 GGlO 500 _
T • •tlf'RINT • •JLPRihT • •:tPRINT • •
39'1 lf'RHtT • •
100 Lf'fUrH •CJf;St:RVECi CHI-SCWM,E VAUit:• ;cs, •ntEOt.:ETICAL CllI-SDUARE
3'10 IF CS >F THEN 380
35t LF·rat..T • THE FUNCTION RND f'A55 Tift GOOlJUES5 or FIT TEST. : CO=C0+ 1
360 l.F RINT • •
370 l.fRIHf ·oBSERVfD CHI-SOllA~E VALUE•Jcs.·rhEO~ETlCAL CHI-SOUAR£ VALUE·;FJLPRIN
T • • J Lf·t;UH • • J LPRINT • • SLF'RlNT • •
371 GOTO 501i
3fJ\J LPRINT •THE FUNCTION ~NO 010 Hi.lT f'A5!J 'IHE GUOl>NES5 OF Fil TEST•
320 IF 0=2 THfN
330 F=16.919
U1
N
... )'3/N
6'5 0
ANO
~NO
AM>
ANO
ANO
AN~
AHO
llN~)
N
AND
AN 0
C >=:
A<G>=
A<G>=
A<G>=
A< G >=
A<G>=
A<G>=
AC&>=
A<G>=
A<
A<G>~
66Ci Z'l=Z~:l+Y'l/N
670 Z5:::Z'f+Y5/N
60( Z6:::Z5 ·t-Y6/N
,t)'lO 1.7=l..6+Y7 /N
700 ZB=Z7+Y8/N
710 Z9=Zet+Y9/N
720 ZO:::Z9+YO/N
730 DO<l>=AbS(.1-ZJ>
7'10 00(~)=ABS<.2-Z2>
75fi DD<3>=AtS<.3-Z3>
760 D~(1>=AB5(.1-Z1)
770 0~(5)=ABS<.5-Z5>
70fi OD<6>=ABS(.6-Z6>
790 D~<7>=ABS(.7-Z7>
BOO DD<B>=AES\,0-Z6>
916 00<9>=AL5C.9-Z9>
92[1 0u(111>=Af:5(1-ZO>
z3,,.~z;:
ZZ=L:l+Y~/N
FO~ G=1 TO
IF A<G> >=O
IF A ( G >> • 1
IF A<G>>.2
IF A<G>>.3
IF A<G> > .1
IF A ( G) >. 5
IF A<G> > .6
IF A<G>>.7
IF A<G> > .8
IF A(G)).9
NEXT G
Zl=Yl/N
610
6:30
600
610
620
590
SU~
5SO
560
57 0
5·10
S :.;o
5~0
510
.1
.5
.6
.7
.B
.9
1.
'f~~=Y3+UGD1C!
62U
THEN Y'l = Y~+11GOTO 620
TllEh 'f5=Y5•·1SGOTO 6;: o
THEN Y6=Y6+1:G~TO 620
HIEN Y7=Y7+1 tGOTO 62Ci
THfN ¥8=YB+1:GOTO 620
THfN Y9=¥9+1lGCTO 62n
TBi::N YO=Y0+1
.:3 lHEH
• 1 n IEH Y1 = Y1 + 1 : GD T0 6 ~! 0
.2 THiH Y2~t2+11GOTO 6~0
w
U1
l.H<INT
CUM~LATlVE
OIFFE~ENLE·;~~<2>
·rHEG~ETICnL
OIFFEREHCE·~ooc1>
DlFFiREN~t·;oo~q)
OIFFERENc~·;oo(5)
FRE~U~hcv·;z
1
DE:SERVEl>
CUMULATIVE FREOUEUC't' •; Z
CUMULATIVE FREOUENcf•;z
OBS~RVEO
FREO~Ewcv•;z
CUHULATIVE
UBS~~VED
DIFFERENCE·;ooc7)
Lf'RINT
CUNULATIVE
CUMULATIVE fHECWHICY
..
FREO~ENCY
OlFfERENCE.i00(10>1LPRINi
•THC:Clr\t::llCAl ..
OIFFERE~cE•;ooC9)
•THEORElIC~L
OIFFE~EHL[•;o~<B)
OBSE~VEO
CUMULATIVE
F~EUUENcv·~z
FRiOUE~t)•;z
. ..
1 OBSERVED CUMULATIVE FREOUENcv•;z
.9
GOf.JUE 501i0
93i; l.F'RliH • Ht-)X:lHdh OIFTERENCC: W\UJE •; 00 ( 10) t LPRHtl
e:rn
0; •
EJ:17 LPRINT
9;.
U:36
9;.
B35 L.f·RINT •THEORETICAL CUMULATIVE FRECUENCY .B OBSERVED CUMULATIVE
7;.
0:13
Lf"RINT • THEDj;f.TICAL. ClkttlU'HIVE FJ\El1EL IKY .6 OBSERVED CUM~LATI~E FREOUENcv·;z
6;•
OIF• ' E~EN:E·;oo<b)
931 LPRINT •rHEORETIC~L CVM~LATI~E FREOUENCY ,7 OSSE~VEO C:UHULAflV[ FREOUENcv•;z
.,..JI
932 l.F'RIN T • H1£'1F.E'I IlA1_ CUMULATIVE FRE::OUE::IH:Y , 5
..
1; •
C~HULATIVE
FREQLENCY , 2 OBSERVED CUMULATIVE F. HECHJl::i~n •I 1.
930 Lf·RINT •JHEORETILAL CUMUL~TIVE FREQUENCY .3
3;.
DIFrt:.;;:twcE:•;oocJ>
831 l.f'fUNT ·1HEQRETI~AL cu~~LATIVE FREQUENCY .1
.,a:.,
tJ;~9
..
1; •
928 LF'RINT • TtlE:ORETICAL CUt.ULATIVC: FREOUENC Y .1 OBSERVED
~
U1
•
•
KOLHOROGQ~-ShlR~OV
Lf'r.~IN
f
LPRI~T
·oBSERV~D
• •
• •
ICOLMOROGOV-SM
HIRNOV VALUE•;FFlLPRihT • •:LPRIHT
1010 Lf'1\IN1 • • SLF'f<INf • •
FUNt"lIGr~ RHO DIO NtH f'AS9 1 UE ·~Od10ROt,OV-SMIRNOV TEST.
102 fi LF'"INl • •
1030 LPRJNT ·oBSERVEO KOLHOROGOV-SHIRhOV VAL~E·;oo<tU>i•tHEURETICAL ~OLHOROGLV-5
10 0 0 lf'f<IiH
1u10 LF'r\IIH • ·rnE:
•:LP~I~T
TEST ·:co=CG+l
VALUE·:oo<tO>J•THEO~ETICAL
KOLHORUGO~-SMIRNOV
KOLHOROGOV-SHIR~OV
IRNOV VALUE•tFFtLP~INT •
991 GOTO 1010
990
900 LF'RINT •
KOLMO~OGOV-GH
THE KOLMOROGOV-SHIRNOV TEST•
UALUE·;~0<10>;•JHEORETICAL
P~55
HOLHORGGOV-SMIR~OV
~OT
IRNOV VALUE•iFF!LPRihT • •:LPRIHT
931 GOTO 10"10
916 FF=t.63/<Nt.5)
956 IF OD<tO> >FF THEN 1000
970 LPRINT ·THE FLiNCT~ON RNO PASS THE
920 Lf'Rif-.cT • •
930 LPRI~T ·o~SER~ED
910 LPRIHT •TH£ FUNCTION RHD DIO
9 O0
b91 GOTO 10"fti
hUU-11..h~OGOV-SH
TES1·:cD=co~1
•OE: SERVED f(OLHURot;OV-Sf'IIi(NOV W\llJE •JO() ( 10 >S • THEORl Tl CAL
l:f.;NDV IJ,:•LUE • ; FF I LF't\INT • • : lf'fUNl • •
OlJD LF'f<IiiT
B 1iO LF'F\INT
R10 IF 0=2 GGTQ 916
B12 FF=l.~6/(NC.5>
B50 IF 00(10> >Fr ThE~ 900
970 LPRIWT ·r~i F~NCTION R~D PASS THE
Ul
Ul
·n:slING
• •fLPRINT
1060 FOR C=1 TO N
1050 l.F'f<IrH
ABOVE: HIE
mm
MEHU•;N1:•NlJi1?.EJ~
RUMs·11~!LPRINT
HA~<<2•hi*h2)/CN1+h2>>+.l
1270
••
1310 ZZ=•'E:~. <ZA>
1320 IF 0=2 ThEH 113t
1330 ZX=l.96
1292 LPRINT ·HEA~ VALUE•JttA;·sTANDARO DESVIATION VALUE·;s~:LP~IN1
13t0 ZA=<<IR - HH>/SO>
1290 XX=<<~•~1*N2>•<2•~1»N2-N1-N2))/((<N1+N2>[2>•<N1+N2-J>>
1290 SD=<XXH .5
1262 LrRIHf ·NUMBER OF
IR=IR+1
1~60
NE:<T ..I
1=1 .
GOTO 1260
IF A<J> > M~ THEN
IR:::If<+.l
J~2
TO N
GOTO 1190r1230
IF A<.J><Ht: HIEN 1.260
IF A<J>=ME THEH 1260
1=2
FOR
ON I
1170
1190
1190
1195
1200
1210
1220
1230
1210
1250
1260
1166 I=t:JF,:::1
OF DATA
E:ELUl.f THE HEAN•
USING THE TEST RUNS AHJVi. Alm f.ELCJW THE ME
1150 IF A<l> >ME THEN I=21 IR=1l GOTO 1170
1110 Nl=Nl-f-1
1120 GDlO 11'10
1130 N2 =N2+ 1
1 l'f •i NEXT H
11'12 LF·JUi'fl" •Nt.kffEI~ OF OATf\
; NZ SLF·RHH • •
1090
1ti82.
HE>=E.E/N
FGR H=1 TO N
1100 IF A<H> > =HE THEN 1130
10£10 NE:<T C
1070 EE=EE+A<C>
A~·:LPRINT
THE FUNCTION
•TESTING THE FUNCIQr.f F\NiJ USING THE TEST J\:Ul·!5 tiHlVE AIUi [:ELO~ THE HE.Al'4
•:FRINT • •JPRINT • •
l 0"15 PRINT
Ul
(j)
LPR~hT
FU~CTIO~
RNO
11?0
1160 LPRINT ·THE FUNCTION RN0 PASS THE TEST RUNS
A~GVE
GCITU
f'AS5
J;;t.Ji~S
AlWV[ AND f.E:LOw
THE: Ht.A
• 'LHUt'tT
NEAN•tcu~co
z VAL Uc.; zx: Lf'Riifl • • : U:"Rltfl
Tiff TEST
zz'. HIEur&:TlCl\L
RNO DIO NOT
Lf'RINT
u: l:.:Ii'IT • Oc:SLt;:V[[) L VALUE.:
FUhCTHU
1530 LPRINT • •:LPRihT
1 ~i20
1~10
N•
·THE
153u
1 ·1~0 Lf'RH.fl"
1500 Lf'RTi-41"
1'101
•
AMO BELOW THE
1'170 Lf'RINT • •
HBO LF·,;nn • OE:SE.RIJED z VALUE.; Z7'. THEORC:~" ICAL. z VALLIE.; zx: LF'Rlf'.IT
-t· 1
AN0
• !LF'RlNT
MEA~·:to=CO
BEL&W ThE MEA
TH~
Z \J•kUt::• Vi'.XILF'RINT •
BELOW
DID NOT PASS THE TEST RUWS A8CVE
Vi.: z, •THEORETICAL
A~~
·oPSERVEO z VALUE•;zz,•rHEORETICAL z VALUE·;zx:LfRINT • •tLPRIHl
•rHE
1'12~ GOTO 1530
1-130 ZX=i. 57
1'l'I0 IF ZZ>ZX THEN
1120
1 '110 Lf'RitH
N•
1 1&0 Lf'RINT
1390 LF'FdiH
D70 LF'fUIH • •
1 380 LF'IU1H •(lf;5i:RVH1 Z VALUE•
D02 GOTO 153t
+1
1360 LPRihT ·THE FUNClION RND PASS THE fE3Y R0hS A8UVE
13"10 IF ZZ>L:X lHEt.. 1:;c;o
U1
-.......)
• TESTll~G THE FUNCTION Ri.fl) USING TUE TEST fhJNS OF l.EHGt-tl Ff,R Al::OJE ANri
E1 = k~<LC1>•0
16~0
ON LH Garo
167Gr160~.1690r1700 .
1/ 3 0
P2=P2+1lLH=O:cu ·ro 1730
P1=P~+i:LH = O
U3~G3+1tGM=O:GOT~
Hno CM==IM+l: Gri==O
1830 IF .J=N ntE:.N 17o0
1El'1 0 N f. >Cl J
1B10
1810
1700 GGTO 10"10
1790 01=01+1:GM = O:GOTU 1B10
11100 l12=1~2+1:GH::::OIGOTO 1810
1750 lF A< J >::t·r11E TlfEN Gti=Gt-1+1 I GOTO UJ:; (i
1760 ON GH GOTO 17?fir1UOOr191~r1620
1770 IF GH > -l HIEN .1.920
17JO IF J=N TH~M 16~~
1730 NEXT ..J
1710 FCP J=1 TO N
1700
16YO P3=F'3+1iLH=OtGUTO 1730
l h~fi
1670 Pl=Pl+llLH=OtGOTO 1730
1 b /, 0 G Li T 0
1650 IF LH >1 TrlEN 1700
16~0
1630 IF A<.D <tit:: TH[N LH r-' LH+l tGOTO 1710
1620 FOR J=1 TO N
E3~~•<LL3)~0
1590
1 515 E 1 ""'•~:.. u( o
15b0 E~=K•<LC2>*0
1560 lc,_.1/N
1 5 7 (j 0 = <N 2 /I~ >[ 2
E:ELOM HfC: MEi\N •I f'RHH • • : PRINT • •
15'10 LF'tUNT • TF.~TINC, HIE FUl4CT1lli>f f<1·m USING THE TEST F<UN9 Gf=" LENL;hl FOf< At:OVE AN
D BELOW THE
M~~N·:LPRINl • •tLf'~INT • •
1~'i50 f{=2lt.'H
15:;5 f'RINT
(.]1
co
OATA•Jc
DATA.JC
INT ' • I lf'RINT
Z010 GOTO 210J
2000 LPRINT 'OBSERVEO
1990 LF·RINT • •
CHI-SQU~RE
TEST'lCO=C0+1
VALUE'IELJ'THEORETICAL CHI-SOUARE VALUE.IABtLPR
1960 IF EL >AB THEM 2020
199fi Lf'RINT •THE FUNCTIOH RHO PASS THE RUNS OF LENGHT
.
OATA•Jc
OATA•Jc
1930 EL=<<<C1-E1>C2>1E1)+((([2-E2>C2>1E2>+<<<C3 - E3>C2>1E3>+<((C1-E1>t2>1E1>
l.910 IF 0=2 TUEt.t 2070
1. 950 AE:=7. fH 1~~
'lllf'RINT • •
1692 LPRINT • 1 IhTERVAL EXPECTED NUMBER OF OATA•JEtl•oeSERVEO NUHBER OF
1
1083 LP~INT • 2 INTERVAL EXPECTED NUMBER OF DATA•JE2;•0BS£~VEO NUMBE~ OF
2
1881 LPRINT • 3 INTERVAL EXPECTED NUMfER OF OATA•JE3;'0BSERVEO NUMBER OF
3
1805 LPRINT • ~INTERVAL EXPECTED NUHBE~ or O~TA'JE1S'OB5ERVEO NUMBER OF
1950 C1=P1+01
1060 C2=P2+02
1970 C3=P3+U3
1980 C~=f'1+01
~
U1
LPRI~T
·o~BERVED
DID NOT PASS THE fiUN5 OF LENGtlT TEST"
IF £L >A8 THEN ztq(
CHI-sgUARE VALUE•JELJ•THEORETICAL CHI-SOUARE VALUE"JAB:LPR
RN~
LPRINT ·THE FUNCTIO~ ~NO PASS THE RUNS OF LENGHt TEST·sco=C0+1
Lf'RINT • •
2120 LPRlNT •OBSERVED CHI-SQUARE VALUE•;EL;"THEORETICAL CHI-SOUARE VALUE•;ABlLPR
INT • • I Lf'FUiH • •
2130 GOTO 21811
21'10 LF'RINT
2150 LPRINT •THE FUHCTION RNO DID NOT PASS THE RUNS OF LENGHT TEST•
2160 LPIUNT • •
2170 Lf'RlNT ·oBSERVEO CHI-S~UARE VALUE·:ELJ"THEU~ETICAL CH1 - sgLJhRE VALUE"1ABILf'R
INT • • : l.F'fUtH • •
2180 LPRINT • •tLPRINT • •tLPRINT • •
2070
2090
2100
2110
2li60 GOTO 21El0
AE:=11.3't-'19
INT • • : Lf'FUNT • •
2050
2 0 '10 lf'FUNT
2020 LF'RINT
2030 LPRINT •THE FUNCTION
0
CJ)
VB=(((13•~>-C19•H))/(111•<CN-H)[2)))
2310 IF Zl>Z2 THEN
Z3~0
IF 0=2 lHEN 2130
2330 Z2=1.96
23~0
2310 Zl=ABS<<Ph-EP>IVA)
2302 LPRIHT ·HEAN VALLJ[•;Ep;•s1ANDARD OESVIATIGN VALUE·;vAlLPRIHT
2290 VA=<VB[.5)
2300 EP=.25
228U
A~
CH=CH+<A<J>•ACJ+H))
NEXT J
PH=BM•CH
LPRINT ·AUTOCORRELATIO~ FACToR•spH:LfRIMT
2250
2Z60
2270
2272
2220 AH=W-H
2230 ~H=<t/AH>
2210 FOR J=l TO
2212 LPRINT •INTERVAL SIZE TO CHECK FOR AUTOCORRELATioN•;tt:LPRIHT • •
2210 H=5
2190 PRINT •JESTING THE FUNCTION RMD USING THE TEST FOR AUTOCO~~El~TIO~·:~RINT •
•tPRINT • •
2200 LPRIMT •TESTING THE FUNCTIOH ~ND U5IHG THE TEST FOR AUTOCOR~ELATION•:LPRINT
• •tLPRINT
.,_.
°'
z
VALUE•;z1,•THEURETICAL
z
VALUE•JZ2t LPRINT • ·sLPRINT •
GOTO 2510
LPRINT • •
LPRINT •THE FUNCTION RHO DID NGT PASS THE TEST FOR AUTOCORRELATION•tLPRINT
LPRIMT ·o8SERVED z VALUE·sz1,•THEORETICAL z VALUE·;z2:LPRINT • ·sLPRINT ••
IF Z1 >Z2 THE~ 2180
LPRINT ·1HE FUMCTIOH RND PASS THE TEST FOR AUTOCORRELATioN•tLPRINT • ·:cO=C
GOTO 2~1t
Z2=2.S7
·OBSERVE~
2500 LPRI~T ·oBSERVEO z VALUE•;z1,•rHEORETICAL z VALUE•JZ21LPRINT • •1LPRINT ••
2510 LPRINT • •tLPRINT • •
2q20
Z130
21i0
2150
0+1
2160
2170
2180
2190
2110 LPRINT
2360 LPRINT •THE FUNCTION PASS RND PASS THE TEST FOR AUTOCO~RELATION•:LPRINT • •
:co=co+1
2370 LPRINT ·oBS~RVEO z VALUE•JZJJ•THEORETICAL z VALUE•Jz2:LPRIHT • ·sLPRINT
2390 GOTO 2510
2390 LPRI~T • •
2100 LPRINT •THE FUNCTION RND DID NOT PASS THE TEST FOR AUTOCGRRELATioN•tLPRINT
0)
N
FUNtHOI~
K=H+5
m-m
THE GAP
TEsr•JPRI~T
IF
K> =N THEN
~670
T<K>=t-(,9[(~+1>>
W<Z>=ABSCT(K)-S(~))
272.0 NEXl' I{
2725 GUbUE: 60fi0
~710
2705 Z= <H+ 1 >/5
2690
2700
S<K>=~C/(N-10)
GOTO 2t;10
2670 NEXT 1
2675 FOR tt=1 TO N STEP 5
26ci0 E:C=E:C-f·R <I<>
265~
2660
• ·zrRINT • •
USING THf. GAF' TEST· tLF'JUtiT • • :LF'RIIH, • •
USI~G
2650 IF AA :.~· =·~-'I ()NO A•'=<H THEN ROD=Rrn1+J lGOTli 2670
2615 AA=J-I-1
~.~'lO
263r, •{=-1
2":.i90 J::J+ 1 lIF ..J> =N+ 1 HIEN 2u7 0
2600 IF ~X<I>=ALX(J) THEH Z630
2610 IF J>=N THEh 2670
262.0 GCJTO 2590
2560 NEXl .J
2570 FOR I=1 TO N
25AU J=I
BX<J>=~<~>•10
AL~<J>eB%<J>
J=l TO N
2550
FO~
25~5
2516
2530 Lf'RiiH ·TESTING THE
2520 PRIHT ·TESTING THE FUNClIOh RND
w
Q')
03~1.36/(Nl.5>
ZBOG LPRINT • •
2810 LPRINT ·r•tE FUNCTIO~ ~ND DID NOT PASS THE GAP TEsr·tLPRINT
2020 LPRINT ·oe5ERVED FREQUENCY VALU[•;w<N>;'ThEOR~TICAL FREOUE~CY VALUE•JoJ:~rR
INT • •:LPRIHT • •
2B30 GOTO 3020
2810 03=1.63/(Nl.5)
2050 IF W<N>>D3 THE~ 2900
2070 LPRINT ·rHE FUNCTIO~ RNO PASS THE GAP TEsr·:LPRINf • ·:co=C0+1
2800 LPRlhT ·oBSEVED FREQUENCY VALUE•Jw<N>;'THEGRETICAL FREOUENCY VALUE•JD3lLPRJ
HT • •tLPRINT • •
2890 GOTO 3020
2900 LPRINT
2910 LPRIHT ·rHE FUNCTION ~ND OIO NOT PASS THE GAP TEsr•tLPRINT • •tLP~INT • •
3010 LPRINT 'OBSERVED FREGUENCY VALUE·;w<N>f •THEGRETICAL FREOUE~CY VALUE•Jo3:LPR
INT • •
3020 LPRINT • •:LPRINT • •
2790 GOTO 3020
. 2770 lPRihT ·THE FU~CTION RNO PASS THE GAP TEST·:LP~INT • ·sco=CO+l
2790 LPRINT ·o~SERVED FkfUUENCY VALUE•JW<N)J•THEORETICAL FREOU£NCY VALUE'1031LPR
INT• •:LPRINT • •
2750 IF W<N>>03 THEN 2BOU
27~fJ
2730 IF 0=2 THEN 2840
2728 LPRINT • •:LPRINT • ttAXIHUH DIFFERENCE PETWEEN THEO~ETICAL CUMULATIVE FREOUE
HCY ANO OBSERVED
CUMULATIVE FRE~UENCY'#W<h>:LPRINT • •
O"I
,+::::.
FRn~ ···
·TESTING THE. FUt~CTION RND USING THE Pm:Et; TE51. lf't\INT • • t f'JHNT • •
• rESHNC H.fE: FUHClI0i'4 RNiJ usn~G THE Pm(Ef< n :s T .: Lf JUNT • • : Lf'f\IiH •
J~ t
TO N
lS<'l>=IS<~>+t:GOlO
3230
3~~00
NEXT J
329(; IS<S>=T5<5>+t:GOTO 3230
~280
3250 IS<1>=IS<1>+1l GOTO 323G
3260 IS<2>=I5<2>+1
3270 XW=XW+l:IF XW=2 THEN IS<3>=IS<3>+1lGOTO 3Z30
3275 GOTO 323G
~n:~o Ht=o
323'1 N£Xl L
:-t2'10 GCJTO 3300
3220 Hl""O
3250,3~60,3200,3290
nm t1=2 TO 5
IF G3<H>=L THEN H1=H1+1
3200 NEXT H
321G ON Ht GOTO
31~0
3HJO
3170 FOR L=O TO 9
3 ,l 60 NEXT h
3110 BCJ> ~ FJX(ACJ)•lOOOOO>
3 12 0 FOR K=l TO 5
313~ G1=B(J)/(10CK>
:H '1 It G~!=: FIX < G 1 >
3150 G3<K>=FIXC<Gl-G2l•l0)
31112 XW=O
3100 FOR
3000 fir>=N~.fi~M
:J090 flE=t'i:«. 001
307fi OC==tUc.O;]
3 0 5 0 l~ A·=N • • 51
306iJ OE:=N)I(. '1312
30'10 LF'IUHT
3G30
CJ)
U1
EXF'ECTED NUME ER OF DATA• JOEJ • OE:SEHVEO NUtiE:ER
NlJM~fR
INT •
• l LF·fUNT
•
•
3S50 IF 0=2 THEN 3'160
3:~60 T9=9. 'fB77 3
3370 IF LO>T9 THEN 3'120
3390 LPR1NT •r••E FUNCTIO~ RNO PASS THE PO~ER TEST':LPRIHT • •:tO=CO+t
3'I 00 Lf'fUNT •oE:BERVEO CHI-SOUARE VALUE• H .O J 'THEOF\l: l ICAL. CHI-5UlJAf\E VALUE• H9: LPR
C2)/0E)+(((15(6)-~A>l2)/0A>
33.lf&
.
EXPECTED NUHE:ER OF OATA•JODJ'OBSERVED
LO=<<<I5<2>-QB)l2)/0B>+<<<I5<3>-0C>l2)/0C>+<<<IS<'l>-OD>l2>/0D>+<<<IS<5>-UE>
Lf'FUNT •
nm PAIRS
OF DA 1 A• ;rs< 3)
3335 LPRINT • THREE LIKE DIGITS
OF OATA•JHi('I)
3336 LF'Hil'#T •
FOl1R l.H{E DIGITS
OF DATA';IS<S>tLPRINT • •
3:~3.lf
EXPECTED NUHfER OF DATA•;oc:·oBSERVEO NUMBER
I6<2>=ISC2>-IS<3>•2
l6(6)=N-<IS<2>+IS<J>+IS<'l>+I5(5))
3:332 LF'F<It-.T • FOW< DIFFERt:tH DIGITS: EXF'ECTF.0 NllhE:f.R OF OATA' H1M • 085ERVED Nlltlt::t=.:R
OF DAlA· nsc6>
3333 Lf'IUNT •
EXF'ECTEO NUHE:C:R OF OATA •JOE: :• OE:SERV EO NlJHE:Ef~
ONE F'AIR
OF DATA' iIS<2>
33~0
332U
m
m
•
•
• ·
FU~CTION RNO DID
NOT PASS THE POl{ER TEST• : Lf·JnNT
·oBSERVEO CHI-SaUARE VALUE•JLOJ•THEORETICAL CHI-SOUARE VALUE•JT911PR
• ! LF'RINT
Lf'RI~T
'1010 LPRINT • •tLPRINT • •
INT
3510
•
Lf"RINT •THE FUNCTION RND PASS THE f'OHER TEST• l lf'RINT • • ICO=C0+1
LP~INT •oBSERVEO CHI-BOUAR~ VALUE•JLOJ•THEORETICAL CHI-SOUARE VALUE•JT9lLPR
INT • •tLPRINT •
3510 GU-TO lf010
352 0 Lf'l:UNT • •
3530 LPJUNT •HIE
3500
~M90
3'170 IF LU >T9 THEN 3520
3'16Ci T9=13.L767
3'f50 GOTO 'I 010
INT • •tLPRINT • •
3120 l.Pr.:IrH • •
3'130 LHUNl •THE FUNCTIOI" RND OIO NOT f'f\SS THE F'ot{Ef\ TEST• t Lf'r\INT " •
3110 LPRINT ·00GERVEO CHI-SQUARE VALUE.JLo:·rHEORETICAL CHI-SQUARE VALUE·~T9lLPR
3110 Gorn 'fo10
m
-.......)
PRINT •JESTING TH E FUhCTIGN RNO
US~NG
THE YULE'S TEsr·
LPtUNl •TESTING THE FUNCTION RND US I NG THE YULE'S TE5T9 ILF·tUNT
LPRINT ·usJNG 1 DEGR EE S OF FREEOoH·tLPRINT • •
OATA•;vtfLPRINT • •
TO 15 EXFECTED NUHE:ER OF OATA·rnz;·
DAT A• I V2: Lf'RINT • •
10 20 EXPECTED NUMBER OF DATA•;o3;•
OF OATA • i v::u LF'RiiH • •
21 TO 2.lf EXPECTED NUHE:ER UF DA ff'\• ;D.lf I•
OF OATA• ;v'l:LF'JHNT • •
25 TO 3~ EXf'ECTEO NUMBER OF DATA•105;•
OF OATA·;vs:LPRI NT • •tLP~INT • •
OF
12
OF
16
0 TO 11 EXPECTED NUMBER OF onrA·1011·
Dl=N•.134~102=N~.2027f03=N•.3256SO~=N•.2027:05=N•.13'15
'1193 LPRINT •1 INTERVAL FROM
OBSERVED NUHBER
'119.'I LPRIIH ·2 INTEf~Vf)l_ FROi1
OE:SERVEO NUHttER
1195 LPRINT •3 INTERVAL FROM
Of.:SEHVi::D NlJl1E:Uo\
'H 96 LPRINT • 'f INTERVAL FRUH
OBSERVED NUl18 ER
'1197 Lf'RIHT •5 I NTERVAL FROM
OBSERVED NUHBE~
'1192
'1130 FOR J=1 TO N
'H'tO IF F'f<,.J> >=O AND F't<J>= <11 HIEN V1=Vl+J IGOTO 't190
'1150 IF F'f<J >> =12 ANO F't(J)c ( 15 THEN V2=V2+11GOTO 1190
'1160 Ir F'f<J >> =16 ANO F·1< ..J>= <2f1 THEN V3 =V3+UGD10 '1190
'1170 IF F 1 <J) > =21 Atm F 'I< ,J >= < ~!'f THEN V"f = V1t·1: GOTO 'H 90
'1190 IF F'f(J) > =25 ANO F'l<J>=<36 THEN V5=V~+1
''190 NEXT J
1120 NEXT J
FOR J ~ t TO N
BCJ>=FIX<A<J>*100060>
FOR J 2 =1 TO 5
F1=B< J )/(10CJ2>
'tOBO F2=FIX<F1 >
'1090 F3<J2> ~ FIX<<F1-F2>*10)
'1100 IF J2 >= 2 THEN F't<J> =F'f <J>+F3(J2)
'1110 NEXT JZ
'1020
'1031i
'1032
'1010
'1050
'1060
'1070
CX>
CJ)
A£=<<<V1-<N*.1315>>C2)/(N•.13~5>>+(((V2-<N•.2027>>C2>1<N•.2027))+(((V3-<N•.
3256>>C2)/(N•.3256))+<<<V1-<N•.2027)>C2>1<N•.2027))+(((V5-<N•.131~>>C2>1<N~.1315
))
IF AE>Tl THEN 4260
T1=9. 'Hl773
'M'IU NEXT J
'f'f5 0 ENO
'1380 lf'RINT • •:Lf'RINT • •
1390 Lf'RINT ·THE FU1~cnoN rd•m 010 NOT f'Ass TUE vuLr. • s lTST • t Lr-ra;n • •
'1100 lf'RINT ·oBSERVED tHI-SOUARE VALUE•;AE;·TH£GRETICAL CHI-SQUARE VALUE•JTtlLPR
INT • •tLPRINT • •
'1110 LPRINT • •tLf'RINT • ·:LPRlhT ·rHE FUNCTION RNO PAss·•co~·TESTs•tLPRINT • ·:
l.f'RIN1 • • I LF'RIHT N; • RAW>DM NUHE.F.f.:5 • I LF'RH1T
'1120 FOR J=t TO N STEP ~
'M30 LPRINT A(J)rA(J+l>rA(,J+2>rA(J+3)
INT • •tLPRI~T • •
'l310 GOTO 'M 10
'1320 TJ=t3.2767
'l330 IF AE > Tl THEN '1330
'l3'10 LPRINT • •:LPRlNT • •
'1350 lf'fUtH • lHE FUNCTION RNO F'A!.~S HIE YULE'S TE"5 T • f Lf'r\INT • •I C:O=f:O+ 1
'l:Jbo Lf'fUrH •ot::SH:V f. D CHI-SOlJAf<E VALut:• JAE; ·THEORETICAL CHI-SOllARE VAUJE:9 HI ll.f'F'.
INT • • : LPRiiH • •
'1370 GOlO 'M10
'1280 LF'fUrH • • lLF'RJNT • •
1290 LF'fUNT •THE FUNC rION RNO DID NOT t'ASS THE YULE' 9 TEST• 1Lf·FUNT
'1300 LF'RINT •oBSERVEO CHI-SOUARE VAL.u~·:AEl.THEORETICAL CHI-SOUARE VALUE•JT1flf'R
Lf'FUNT • • I Lf'IUNT • •
Lf'J\INT ·THE Fll1..,CTION RND F'A55 THE YULE'S TEST•tl.F'fUNT. ·1co=CU+t
U·'RHH • OE:Sl~ r<VED C:HI-SlllJARE VALUE: . ' AEi • THECH<ETTCAL CHI-SOAUf\E VL.AUF.. n 1 H..PR
INT • •:LPRINT • •
1~!70 GOTIJ 41t0
'12.20
1230
12 4 0
'1250
126 0
1210 IF 0=2 THEH 4320
'1200
l..O
0)
RiH SORT
NUH~ER S
If
H=L1-J2
TO H
5130 NEXT J2
51'10 NEXT U
5150 RETURN
5120 OO<J2.)=SA
!HOO l.9:::L9-1
5110 NEXT Hl
OO<L9>=D~<L9-1>
~1=1
FO~
509~
5090
5070 L9=l1
~060
I N ASCENDING ORDER
OD<U ><OD<JZ> THEN 5050
SO'fO GO'IO 5130
51150 SA=Oldl1)
~'iU30
5010 FOR l1=2 TO 10
SOZO FOR J2~1 TO Ll
so~o
-....J
0
FO~
L1 = 2 TON
611 O NEXT J{l
6120 IH.J2>=SA
6130 NEXT J2
6HO NEXT l1
6150 RETURN
60~0
FOR JZ = 1 TO Lt
6030 IF W<L1> <M<J2) THEN 6050
6040 GOTO 6130
6050 6A=W'( L1 >
6060 H= L1-J2
6070 L9=l1
6090 FOR t'1=1 TO H
6090 W<L9)=W<L9-1>
6100 L9 =L9-1 .
6010
60fif; REH SORT NUMt:ERS IN ASCENDING ORDER
-.....J
I--'
FR~~~OH
.19999~
EXFECTED
NU~BE~
F~OH
,3 TG
NUH5ER OF
OF OATA 10
1O
15
• 49~·'999 EXf'ECTEu NUME.:Et:: OF r:t."ll Ii 1 Ci
O~TA
5 INTERVAL FRDi1 .1 TO
UB5E~VEt
0
,3999~9 EXP~CTED NLHE~R
D~TA
NUHBfR OF DATA 12
INTERVAL
OES~RVED
1
OBSERVED NUHBE R OF
0f'Tf.°~
OF DATA 10
3 INTE:R Vf'\L F' J\O r1 , 2 TO • 217 999.Y E:Xr"ECTEC- NUMJH. OF
OF DATA B
FRO M .1 TO
NUM E:E:~ r<
INTE R ~Al
OF
FROM ,O TO .0999~9 EXfECTED NUH&ER OF DATA 10
OF DATA 6
NUH BE ~
INT E~ VAL
9 DtG~EES
OBhERv'E::D
2
1
HI E: FUNC TI ON RNu USIUG TH E GOOOfllF:SS OF FIT TEST
OBSER )£ 0
1
USING
TESTI M~
NUl'lbt:f<S
LEVEL OF SIGNIFICAHCE FOJ; THE TESTS :::: • 01
TESTil'.G 1.00
N
...........
NUMBE~
OF DATA 10
F~OH
E~PECTED
NUHBE~
or
OArA 10
.B TO .9~9999 EXPECTED NUh8ER OF DATA 10
OF OATA 9
.7 TO .799999
OF DATA 12
O~SERVED
CHI-S00A~E
OF FIT _TEST
THEORtTICAL Cl4I-6QUARE VALUE 21.666
GO~O~ESS
VALLE 6
THE FUNC710N RND PASS THE
10 INTER~Al F~OH .9 TO ,99999~ EXFECTED NUHBEr OF DATA 10
OBSERVEG NUM~ER OF OATA 1V
NUH~ER
9 INTERVAL
OBSERVE~
FRO~
~UMBER
I~TERVAL
O~SE~VED
a
7 INTER~AL FROH .6 TO .6?9999 EXPECTED NUHEER OF OATA 10
OBSERVED NUMBER OF DATA 9
6 INTE~VAL FROM .5 TG ,599999 EXPECTED
OBSERVEJ N~rl~ER OF ~ATA 11
TESTING 100 NUMBERS (Continued)
t.v
-.....J
• tJi1
OBSE~VlD
tUHUL~TIVE
9.99~9iE-03
FRF~~ENC¥
.~
OSSER~EO
CW1ULMTIVE
.19
9.~99~3E-C3
.010&~01
.08
OE:SE~~EO
O~SER~EO
OBSE:RVfl> hOLt-i '. )c;:OGDV-ShIR~UV VALUE.
FRE~UEHCY
.9
CUMULATIVE FRFQUENCY 1
CUMULATIVE
• 08 THEOr:E. TICAL J<OLi1GRU~OV-SHIRNliV V'°'LUL
TllE FUf.cCTIOi" RHCi f'AS5 1 UE JWUiOROGOV-SrtIRUOv TE:s1·
HM<IHUl1 C>IFFEREiKE: VALUE
OIFFERENCE 1.1920YE-07
OlfFERE~CE
1
CUHIJLtHIVE FREi:WErfC'f .9
t.1920Sl-07
n1t::ORElIC:Al CUl1JU1TlVE FREm.JEHC y
THE ORE TIC:;k
OIFFE~ENC~
HIEDRt:TICt'.\L CUMUL.ATlVt:: FREl1t.JENCY • 8 OE:SERVE:O CUMULATIVE:: FREi.luErh:Y .a1
OIFFERE~CE
lHEORC:TICAi. CUMUU\TIVE FREUUc:t-.CY • 6 OE:SERvEO CUHL:L1HIVE FRECWENC y .6
OlFFERE:rH.: E 0
THEORiTlCAL CUHULATIVf FREQUENCY .7 OBSERVED CUHJLATIVE FREaUtNC¥ .69
DIFFERENCE
• 3.lf
FREQUENCY .22
FREGUi~CY
.3
THEORETICAL CUHilLATIVE
F~£QUEhCY
FREUUE.i~CY
.08
CUH~LArlVE
HIEut\El JCAL CIJMLLAl IVE FRE!lU.::NC"( .1 Ot:St:.FNECi CUMl.ILATivE
DIFFERENCE .06
DlTFE::REl-ICl::
THiURETICAL
OIFFEf<Er-ICE
THEORETICAL CUM~LAfIV~ FREQUfNCY .1 OE.5C:f\VEiJ CUhULAl:LVE:: FREOdE.HC) .06
OIFFEF:Et..t;t: • o..q
THEORE1ICAL CUHJLATIV~ FRE~UEhCY .z OESE~vEO CUHLLATIVE FR~~~EhCY • l 'f
TE: STING THE FUNCTIO;., RNJJ U!:.; n~:; THE •{GLHt.r,tJGiJV ··-Shlr<NC.V 1 ES r
TESTING 100 NUMBERS (Continuedl
• 163
'-J
+::>
OF
~UH5
STANO~~D
52
OESVIATIOh VALUE
~.97~68
ABOVE THE HEAN 50 NUMfER OF DATA
~ELO~
THE ttEAN
OBSERVED Z VALUE ,201019
THEORETICAL Z
V~LUE
2.57
THE FUNCTIGt-. RM) F·ASS THE TEST r<Ul-19 AE:CVE At-.0 BELOI-. TUE. Hia,N
HEAN VALUE 51
NUH8i~
NUMBER OF DATA
5~
TESTING THE FUNCTIOf.t RN[• USING TUC: TEST RLt-.5 AE:uvE ANO E:ELUw TUE HE.f1N
TESTJ NG 100 . NUMBERS (Con ti nued)
U1
-.......J
INTE~VAL
E~PECTED
UBS£R~E~
CHI-SUUARt VALUE Z.795
CHI-SQUARE VALUE 11.3119
TEST
THEU~ETICAL
LE:N~l-IT
OF DAU\ 25 ut::SH:.JE:D t-.LHt:E:R OF DATA 2'l
NUHBiR OF OAl1' 12.5 UBSERV~D NUhBE~ OF ~ATA 17
EXPECTED hUM~ER OF DATA 6.25 OBSERVED N~HEE~ OF DATA 6
EXPEClED NUMBE~ OF DATA 3.12~ 06SERVED NUHB~R OF OAlA 5
Numa~
THE TEST RUNS OF LENGHT FOR ABtJ\11:. f'\M.J BELO"' TUE
THE FUNCTION HHD f'ASS THE RLN9 OF
INTE~VAL
'l
IhTER~AL
2
3
USI~G
FREE~OH
1 INTERVHL EXPECTED
USING 3 DEGREES OF
lESllNG HIE FUt-..CTIOi.f F:NO
MEAN
TESTING 100 NUMBERS (Continued)
())
.........
FUNCTIC~
RND USING THE TEST FOR
VALUE ,25
SfA~JA~O
OES~IATIGN
VAL~~
.03G~501
A~TOCCRkELATIO~
OBSERVEu Z VALUE 1.05309
THEOKE.TICAL Z VALUE 2.57
TUE FUNCTION RNO f'AS!.i THE TE:Sl FOR liUTGCDRJ"..ELA'l ION
HE~N
AUTOCOr..RELATIUH FACTOR .ZHZfi67
INTERVAL SILE TO CHECH FOF\ AUTOCORRELATION 5
TESTING THE
TESHNG 100 NUMBERS (Con ti nued)
'-.I
'-.I
FUNCTIC~
~
.01b0~6 THEORETI~AL
NUHB~R
Nt~6ER
EXPECTE~
I
I EXPECTED
I EXPECTED
11.8~51
~3.2
OBSLRVED hUMBER OF
THEGf~ElICAL
CHI-SOUA~E
hUM2CR OF
VALUE 13.2767
OB5[R~ED
D~TA
DATA 2
OF OAfA 3.6 OB5E~VE~ NUMBER OF DATA 8
OF D~rA .1 O~SER~EO f'.IUHLER OF DATA 1
OF DATA
OF DATA 2.7
NOT f'ASS HIE: Plh<ER TEBT
NUM~ER
NUM6E~
I EXPECTE0
UBSCRVEO CHI-SQUARE VALU[
THF FUINCTIOi-4 RND 010
FOUR LIKE DIGITS
Of'.IE Fi•If<
TW(j f'(1lRS
THREE LrnF DIGITS
0~5FRVEO
EXPECTED HUl"'IBi::f\ or L>ATA 5'f OE:5t::fl.Vt:Co NllMl::Ei\: OF DATA 'f6
f~EEDOH
ANO
FREfiUENCY VALUE .163
TICU "i'!I.) USifltG ThE F (U(E~ TE:BT
DEGREES OF
ru~c
FOtJ" OIFFH<E.in CHGITS I
USING
TESTING .THE
VALUE
G~P
fEST
THELRETIC~L C~HULAlIVE FREU0~~CY
USihG THE GAP TE9T
.016016
RNO PASS THE
F~E~UE~CY
OBSERVEDFREUUE~CY
THE
RN~
BETWEEN
FilhLTIO~
~IFFE~EWCE
tUMULATIVE
HhXIMUH
TESTING THE
TES TI NG 100 NU~40£RS (Continued)
~3
-.....J
00
q
~~D
USIN~
NU~BERS
THE
or
NUM~ER
OBSERVED
r;:~o
NUME::E,; OF DATA
20 •.27
~6
OF DATA 20.27
VALUE
.5~~207
HIE YULE· s
THEORETICAL tHI-SUUARE VALUE 13.2707
TES r
TO 36 EXPECTED NUMBlR OF DATA 13.15
OATA 15
F· ;~ss
CHI-S~LiARl
THE FUNCTiotJ
5 INTERVAL FROM 25
OBSERVED NUMBER OF
OE:St:RvEli NUiit::Et< OF DATA 20
lf INTEHVAL Fro:Oit 21 TO 2.lf EXf-·ECTE:D
OBSE~VEO
NUM~ER
FiWi1 16 TO 20 EXf'ECTEu Ni.JMBL.F,; OF OA .I A :;L.
OF DATA 3~
Z INTE~VAL FRJh 12 TO 15 EXPECTEO
UaSERVED NUMBER OF DATA 22
3 lNTEF<VAL
YULE'S TEST
(Continued)
0 TO 11 EXI" lCTlD NlJME:ER CIF DATA 13. 'i5
0,:\ i I\ 1::
DEGREES OF FREEDOM
1 INTEf~JAL FROM
OE:SE::RVEO NUl1t:-E::R
USING
TESTING THE FLNCTION
TESTING 100
..........
\..0
• 2:n2.96
.1Y996
.'H01~'i7
.772'126
.65'130
.·H019t;
• 72.9627
• t3·Ei~57
• 39:;:_15·1
• :t 6 061 ~'
• ~.i7 6:-:~.'i.2
, 07 Hi~!S
.731259
• 9369·16
.2.376'f5
.206.it92
.1366911
.1'15YJ6
.57~936
.B7B57
.A09CJ29
1.52731E-03
• 3't:.1:; 37
.109612
.32.1318
.53fitJ't
• 7Bff 66;:.
• li979;·.57
1
88
• 65•115
, '1930'M
.6Btd/ .1
.3302[fj
• ';•87666
.92.IJl•H
.~!61/09
.5f:Jb0b3
.55'f~S:5
,3:JM73
.186007
• O~i26:i2.1
.'169323
.156097
• c;.·0'.56/
• 77":i722
• 372951
.'f769Ei9
.33FJ785
.29..J596
.87li56U
.'f6003
• 5~) /' 0 EiU
.9~7213
• '163.19~
.'f6506
• 93;·~
.736211
."1622.93
.588;:2
• 72:'..:J06
,t,5 ;:. 2-1
• '13.25'+2
.'IH11
• 55~j~97
."'117031
.68;.jOO:i
."1200;.3
.674155
.'111239
.099603~
• 7!.;'l'lo 1
• 2~H12.65
.51&~69
• 7 1'i56
.152652
,39276
• 96~~2:;
• 92Z61H
o7tt'fO~iH
• 737£)-1';
• 0'.15572
.6'1'1393
• 96c.o 86
.8~042
.0636968
• 53::J~j62
.989862
.352079
,3:.;3371.i
.EJ516t3
• O'l6E.263
• 89:.!5:/'l
.319222
.333A53
.20922f,
.1101147
.538136
.79b'i06
• 660~.7"1
NUM~~~S
.92767'1
RAN~OH
.260567
100
THE FUNCTION RND PASS 7 TESTS
0
00
lNTE~~AL
U~ING
.c9~99;
OJ'.el A 13
TO
FROM .1 TG .199799
or:
.o
1ti0
FRGh .3 TO
5 IIHtt(.VAL FROr1 .Jt Tll ,·11'S'99S"·
GBE.Ef\VE:l.J NU110:: E1i: or Df-IT ..... 11
EXf'E1~ T£J
EX~ECTED
IhTER~A~
.39~9?~
~
EXPECJEO
~XP~tl[G
O~T~
OAT~
10
10
10
OF DATA 10
CF
or
D~TA
M .t11i:(r1 OF fifffA 10
NUHBE~
NUri~ER
~Uh0ER
or
OF FIT TEST
hU~~E~
GOGU~~ss
:; It..TEtWi•L FRCii • 2 TO .299999
OE:5t:EVEl> tluri&:;;; Of" fJATH 12
OE.SERVE£} NUHE:t:R DF (;frfA 8
M Jt'it:.:::F·.S
FOR THE TEYf5 = .01
[XflCTt~
T~E
9IG~IFICANCl
Dl::f:it.RVEO NJr;l::H\ OF OAT1\ 5
2
F~Ori
N•Jrh::.::t~
INlf~V~L
~NC
OF
OF Ff\Et:IAJii
FU~CTIO~
Dt:Gf~1 ::.:: s
0E;5ERvlO
1
USING 9
TESTIHG TH[
LE~EL
T£~jTJflcG
co
......
NUM~ERS
(Continued)
INTE~VAL
~'
. 119 1)"}9~>
o,:· li.:tTA
''J
Fr\oJI",
085EJiJE0
EXH~ CTEu
E~F'E.C'fED
C~I - ~a~ARE
V~LL E
THI ~
NIJHEEI~
THECR~TICAL
VALUE
OF Di1Ti'\ 10
Chl-S~UARE
GOOuNl:SS OF FIT TE5T
7.2
OF DATA 10
NLii1 Z: E.f\ OF DATt". .\0
~UM.::E.H
f.XFi.::CTl'::D NIJi1C:.U< OF 01t T 1:\ :!. 0
.c; TD .i;999c;c;; E:Xt=·ECTEU
D1H fl 13
G~
THE FUt.. CTiih~ Jirh) f'ASS
NG~L~~
IN fH. vAL
OB&ER~ED
10
9 lNIEt~tJAI .. Fl\'.01~1 .6 Tu .89'i' 1.'9'7
Ot:·SERVlD NUiibC.R m Dl-\IA 7
[;tlTF'
FROh .7 TO ,7999c;r;
NUl"lt·c~ i<
l'iE:SEfl:'.'ElJ NLMr::Er\ OF
B
OBSERVC.u
7 l .NTERvAL n-::rn·; • 6 TU
6 ItHEI-\" J1k FRLi1 • 5 TO • ~- 9·-;·•;99 f.Xf'l..::1 t D NJti1:.1::r, Ot=' Df'.fl A 1 t
IJE:SE::M.VED NUi1 0::l:.I( Cf' tH i' A 13
TESTING 100
~1.666
N
CX>
F~EUJEhCY
l ~ ~EOLlENCi
FR~;w E ~CY
.3
.2
.1
IJ5J.U:; THE
OBSER~EO
G~~~RV~D
O ~ H~~~EJ
CUhULAlIVE
CU~U .... Al1VE
tUrlGLAT~Vf
FR£QU~~C(
FREOJi~CY
r1~~GUfHLY
UtdllJld:: GnV ··-Si·GR"riJl) TEo 1
3
.3
.18
•J
5.96U~6E-08
.029999~
W1Lt..IE • o:;
F~EaJEWCY
1
OBSERV~D
08SERV~O ~OLHO;tGG~-5MJ~~l~
VAL~~
.03
[~tlULhTI~[
LUHULAlIVE
FfiEQUENCY
FREGLE~CY
.a
.71
TEs ·r
CUMUL~TIVE
FREOUE~CY
l
TliEO~ ~ TICAL KJLhO~OtUV - 5HIRNJV V~lU E
HK: Fut le r:;:rn., f<ND F 1)55 Tt-iE .,[iLHOf..GGOV -- GHlR1"0 ·.
ttAXUkJM Oln t::r\Ei"iLE
TH~OR ~ TICAL CUHU~ATI~E
OlFFER ~ ~CE 1.192 L 1~-Q7
OIFFl~ENCE
085[RJf~
GB~~~~~D
• 62.
,9 OBSERVEO CUM0LATIVE: FREQUENCY .87
CUH wLATIVE FREOUENCY .E
FREUUEhCY .7
FREOUENCY • 6 DE !3t1(\.. EL> Clli1i.JU\'Tl VE FJ;EC.UEilCY
1 Ht:1mETlC1'\i... Clli1JU.1 fl(.•,:: F f\lL1LIEr4C)
OIFFERrHCl
lH[O~L1IC~L
(•J:FFERENCE
,OHitlOOl
CUMLL~TIVE
THEGREJ~CAL
fHFFt::l~ENCE
CUikrlfH lVE
• ti~
9.~Y9~9E-t3
.
THl:.l~f~l.TICt\L
DIFFEREhC~
rnc.Gr~:E:l
lCuL CUi'IUU.lT.IVE:. FRt::UUEi'ICY • " OE::it?_J;.\;Et• CUMl.JLATIVE r . ~ElhJt:t-fC( .38
O.i:FFERf.NCE: 0 ....,
m..::OF·: tl:[at._ CliM.JLATIV t. f"EtWi:Jh:Y • ~:; (i£:;5E.R'JE.u CUhLILA'l IVE FREldC:rK ., • '19
CU0ULATIVE
z.~BJ23i-ta
THEOR~lICHL
OIFFERE~Li
0·1
. ...
CIJHLLATI~i
THEORETICAL
O~i-. FErki~CE
CLHUL~TlV£
• (i3
F:i~.J
OifFEf\t:l'cCE
TH~JfiETICAL
TES TJr,.t.; THE FLNc ·1 ION
TESTING 100 NUMOERS (Continued)
,163
w
co
Z
~A~UE
RNJ
50.93
FUhCTIO~
V~LUE
085ER~EO
THE
ME~N
NUHt::t:I\ OF f\lH6 49
THE
.398176
PAES
5TA~OARO
OVi:: Ti-fE
4 1.;
0
l t::l.OI-' lht:: HUH"
HIEu"CTIC•K Z VALllE
~,
51·
MEAN
E:ELOl"I THE riEAt-t 51
Ar~o
TEST RU~S ~BO~E A~~ Bll~~ THE
VALUE 1.97267
NUM::t1=\ OF [JHH1
THE TEST f\l!liS AHl-JE
0~5VIAT~ON
ME/11~
f~E
Dill/~
NUHt::ER GF
U3It~ ..:;
TEST:rNG lril: FUNCTIOi-1 RNO
TESTING 100 NUMBERS (Continued)
+::::-
00
OBSE~VED
~ND
NUMLE~
TH~
ur
LF~GHl
Fil~
ABG~E
~MD
UF DATA 2.99&B5
6.~~751
BELO~
25.1898 OBSERVED NUhBER OF DATA 21
THEORifICA~
OF DA·;A 7
VALUE 11.3149
NUM~£~
C~I-SOU~~E
OB5E~V~0
RUNS OF LEhGHr TEST
~UH~ER
VALUE
PASS
EXPECTED
Crll - 5~UARE
THE FUNCTIJN
INTE~VAL
1
E~PECTED
EXPECT~O
RLl~S
NUl18ER Of DAiA 12.~9 OBSE~VED NUrlEER OF DATA 13
3 INlERVAL EXPECTED NUrlEER o~ DATA 6.12011 OBEE~~E0 NU~~ER OF DATA e
INTEfi~AL
INTER~~L
THF TEST
OF D~TA
UbI~~
3 OEGt=.EEE OF Fli.EEOCrl
2
1
lJSU~G
TESTING THE FUNLT!GN RND
MEAN
TESTING 100 NUMBERS (Continued)
T~IE
U1
co
FU~C
rI011t f\i·W
• 2%06:~
O~SE~VED
Z VALJl .2606ql
W~LUE
AUTCCCR~EL~TIO~
• 0Jli'l501
~~. ~:;;-
AUTUCLF:Rt:UWH•i't
THEl1t\.::lICf1L Z
FO~
• ~. 5 STAN[·ArW DE5VIATION \.'ALUE
F1\CTG;;
THE FUNCTJGM RhO PASS ThE TEST
t'1EAU V!-'LUE
A~nu ;:, Or.i;U_ATIGlt
Ff11~
Hui-I 5
1 HE: TE.51
HiC:fJRl~Elf-\
U!:iJ~G
INTLl\vAL SllE TO CHE: Cf( FOR AU
TES .I I.i-tl, 1 HE
TESTlt'G 100 Nm4BERS {Continued)
co
0)
FU1'tCllGi-4 Ri·UJ US :.l. 1"4G TH C:: Ci·1F· TE 3 l
FREQ u ~hCY
.04b~lEB
'I C:,L; RE:t:S
or
U3IhG TUE
FREE:JC1'1
•<:"u
POt~fJ~
TEST
• 0·1EiC:7EE THl::Dii r:- ·,-n:;t.L FREi.1UU.iCY VALi.i.::
.16:J
ONC::
OIFFERC~i
r-.u,;:
OE:SERVEO
CHI-·Sm.n\fif:.. Vf.LUC:: 9.
Tl-iE:Jl\E:, E ;l•L
TE~, l
:·F,~53/'
THE FUNC TJ: CI" RN[) h•.5!:i H1 E F'CifCER
FOU~
c1-1:r - souM;:i:
'hkUE 13. 2.7 l 7
OIG115J £:.ff ;.:: c ·1Eli Mli'lt'.:[I( [F Df-1Tt\ 5Lt 01.::~El~ ·)E[J Nllht:C:f\ o;:· DATA ~:=
1 EXt'Ef~. TEO NL1r-1E::EA' OF r.,;r., '1:5,2 li L::~;E..i:~•Jt:u Nl.1hf: EF~: OF DATA '11
nm F·.:.1.; ~;
t EXf EC l'ECJ NlJi'i;~: tJ\ OF CM I~ Z. 7 Ot:SEHIJt:CJ Hl1rt t::t:R IJF OA I H 1
THf\EE Lrn;:: t·IG I TS
t t:J\F·E:: ITO ~tl 1 1.:: E t( OF Ofd1·' J.6 Ot'::5E::f.:VEli NUHC:;ER OF OtHr\ 'I
FOUR LIKE DIGITS
t E:·:;::·::c ·1F.:[J NW1t:::r:R o:=- DAJ r. • t Ot:.SE.; vt::O NUi1E lR OF Or'tTA 1
U5li~G
Tl-It. FUt-cCTlON
Tl5Tii~G
WtLUE
rn.:::n:Jcr1C't
GC: SEVECJ
THE FLi"CTitii-f RNCi f-1133 TU ;:: GM· TEST
CUMJLATIUE
tii\XIMUM [JJ:FFERc:l"CE E:.::ntC:E.N THEiJ,:&11c..,;L Cl.Ji1JLATI•)E Fr<.::Gllt:Nt::Y Aflll.> [.[:S C: RVED
TESTING Hit=~
TESTINR 100 HUMBERS (Continued)
-......J
co
J~rm
l
FR : rl 16 le 20 EXPEL: TED Nl.Ji'IE-Ef\ or (JM'A 32..
OF (JATA 32
~6
FROM
TO 36
~~IA
2~
OF
~UH3ER
GF
DAT~
13.'15
UE:SE.tiVEu LIH-·· 5iJL1"th:E w~LUE .q. 9US7 "1 l d£0i\E:. T ICi-:L Cfl.f ·-5UUARE WtLUE: 13.2767
Is TES'
E~FECT£D
10
THC.: FLi-t,:TILi'f F:i-tO F'1-)SS TUC: YULE
NUhlE~
JNlEFV~L
085E~VEG
5
lC z.q EXt'EC"TE.O "'Uh1.:: E.f\ OF OATH 20. 27
OE:SE:f\VEli NtJf1E:E,;; Of l.JAin 17
'f INTE1W~L H :Gt1 21
NUMli~
3 INTEf.:Wk
085E2V£D
lB
n1i:H1 12 TO 1 ~ f.)(PEC-;Eo NU1"'IK:r; ur lHHA 2 0. 27
DA~ - ~
0 lO 11 E:J!.f'ECTEO N\JhbER
OF
NUMBCR OF DAlA 15
INTEt~VllL
ObSE~V~D
2
Nu~B E ~
:i.NTE.'.i:VAL FRGl·i
UBSERVLD
OF C:11iA 13.'15
lJ5 l tlG Tf IE: 'HJLE' 5 TEST
US .HIG 'l DE.Gh:t:i::S OF Fri.E::EC·:t1
TES Tl NI.; THE. FtJNt.: T:J.ur~
TESTING 100 HUMBERS (Continued)
co
co
.21J~:.i-1'7
.625ti94
,::; .qs· 1i.l
• fj /- ~! ~-~. ~·.: 7
, 91if1U:.3<T
.t97'T1.l
, 5~;~.i.B'f
, 27/:HH
• 3H'940
4EiB.~.'.i
.31tl'TJ. 7
.::itd.50:1
.8~77i)~,
• 206ll9"i
.671'HJ!)
."176'137
.Sl·1106
• 2 ,' lb~'j
• 6 i 6c.'1 't6
• 7u.t,·; 1J ..:.
.~)6.lf.:.17
.~916~~
,790~j.1.l
.'l916'l6
• 17:1. (J,?. :'i
• i'!':d 97 9
• !"j «;J~~ 66
• 0 ::;::;c; 7 8
.62. 'i~; 1.n
• EVi7t:n
• ~ii'.J7 (j C'fl
.~!Ell'ti.1'7
,9o·;c;;;;3
1
• 0;~361:191
.~i10'L:.:;
, 5:'.H H. 05
• 379C-6li
• 'Hi :1:·:;a;·
.17;::610
• 0 7. ~'.d 'lE .If
• 9923;~ 2
• ;_;_ ~ 'iti9;:)
• ~tFc;~;:i
• ll ;;_ ·? :'.i •• ;~ (j
• 2~;7 J :.1:~
• .If w; 9 110
.:3969:i5
,
• 66•37 ::,6
• s- !) 33;~0
:=.; :;
,91~ r::;;.,H
~:. 9 B ~-:
,
.:J/'lld•'f
• 69·"t 7$5
, BL tt7:.:. ~:)
.130~0·t
• 56 'ilfo9
, 6'.;F«~H6
, 6~.i3o 7.2
• i!:=1S. <. 1-t7 .
• 001fo7
.t)7:3 '. 57
• 7'19907
.0313;:;
'l~fJO -:H
,::;:J~:'ii~fi
• 7'1~. :;·1
.981~-:iO.::i
,
• 0;'..;;.t)J<;
.~_ 7;:.c,;,7
• o 1r1 ;: 2 :.::s;
.9.:i::>~ ~ s
.MhlJ~.·t!
,'fO:iS.l
.75Ci2&o
• 2. ~~ 12J1:::i
.7/'19t.7
,·U7.lf'l8
• 5~1J (j(l"f
.712147
.926 1112.
.BOLlf.it.-1
, (:374iu 1 .l
t "flj Cl 1 :: u
.;:. lf93 ·l~
• 9 'P.i' 6 '.''i ::
• 1'I ::, i:d !'.'.·
• 0 2i.: 8 I) :J ;;,
.Ei019~: 1
.14JYJ/
• 522<79.~
.90'il71
.9or:~n_,
,36L.d:;
,9o9lc:. 1
.fi-1r, ::;o.J
, 06U1LL :L
.9:30171
rs
• 26~1 ·15
~Jh B~~U
F'f1G:; 6 TES
• 'i6~:Ei't .l
~AHDG~
l\~i:..
• OZ2.~:.~'. L.t:1
100
THE FUi-.Cl :rn.-.
l..D
00
OF
~1
• 0 1.fS' !J';<;
OAT~
TU
Ff\E.EL:Cil
llS~.lrfG
.~
TU
.299~99
F~~H
NUih:.c:.i:
2'.:1
.1~999}
o.= o•.-·;·A
.3 TO .399~99
OF DAlA ~O
FRCN .1 TO
NL~0E~
l~T~RVAL
OE.!;u~vEO
5
08S~RVl0
INTE~VAL
DE:S1:.RVl.D Nl..•r,[:C.R UF Of.1TA ZO
3 lhlERVAL FROM
1
NJM.L:J~S
EXPEfTE0
EXPECTE~
EXP~lTfC
15 :-:
• 01
OF FIT TEST
lT~i
~~~~ER
hUHRER
NJM8i~
~UH~ER
OAf~
OF
O~
20
~O
20
UATA 20
DAT~
OF DATA
OF
Nt.lrtE:Ef\ OF C:.ATA 2.0
GCOOH~ S3
D:t=·U~TE. O
TtlE
FRCrl .1 TO .19~~99 EXfECTLO
O~ OAlA 21
NUMG~~
1NT£~V~L
0~5t~~E~
2
NUM8E~
1 INTC.i\.11ll. FH:·I • 0
us=NG 9 rEGRETE PF
TESTH'G THE:: FUfKTIGi'f RM.1
0~6E~~E~
~.OC.
LE'vt.L OF Slb1"1FICt 1u ::E FOt\ 1 Hl:
TC:ST:l:i'~G
0
\.0
E
FRO~
OlSER~ED
.699}~9
1~
VALUE
TH~
C'
.... J
...
D~~~
hU~f
~A7H
CHI-SGUA~E
OF FIT TEST
Th[U~ETIChL
2~
V~LUE
20
ER OF DATA 20
EXFlCTEU NUMB[R CF
EXP~CTED
~o
OF DAlH 2G
ER Cf
NLlM~iR
NU~f
EX;ECfED NLM8E.h OF OATA
E~P£C7EO
EXP~CTED
GOOO~ES5
2G
.9~~99~
D~TA
P~55
Of
.9 TO
Gf OHTA
CHI-SGJ~RE
~Na
NUM3£~
THE FLNCTION
O~SE~VLD
FRO~
hLM;E~
10 INTERVAL
O~SEfiVED
Z5
.79~99~
DAl~
.7 TO
OF
c; J.r·f:Er.:•:AL n: =,1·, • 6 Tr
NUM~~~
!~TE~VAL
OESiRV~~
.69;;99
T~
OF OHTA ti'
.6
INT~R~AL FR(H
GE:SE.~\tl:li Nu~ ; t;(f\
7
l~
.s~ ~ 9;9
D1-~Tf.t
OE:5t:i\VC:u NU1ilU< 017
6 INlE1,VAL Ff.:01 . ., .5 TO
21.6~6
~
I-'
USii,,; TU1::
Fr~t: ~H.,Ei" L: Y
CJL::.:3ERtJ£L:
t::UHULA ·~- IVE
Ff~El!IJEt...CY
•
3·1:::
L...J
Ol.:SC:~VEi:>
•7
FREO~EhC(
FFH:":UUE~CY
FRE~lENCY
FR ~ ~Ut:hCf
.025
•7
.615
.54
CU~lLAlI~~
O!rFERENlE VHLJE .oq
5.S60~b~-oo
tUriLLATIVE H<EUUENC«
S. 'i6t1'fc',E::-li1:1
1
OtUERVE~
CU~ULATIVE
lJl: :SE RlvE()
50
HGLriG1i.~. CLl\,,.'-GH J. l~Nll'-.
VAL.UL::.:
FREOUENC) 1
• O'f n1a:r:ETiLt\l.. JWUiCmL-Jt.UJ - SHTRNOV Vf•L.lJE
THE FUrtC TH·1~ RNu f'MiD Hll: HCd1UJ\OGGV-ShIRNCV TEST
HAXIH~M
OIFFE~ENCE
THEO~£TI~AL
01.FFEREM~E
FREUU£1'-tCY • 9 CE su,vG> CUHlJLATIV£ FJiECWENC) .9
C~MULATIVE
CUrll 1LA fl VE
CUHUL~lIVE
CUh~LATIVf
T~EO~~fICAL
OBSE~J~O
oes~~UE~
.~
,9
OB~iRViO
,5
• 't Ut::sE,;VE.D c:lihduHIVE FRElR[N;: ·..· • ·1;:.~
• ::i
~,.;r
...........,
.12.
FREQUE~CY
5.960~6L-O&
Clli1l.:LHTIVE
TESl
• 2 ut:.5Et~ ./El.> t:l IMlJLA TJVI:: FJ~E.UUEUc..-
01:.St.:l~JEO
~WLn[' R1Jt,[,V ·-· 5MlKt, U!)
HlEOHt.TICi\L ClJl·illu!t ·11vE::
OIFFF.f<t:UCO:: , 0 ;~ 'l'i c;: S' 1il
DIFFERENCE
C)IFFt:f\El ... CE
• fJ ~. 5
THEO~Ef l CAL C:UhLLATIVE FRt:UJEM~'t'
O::iTFEi;ENC.f. • oz:;-,
THE \jf~t~Tll:~L C:UHULf'.°irJVf: FF~ElllJEN:Y
DIFFEh:f..1-.lC: • li ~:'.!)
ru.::DEETIClll CUl'lt.llt'i-:"IV[ rREUJE.NCY
D .L FF E F: C: 14 Ct:: • 0 :1
lhEDRl:TlU•l.. (Uli.JLAl IV.:: FREllllt:NCY
DIFFEF.a'fCE • 0 l '1 1/S·'.' 9
T1ffm-.:El 1;:,.,L c:u.·.LLA.lll.'£ FRt: tlUEi-.CY
HtEDF·:ETICAL C:llhl.Ji. .ATl\/E FRE:: ~~ dli-IL 1
FRE.: GuE::NC't' .1
'"~u
ClJ~iULATIVE
CiIFn::r,.::t-tcE: • oz
THt:UM:ETH.A-
TESTING THC: FLJNC I lOi"
TESTING 200 f-!UMBEP.S (Continued)
'11~;2
l..O
N
L£Ii~G
,J(~9}2
08SE~VEC
1()<1
O~jy\i;:
THEURElICAL Z
V~LUE
ThE
HEfi1~
2.~i
tlE~t.,
E:E:LOh THE HE1'lil C,o
TEST JWi.f ·::, ;\E:J'-. E At-40 f:.1:.LOW THC:.
7.
OF (uHA
'-~klJE.
i.flll·tL{i:'.~ f~
E.:£_01~
n.fEl;,l)f)l..
J.iHf.f;vAL.
1.NlFR1.· ~, ....
INl E1W~L
OE::;t:.r'<V[O CHI --S(H.Ji-.HE "1nl Ut:. 2. 70'f'f1
o,:.S E::RVE.lJ NlJhE:.::f\ OF
OE:::JF..r:tJF.:L.1 NUHt:.ER m:m.:~iF..i:Vc::Ci N ....·hE..ff\ OF
Gf::t=:iE:.IWHi NuMi::C:f\ OF
f)Aff'.t 311
[if\1'14 :rn
[)ul'1'.\ 13
01\ 1 f\ 10
THE01:\£TI ~: ~.L :~ H.I-Sl.uM\t. Vf'ILUf. .l 1 • 3 H 9
lE:ST ·
i=~H·r~;::Tt::O NlfriEH~ OF r1Alf\ "17 ,.,2.n
EH'ECTEO NIJ.'1l:[1'.i. OF li1HA ;~1.r,;;, ot
EXi='EC:TEu tLfr.t. Lf\ 1.W DATi:i 1~!.C::~id~
EH·£[i'c() N!.i ~l[f..,, OF Do rA ('J. 73B:n
Fr<t=~ E::l)Ji1
lHE. FUt-1CT.J.GM Rrlli f'A!i~; 'TllE:: f\LIN5 lF LUIGH I
1
2
3
'I
l!51NLY 3 OEGf\tE:S OF
MEAr~
l ESTJi-IG 1'1-1£ F Ji'fCTH1U RrtO LbT."C. THI: TEST F:lJ1rn [•F LENGdT ru;: Af.QIJE. ltN1) E::El.. 01·: THE
Z VALUE
p,,:;s nu:
(C~ntinued)
THE. l'EoT R:_.;-.:; M . O•JE 1\l'E>
I 00. EM Sl'f.1im,:u:·:O LESV:L•\TIUU
.!. 0 3
l\L::cvi:: THE l'lt'.:.-H·'f
THE FUNCTIOr' f\tW
HEAN Vi-tdJE
NUMl:::EI\ OF f\1;1,!E
NUHf::[R OF ()1\U\
IESTlNG THE FlfrlC;llOi'-1 RNIJ
TESTING 200 NUMBERS
'°
w
.zs
U~SERVEO
Z
FACTOR
A~lOCGfif . ELAllO~
.21C69~
FO~
5
VALU~
Th~ :
.i3~0~3
f'A5!~
THLL~~TlC~L
Z
V~LUE
TE!iT FOR AUl ocor~RE:LATION
2.5;
nUTOCORRELATIG~
STf\tWllf-W 0£5\r<rnTIDN \rflLLE .li213GE9
TUE FUUC: TIC;N f\NO
HEt\N VALUE
~UTUCORhELATIC~
INTERVAL SIZE TO CHECK
TESTING THE FUNLTION RNU USING THE TEST FOR
TE STir!G 200 MUMBEP.S (Con ti nued)
ob
-~.£)
RN~
p~;s
THE GAP TEST
~
FU~CTIOH
VALUE .0961665
RND PASS THE POKER TEST
OBSERVED CHI-SDL#tr\E VALUE 1. 72770 TJIE:Gr.:ETICAL CllI-SOUARE Wt LUE 13. 27 o7
THE
FOU~
FREQU~~CY
EXPECTED HUHB~R OF DATA 108 OBSERVED NUrl8ER OF DATA 1fi7
EXPECTED ~UM~ER OF O~TA 96.~ OB~ERVED NUt~~R OF OAT~ B~
EXPECTED HUHtER OF O~TA 5.1 OBSERVED NUHBER OF D~Th 5
EXPECTED NU~EE~ OF DATA 7.2 OBSEf'VED NUH~ER OF DATA 1
EXPECTE~ NUHBER OF O~TA .2 005£R~EO NUH~ER OF DATA 0
OEEREES OF FREEDOH
OIFFER£NT DIGITS:
ON~ PAIR
S
ThO PAIRS
I
THREE LIM£ DIGITS
t
FOUR LI~E OI~ITS
I
USING
TESTING THE FUNCTION RND USING THE f'DHrn TEST
OBS£RV£D FR£0U£NCY VALUE .021qz16 THEORETICAL
THE FUNCTIOh
HAXIHUH OIF~EREHCE BETWEEN THEORETICAL CUMULATIVE FREQUENCY AND 085ERVEO
CUMULATIVE FREOUENCY .oz11~16
TESTING THE FUi'4CTIOh RND USING TUE GM=· TE8T
TESTING 200 NUMBERS (Continued)
l..O
<.Tl
(Continued)
OF DATA
~0.51
OF DATA 26.9
OBSERVED
INTERVA~
OBSERVED
hUM~ER
OF DATA qo.51
VALUE
~.67913
THEO~ETICnL
PASS THE YULE'S TEST
CHI-SQUA~E
~NO
ChI-5QUARE VALUE 13.2767
FROH 25 TO 36 EXPECTED NUhBER OF OATA 26.9
N~HBER OF DATA 27
THE FUNCTIOh
5
q INlERVAL FROh 21 TG 21 EXPECTED
OBSERVED NUMBER OF DATA 36
3 INTERVAL F~OM 16 TO 20 EXPECTED NUMBER OF DATA 65.12
m::sE"VED NUl1r:;ER Gr DATA 63
NUMB~~
2 INTERVAL FRUM 12 TO 15 EXPECTED
08SE~VEO NUM~ER HF DATA 37
OF FREEOOH
NUH~ER
OECRE~S
THE FUNLTJ:Oli r\NO USlt.iG HtE YULE'S TEST
NU~RERS
1 INTERW1L FRDh 0 TO 11 EXfECTED
086ERVEO NU~SE~ OF DATA 37
USING q
TESTlt~G
TESTING 200
~
O'I
RN~
P~SS
.915395
.3'17111
.619012
.99797-1
.180162
• 236311
,'f1B2'f7
• 1EJ'Y72.7
.83319'1
.58078"1
.662.217
.9517
.521681
.9'f6606
.068012
.976367
.0100125
.3'10676
.002679
• 1fJB9:=J5
."16B56"i
.5'11Z9Z
.795fi92.
• O"f 2o'l79
.1:;550;
.260969
B TESTS
.62.2682
.0125'i3B
.986]69
.51158Z
.898181
.1583.l
.1156'11
.26'11·1
.3BO.lf'l9
.B77257
.58355~
• 5:;5 .J /9
• 66·1357
. • 57767~
• 170:194
.'1302;:
.2185·1
.956622
.9561EJ
.5!'11752
.797076
• 'f33·161
.981365
• 53'f77 l
.239.lfl~
.119~17
20li RANDOM NUMBERS
THE FUNCTION
.7767'f2
.636J.7
.99066'1
.3'10'12.~
.981337
.729356
.167936
7 • 71!-:i6"iE-0 3
.102.876
.123035
• 975116
.975217
.770'197
.0110367
.771731
.72'f152
• 058U75
.155085
7.01207E-03
.391239
.790-856
.066Ei916
.86C169
.863196
.5'12035
9 .1786~'iE-C.3
.5-1632'i
.96097
.0516b75
.17392.5
.'f2.lf062.
.37'l5B1
.20915Ei
.'M"i:H6
• 399:121
.889021
.66:;355
.0259721
.568609
.b55'162.
.657563
.937158
.5B2Ct7'1
.090103
.6t337i
.G92715
• 09205'-1'6
.162.786
.026121
.357'1U9
.5li091
.813362
~
-......J
.185'i9-1
.695927
.639095
• 719911
.103322
.958135
.3225'16
• 36'f 79"1
.120:;72
.7'f2B7'f
.995179
.007157
.se;;:;a
.973BIH
.19133
.206609
.63'1625
.120'J93
,'f(;366
• 892755
.901683
9.99613£-fJJ
• 9333:.:'.3
.os109c;2
.90673'1
.0'10379'1
• 5813~15
, '151i5UB
.01c;o1C17
.290'133
.560956
,53001:;
,3oc;121
.t7~2LB
.730833
.200271
.1'f1~79
.'l7796
.916679
.276625
.9'+0781
• O'f"lli617
.67«;952
.'fBG769
• 962.U,'f
.29'1256
.966'159
• .qz.q511
.0972352
• 6EJ.7 6.lfB
.059313
.9070(;2
."f31231
.81697
.170665
.753'i7Z
• os;eH-157
• 831197
.1766'17
.552302.
.20678.lf
.'f66~99
.7B11t6
.985'i51
.OU699£
.518377
.1'f7't79
.776fJ6B
.569096
e2L5179
,91J01U3,
.976107
,912(197
.927953
,995122
, 'M9317
.688719
.'f159'f
,665673
.370927
• 861 ·12.IJ
.903706
.2096'19
,6Bli·bEM
.lt61'H'I
.293li'l7
.fJB91359
.610166
,313 ·! f26
• 05~i6.2'i
.-121&35
.9808~
.39'1Ci90
.705~'17
.699~o7
.5575'i9
'°00
= .01
9 · DEG~EE6
OF
F~tEDOh
OF DATA 30
NUHB~fi
OF DATA 30
.19999~
OE:SERVECi NIJt·lf;ER OF DATA 30
5 INTERVAL FROM ,q TO
EXFECTED NUHa[R OF DATA 30
INTERVAL FROM .3 TO .399999 EXPECTED NUHBER GF DATA 30
OE:5ERVED tiUi1BEt< OF DATA 3.q
~
3 INTE~VAL r~u~ .z TO .299999 EXPECTED
OBSERVED NUhBER OF OATA 26
2 INTER~AL F~OM .1 TO .199S9~ EXPECTED NUMBER OF DATA 30
dBSERVEC HUHB~R OF DATA 23
~UM6ER
THE FUNCTION RNO UBING THE GOODNESS OF FIT TEST
1 IHT£~VAL FRO~ ,O TO .09997~ EXPECTED
OBSERVED NU~BER OF DATA 31
USING
TESTI~G
NUHE;ER5
LEVEL OF SIGhIFICHNCE FOR THE TESTS
TESTING 300
\.0
\.0
CHI-SQUARE VALUE 12.2
FUNCTJO~
O~SERVEO
THE
.9 TO .999999 EXPECTED
OF OAT~ ~O
EXPE~TED
NUHBE~
THEORETICAL CHI-SQUARE VALUE 21.666
OF OATA 30
NUHBER OF OATA 30
RND PASS THE GOODNESS OF FIT TEST
INTERV~l FROH
NUM~ER
OBSERVEO
10
O~BERVEO
9 IWTERVAL
F~OM .e TO .999999
NUMf E~ OF DATA 39
B INTER~AL FROM .7 TO .799999 EXPECTE0 NUMBER OF DATA 30
OBSERVED NUNBER OF DATA 21
7 INTERVAL FRGH .6 Tt .6999~9 EXPECTED NUMBER OF DATA 30
OBSERVED NUMBER OF PATA 26
NUHBER OF DATA 36
(Continued)
E~PECTED
~U~BEnS
F~OM .5 TO .399999
NUMBER OF OATA 21
INfE~VAL
O~GERVEO
6
TESTIHG 300
C>
C>
1-1
R~O
USIN~
THE
~ULHOROGOV-6Hlfi~OV
TEST
9.99999£-03
•
DIFFERENC~
VALUE
.0911001
D09Ef:VC.D CUMULATIVE FRct:m:::NCJ' • '19
CUHUdHIVE FREQUi.NCY • 57
CUMULATIVE FREQUENCY .656667
DB5Et~Vt.C;
oesERV~D
•5
•6
.7
1
OBSE~VEO
.063333~
THEOR~TICAL
TEST
CUMULAlIVE
1
KOLHOROGO~-SHIRNOV
FREQ~[NCY
.9 OB3[RVED CUMULATIVE FREQUENCY .G66667
.9 OBSERVED CUMULATIVE FREUUENCY .736667
• 3'1'
CUHJLATI~E
OfSERVEO
.~
FRE~UENC)
CUHULATIVE FREQUENCY .276667
OtSE~VEO
.J
J((Jdi0ROGOV·-5~1rnt-tov
.0633~31
O&GERVEO KOLMOROGQV-SMIRWCU VALUE
THE FUNCTION RNC:• f'A55 TUE
HAXIMUH
F~EUUEHCY
0:~33334
THECRETICAL CUhULATI~E
DIFFERENCE 5.960~6E-OB
OIFFERDfCE
ThEORETICAl CUH~LATIV~ FREQUENCY
DIFFERENCE .023333S
THEORETICAL CUMJLAT~VE FREQUENCY
DIFFERENCE ~.9'1999E-03
THEGRETICAL CL1i-1Ui_ATI\.i[ FHEOUENCY
DIFFERENCc 9.99Y9~E-03
TUEORETICAL CUt-iiJLAHVE Ff':EllUENCY
OIF FE:RENCE • C3
T•tEOR£TICAL CUHULATIVE FREQUENCY
DIFFERENCE .043333q
THEORETICAL CUMULATIVE F~EGUENCY
DIFFERENCE .0633331
Tl~EORETICAL CUHULAflVt FREQLEHCY
DIFFE~ENCE
THEORiTIC~L
CUMULATIVE FREUUENCY .1 OBSERVED CUMULATIVE FREOUENCY .113333
DIFFlRENCE .0133~33
THEORETICAL CUhULATI~E FREQUENCY .2 OBSER~EO CUHULATIVE FREOUE~~i .19
TESTING THE FUNCTIOh
TESTING 300 NUMBERS (Continued)
VALUE
~
0
~
STANO~~D
ABOVE
Af~O
2.~7
BELOW THE HEAN
THEQRETICAL Z VALUE
~UNS
THE
HEAi~
113
FU~CTION
RND DID
~OT
Of'
OF
OF
OF
DATA
DATA
oA·;·A
DATA
71.31-13 m::Sc:FWEO NUME:ER
37.3369 UB5ER~EO NUMBER
19, 5 :196 CJE:SH<Vf.D NtJf-iE.:E:R
10.2257 OBS~~VEO NUhEER
PASS THE RUNS OF LENGHT TEST
t...Ulh:"::J::n
NUMBER
NUt'il::ER
HUMBER
OF
OF
OF
UF
DATA 67
DATA 31
OltlA 28
DATA ~~
OBSERVED CHI-SUUAl<E VALUE 1q,346 THEORETICAL CHI - SQUARE VALUE 11,3119
THE
1 IHTt:t:;V,,L EXFE:cn:o
2 INTERVAL EXPECTED
3 INTERVAL EXF'£CT E O
1 INTERVAL EXPECTED
USING 3 DEGREES OF FREEDUl1
TESTING THE FUNCTION RND USING THE TEST RUNS OF LENGHT FOR ABOVE ANO BELOW THE
HEAN
Z VALUE .540653
I
BELG~
VALUE 6.61069
157 NUHaER OF DATA
0~5VIATICN
HEA~
USli'ft; THE ltST r.:Ui"S ABOVE At-ID E:E.LOi-1 THC: hEAN
RHO PASS ThE TEST
150.673
FUNCTIO~
~ALLE
OBSE~VED
THE
HEAN
fo-1[;
ABOVE THE
NUMBER OF RUMS 116
NUHBER OF DATA
TESTING THE: FUNCTION
TESTlflG 300 NUMBERS (Continued)
0
N
1-1
STAND~RD
HEAN VALUE .25
AUTOCO~RELATION
5
DESVIATIGN VALUE .017125
.Z711~3
FO~
OBSERVEO Z VALUE
t.~03~9
THEO~ETICAL
Z VALUE 2.57
THE FUNCHON RNO f'ASH THE TEST FOR AUTCCO;<RELAlIOH
FAClOR
AUTGCO~R£LATICN
INTERVAL 5IZ£ TO CHECK
TESTING THE FUNCT!OM RHa USING THE TEST FOR AUTOCORRELATION
TESTI MG 300 NUMBERS (Continued)
w
0
~
ONE PAIR
VALUE .0785196
OD9ER'Vt:Ci CIU - SOUARE VALLE 2 • 2092 TUE.UH£TICAL 0-II-Sl~Ut'~l'~E
VALUE 13. 27 67
EXrECTEa NUhB~R OF OAT~ B.1 OfSERV~O NUtmER OF DATA 11
EXPECTED ~LiMfER OF DATA 10.8 OEBEfVEO NUHBE~ OF DAT~ 10
EXPECTED hUMBt:R OF OAl~ .3 OBSERVED NUM~ E I~ OF DATA 0
THE FUi'fCTIOi~ f<1'4C f'AS9 THt. Pm~ Ei~ TEST
Ttli~t:E
FRE~GO~
FRE~UENCY
O~SERVED
OIGITSI EXPtCTEO NUMBER OF DATA 162 OB5ERJED NUH0ER OF OAl~ 150
l EXPEClEO NUnbE~ OF OATA 129.6 OBSEk~E~ NUMBER OF o~rA 129
OEEREES OF
~IFFE~ENT
~
THEORETICAL
CUHULATIVE FREQUEhCY AHO
RNCi USING THE Fm{EJ;; TEbl
.0~03712
THE GAP TEST
VALU~
FUt-tCTIOi~
nm f'AH,S
LJJ{E Oll;ITS
FOUR ll1<£ Olt;Il S
FOUR
USING
lEBTING HIE:
OBSERVED FREQUENCY
P~SS
.Oi037~2
BET~EEN THEO~ETICAL
FRE~UENCY
THE FUNCTIOH RND
CUMULATIVE
HhXIHUM DIFFERENCE
TESTING THE FUNCTION RNO USING TH£ GnP TEST
TESTING 300 NUMBERS (Continued)
~
0
.......
OE:5Ef\Vc:L•
OF nAl A "f2
E~FECIED
FREEDOH
N!Ji1i:l::tl 0 F C••l ff:., 5'1
hUMfE~
OF
OAT~
60,61
OF DAlA 10,35
INTE:F<Vt'\L Fr..Oi1 21 TO 2'l EXFECTE:D NUNE:Er";;
08S~~VE:D NUMBER OF O~TA 65
OF
DAlt\ 60,61
OBSE~VEO C~l-50UARE
VALUE
.5~0746
THEO~lllCAL
THE FUNCTION RN& PAS5 THE YULE'S lEST
CHI-SGUA~E
5 INTEHVol FROM 25 TO 36 f.XPECTE:D NuME:C:li OF DAT-' 'I0.35
OBSERVED NUH~ER OF OHTA 39
~
OBSERVEO NUHBEI' CF DATA 95
3 ItHH:'JAL FROI 16 TO LO E:<FE:CTED NUi-lt: c::F~ OF 01-HA 97, 66
OF..:SE~VC:c;
~UMEER
RND USING THE YULE'S TEST
0 TO 11
O~
NUf'if.. I:".~
F~OM
D~G~~ES
IHJE~VA~
~
FL~CT10N
2 INTERVAL FROM 12 TU 15 EXPECTED
1
USING
TESTING THi
TESTING 300 NUMBERS (Continued)
VALUE 13.2767
(Jl
0 '
1-1
~A~~OM
• (1631150
.'fSt"1(3/
• '11}6;!8;.".
.1833J'i
.'160972
.u:rn5EJ1
.617873
.7915t.1f3
.170017
.9?6202
.995783
.9li'T08L
• "'1159
,(i'123603
, 63.!f 'YS"f
• 158( "f
,9'H·25J
• 2'f92.92.
• 06599~. 'f
.739698
.215175
• 7;!606
,B339li2
,6:i~-1GS:
• .IJ87713
• 2 9•13 ::>
.9n.12q
.395~62
63-l~:iB3
,
.3~oBE9
.027117
• 97;::121
.Br2011
.37?639
.61151EJ
.'T7967
.19l:lU.l
• 5•rn O"r2
.9'T2.396
• 9 1 '• 1•1111
• .IJ68'i26
• 705•137
.599!':.ilEJ
• 5Eio 1;:
• 8;.'.1:1713
• :356~1U J
,7.q9935
.033;.572
.'177308
.632'133
.357163
.1120;;.G
,9B7J31
• 61-lS·'TB
• 5619~52
• 731jo6~
• 9682-'l :i
.3L!J6o
.Oi/l.q6
.1962~'2
.5Hl7o
O~lo7''f:J7
•
~75~.'i-12
.es3;;15
• 27 :; 2
,f;035Eio
• B6·lJt"19
• 3"Vi16~
.OB96313
.12~'ilt86
,
.3611'1
.73163(,
.78'1231
.'13B'l22
, O..'fm..ii)6/
.1'1760;:.
.:;61377
, 5t>~J06S
• 0113'16(,3
.33;!.922
.8Ei9Cfi'i
.658715
• (1665/ ...t
• 97·1670
• 6179'1~
.01967lil
.GfJo'lcr&
,O'l00:.i06
• r:· ~- 13 5 ., 7 5
• .1Jofi;·45
.868116
.17~16
.96070
• 2..l 07i7
.t."15G3i.l
.fl~91(i2
• 93669-1
.8U30"f9
• 3·13~75
.30J.3:l 'T
• 0·1111~7'7
• u:u,;~07
.1o2.'H3
,9i;ic;·95
• 297'7~ld
• 210~;77
, 'Ft~!8:n
.7'151~i3
7 T~ETS
• .;:."17t'.J2
• '16) f10L
.5EJ'1125
• .IJlH1~~~ 8
NUrl~ERS
FASS
.379316
.962350
.966:5 12.
.098678;!.
.10189':"'
• 5'1/..167
.65ti29't
• 77 6311
.5G7017
.71t1G3-l
.501513
• 52.416L.
JliO
THE FUHCTIGH RNO
m
0
.........
• 26'13Bl1
.63B1a
.86-l:a.27
.993761
.295867
.091'H6'f
.99BE06
.355396
• 73::u,o
• 0902'163
• 9730 ;~-1
.170:.:.~M
• 915l:J29
.B11i?75
.72£562
.601311
.34171il
.302911
.7681<J?
.'1:;823B
• 9'l'12rJ2
.1BLJitfiU
• 717'191'1
.62922.
.5671'19
.7172JS'
.37.qo:::;1
.'10590·1
• 932123
• il5~i:Jo;·
.50 iJ&:..5
• 23EM ''
• 695·171
.B178U
.1o10B6
;~ :~
• ~iH tB•;
.1Zt6.;:6
• 6/ 63:.<J
.63-1 7 1'1
.'1'10971
.'1326!.i
,695121
.910011
• 8312•17
.92.0'TB'l
,530 11;:,9
• :l 'T ~;5~ 'i
• e oo,;1li
• ~16.ZO;!rl
.:n2003
.9J!5£:S:3
.77'l6:il
• 06 'I J.lfS 9
.9l916LJ
.132.106
• 996'.f..t'I
.0177116
• 36 175'19
."J67'T3.2
.:;05617
• IJi,li!'::!i5
.ZV7152.
.1997(18
.9stJ:::i,a
.'105 5 6
.86061/J
.793176
, 0 l: .q 9 6 'I 2.
.238391f
• 2/' 17 6
• 3 ;:_ 79'f 3
• 8~~2352
.1697'1-'i
.677595
• 3~;25;;. 9
.2orn26
.29El9!.i2
.63U1E/
.0110509
• 9'fc.!:i.25
.9072()3
• 320~ ; 95
.51.l.L .d
• "1:;:: 15
.023952
.418351
.6119'1.7
.q,5EJ~uJE-03
.916338
• 839.lf .ifo
• b'i96J7
• 52998•i
.0197785
.3'i0107
.76BG11
.367~28
.OOii5702
.S.tBJU6
• 99JEn.:;
•'M57«;f.J
• "122;:.s
.2:3~:1015
.167 961
.fl(,0()97
0 f.:
.67-tE."12
• EJ7521:l7
. .q"
• t'168:: 8
.87E1Eic
• ~·~-)25r.>2
• 3~~a. t"10
.'f6fl032
.69'l.ttf:l
.80-!0.3
• S't:H:
.177976
-.....J
0
1-1
.'110136
• 2 i( i397
• :r75'f3'1
.113057
.728789
.51797'7·
.5157Ei5
.76'176
• 205;-.61
.6776~°1.
• 960 :2-'f 3
• 32.56:-:il
.ZZ0713
.0801729
.0221609
.36075
.1Z131Z
.87912
.90201
.731717
• 9EHJ253
.290362
• 9 :;· 61( H
• 7.B2lf9il
• 9~i l'601
• 822 q~;~
.717696
.0257056
, 'H•1!j~7
.271397
.190b15
.175'825
.06168
• 03BiJ•,99
03~.'i8/"'E-03
.996867
.9211~
.1Z'i'l~i6
• 7735~15
1.
.:.:3 ~B9~
• 8 't ~JI} 11'1
.Jf773G7
• 23·162~5
.177777
.959665
1"
,962131::
.211fi97
.991765
.5flJZ3'1
,9(. ljl(]
.30~'i06
• 9'13 115 ~
.238173
.66:.;176
.862"'1:;
.010.lf"t39
• 6~5 ·1'J ~'i
.93 3 725
.50286 5
.0810086
0
00
I-'
USihG THE
OF FREEDOM
~NO
GJOD~ESS
NUhBER
NUH~ER
~O
or
DATA 1t
OF DATA 1ij
OAT~
5 INTERV~L FROM .1 TO .199999 EXPECTED NUMBER OF DATA
OBSERVED NUH8ER OF OATA 39
~O
1 INTERVAL FROH .3 TO .399999 EXPECTED NUhBER OF DATA 10
OBSERVED N~HBEk OF OATA 11
3 INTER~AL FROM .2 TO .2999~9
OBSERVED NUM8iR OF O~IA 3~
EX~ECTED
2 INTERVAL FROM .1 TO .199999 EXPECTED
NGHBER OF DATA 32
O~SE~VED
01~
OF FIT TEST
FROH .O TO .Oi99i9 EXFECTED NUMBER
NJMBER OF DATA 13
INTER~~L
OBSE~VED
1
DEG~EES
TESTING THE FUNCTION
USING 9
~U~BiRB
LEVEL OF SlGt-tIFICAHCE FOR TdE TE5TS :::: .01
TESTIHG 100
0
"-0
1--'
N~M8ER
OBSERV£0
F\Nli
EXPECTi~
NUHEER
VALU~
10.B
or
~AT~
~o
THEG'"'ETICAL CHi-SQUARE VALUE 21.666
PASS THE GOOOt&SS OF FIT TEST
CHI-SO~ARE
THE Fl.'NCTIGN
10 INTERVAL F~Orl .9 TU .999999
OBSERVECJ NUMBC:H CF OnTA 46
0~5ERVEO
'f 0
OF DATA 40
OF
9 ItlH::RVAL FROH , B lO , Blf 99'79 EXF E:CTEO NUME.:1::'°' OF DATf\
NUM8~R OF OAT~ 29
9 INTE~VAL FROH ,7 TG ,799999 EXPEClLD
OBSERVED NUMEE~ OF O~TA 41
NUMEE~
DATA 10
OB&~R~EO
6 INTERVAL FR J H .5 TO .5~~999
O~SE~VEO NUH8ER OF DAlA 51
7 INTERVAL FRClt ,6 10 .699999 EXFECTED
NUHBER O~ OATA 'f2
(Continued)
NUMBER CF DATA 10
HU~BERS
EX~ECTEO
TESTING 400
0
.._.
1--'
.~275
OESER~[D
CJHULATl~E
CUhULATI~E
FR~QUENCY
.6
FREGUENCY ,q7z5
• S75
• 272!5
.187!5
DlFFE~EHCE
FREQUENCY
1 O~SER~E~
GBSiRV~C
OB5£~V~D
.oz;5
TEST
FREUUEN:Y
1
FREOUENCY .8&5
KOLHORG&UV-SMlRNGV VALUE .OB
CUHULATIV£
CUHUL~TlVE
CUMULATIVE FREOUENCY .615
TH~~fiElICAL
NOLHO~OCOV-SHIRNOV
OBSE~VED KOLH[~QGO~-SHlRNGV V~LUE
15
.e
FREQUENCY .9
VALUi .0275
CLM~LATiVE
.C119999
CUM0Ln1IV~
THE FUhCTION RhD FASS THE
ttAXIhUM
DIFFE:t<ENCE 0
THEORETICAL
DIFFE~E~C~
THEORETICAL
DIFFEr<E.iKE • O15
OIFFER£NC~ 5.00COoE-0~
THEO~ETICAL CUtlULATIVE FREOUENCY
THEOF<ETICOL CUMLU•TIVE FRl:::llUEr.lt y • 7 OE::SERVEO CUr1UUHIVE FREuUE.:NC'l • 70~i
DIFFERENCE 0
THEORETICAL CUMULATIVE FREQUENCY .6 OBSERVED
D~FFER~NCf
THEORETllAL CUHJLATIVE
.s
Ff\E:l1dENCY
THEGRE TIC AL CUl":ULATIVE H<H4Llt::t-.CY , 'l GE SEF\Vtu CUMIJLAlIVE
FnEQUE~CY
Ff\E~WE:1"CY
FRLOuENCl • :J OE:SC.RVt::D Clli1ul1HIVE
THlGhETIC~L CUMU~~TIVE
OIFFE~£~CE .0~75
DIF"FEf'Ei'4CE • 025
Ff\E:-:L1JE:NCY
FREl'WENCY • Z OE:Si::R'Jf.li CUi1ULATIVC:
CUHLLATIVE FREaUEhCY .1075
TEST
HIEORC:TlCAL CUrlULATI\.'t
DlFFEEHiCE • 012.5
OBGE~VED
U~ING ThE J(()u10 .~GG:JV--StiIRt-f0v
FRiOUENCY .1
f<NC
CUMU~ATIVE
DIFFERENCE 7.5E-03
TH~O~ETICAL
TESTING THE FU1'1CTIOi"
TESTING 400 NUMBERS (Continued)
..........
..........
..........
EXPECT~t
HLH~~~
OF FREEDOM
OF
RNO USING
~~TA
AU~5
103.931
TEST
EXFECTE~
NJhB~~
OF DATA
DID NOT PASS THE RUNS OF LENGHT TE6T
11. '1832 OBStRVE() t-fUi'iE ET\
23.~233
or
A~OVE
AhO
BEl_OW THE
DATA 28
OE :nEnvE:li CHI-Si.lL·Af<E \/t\Ll.JE 27. 6978 HIEDKE rICnL CHI-9l4U.,.;E Vf)l ..lJE: 11. 3'1 "19
Rh~
l~TEfNAL EXf'ECTEO NUtlB.:.R OF 01HA
THE FUNCTION
"
3 INTERVAL
FGR
NUMGER OF DATA 66
NUiiE:E.H IJF DATA 5 0
GBSERVED NUHEER UF O~TA 29
LENLHT
OBSER~ED
0£:.G=:f~ VC:D
OF
THEl.lfi.ETICAL Z V1\LUt 2. 57
T~E
THE HE Ml 2. Ii 8
E:ELGH THE HEAN
9.~0418
AND
VALU~
2 INTERVAL E>:PECTEO NUt'1E.1Et< OF l>Alf\ '19. B"f 01
l INTERVAL
DEGRE~S
USING 3
DE5~~ATIO~
THE TEST RUMi AE:OVE
.7691~3
f'r~SS
STANDA~D
FUNCTIO~
THE
Z VALUE
TESTING
HEAN
OBSERVE~
THE FUNCTICN Ri'J
HEAH VALUE 200.6U
NUHBER OF RUHS 193
BEU1.,;
F:ND USI~t; THE TEST RUMi AE.OVE M•l> E:ELGw THE Mt::Att
AE:O JE 'THE HEAN 1'n t-.Ur1f.:FI( UF OAT ;1
FUNCTION
NtJMt:.ER OF DATA
TESTING THE
TF.~TING 400 NUMBERS (Continued)
Iv
..........
..........
FUNCTIO~
STA~DA~D
DESVI~TION
.257613
VALUE
.01~0737
5
AUTOCO~~ELATIGN
VAL~E
.63776~
THEGR~TICAL
Z
OBSERVED FREQU£NCY VALUE
.015q5~5
THE FUNCTION F\N.:> f'ASS THE Gt\f' TEST
THEO~ETICAL
F~EOUENCY
OBSE~~ED
.0609~1
AND
UALU~
FREO~ENCY
VALUi 2.57
HAXIHUM DIFFE~EhCE BEThEEH TJ~aRETitAL CUMULATIVE
CUMULATIVE F~EU0ENCY .U15~515
TESTING THE FUNCTIGN RNO USING THE GAP TEST
OB9ERV£0 Z
TH£ FUNCTION RNO PAS3 THE TE5T FOR AUTOCORRELATION
.25
VALU~
HEAN
FACTO~
AUTOCO~RfLATIO~
AUTOCOR~fLATION
RND U5IWG THE TEST FOR
INTERVAL SIZE TO CHECH FOR
TESTING THE
TESTING 400 NUMBERS (Continued)
w
f--1
.......
OF FREEDOM
ThO PAIRS
OBSERVED CHI-SQUARE VALLE 2.5713
POKE~
I EXPECTiD
t EXPECTED
I EXPECTED
THE FUNCTION RND PASS THE
FOUR LIKE DIGITS
LIKE DiGITS
NUH~ER
NUMBER OF DATA 1
VALLE 13.2767
OBSER~ED
C~I-SaUARE
OF DATA ,1
OF OAT~ 10.E 086ERV£G NUH8ER UF DATA 9
OF DAlA 11.4 OE5iFVi~ NUMBER OF ~~TA 11
THEORETIC~L
TEST
HUM~E~
hUH~E~
NUMBER OF OATA 205
OBSE~~EO NilMBE~ or O~TA 171
OBSERVE~
17~.e
o~
NUhEE~
OAT~
OF OATA 216
NUHGE~
ENl:i U5:Li4; ThE f'Ol{i:.f:: TE5l
OIGITSt EXP~CTE~
ONE PAIR
' EXPECTED
D~EREE5
FLl~C'IIGr~
~IFFERENT
THRE~
FOUR
USING 1
TESTING THC:
TESTING 400 NUMBERS (Cont1nued)
.+::>
........
1--1
usn~ G
NUMB~R
0 TO 11 EXPECTED
OF DnTA 5~
NUM~ E R
OF OAlA 53.E
THC: YULE. 5 TEST
FROM 21 TO 21 EXPECTED
hU~~E~ U~ DATA 09
NUHB~~
OF
OAT~
Bl.OB
OF VATA 46
2.397~9
THiO~~TICAL
Rt-.D f'J.\55 HIE YULE' B TEST
NUMB ~ ~
ChI-5UUARE VALLE
FU~CTIOt-4
06SERVE~
THE
OBSERVED
CHl-SOuARi VALUE 13.2767
5 INTERVAL FF:Oh Z5 TO 36 EXF'ECTE.D NUt.li::C:R OF 01HA 53. B
OBSERV~~
~NTE~~~L
q
FROM 16 TO 20 EXPECTED NUt-iE:Er;; OF OATA 130 .2'f
OBSER~lD NUH8ER OF D~TA 135
INTH~VAL
lNJ"ER~,' nl
FRDli 12 10 i5 EJff'ECTED Nt.Ji1E·H\ OF Cif'HA 61.08
0£:SER\ll::v NUtc:ll\ OF CMTH 76
UBSER~EO
INTERVAL Fr\ JM
3
Z
l
USING 'f OEGF<EC:S OF FREEOOM
TESTING THE FUtlCllOt-1 Rtil)
TESTIHG 400 NUMBERS {Continued)
CJ1
..........
,__.
r~i"D
f·,; :;s 7 1 E:= i !I
.~n~~i ~
.19 7 32
.oa ~ 7J1~
.;: <TOH
9 • ~S ::11 <j ··t E ·-· 0 :1
.638061
• 51 c;: :n:;
• l ~:; ;,:, :,:;1
• 7" ~! 35[;
• 2.5/"f :il:i
• 'l~i<.i i::d
• 26 ·16 (::
• .l 63[17<_;
• 6J.2.:3 <3
.6~86 ~~
• ::lt.J5 0 ul':l
• 562 :15
• 102 223
•
c;3;~ 7
J.
.~?701~:i:3
.?oit79
.70~696
.3f.1G t.: <; · ~
.118'77"'111
,98L891
.366l 75
.~ 2 19 ~~
.96~127
• 6 ~1'1~.:i i};;,
• 9 .L 71_, : ,9
.·11768b
• <7 ;~ ~j :; ti 7
• :;;~ ~-~- 'F.ir
.616 5~ 1
.600 5 16
.238i1
.66f> +.:l~
, 13EI 0Ei1
;>706::'.
• 1
• ~~ ~;. -1tJ61
.11.i!.' i:::·l6
• Bl '157
.6~8(9<!
• 7::u o;::-1
.675017
.16 94 QG
.671 753
,9q ; s1
.66Bt24
• 21'1 ·:., ::i 2
• 'i ·175..'.12
2'd1
uz
,q/9/28
.5~6119
. ~11 971
.S~7374
.67 ~ ~8
.9~~6 ~ o
.50 ~76~
.16 ~57~
• 2 (.. ~)() :i 6
• 7 t.>1 ~. 5]
• 277J5;_
• ~~:; (j
.16 /
• fi~":: ? ;;_c:d
• & :I 0 (ii. 6
• :-Hl J 3 :.?.
.~: G~·:d.1.l
• ::;:.;6 11:?. l
• i1'l.L..:..:i3
• 79 ., ·1 :I.
• .q 2 1,; ~?.1 :.=;
• 'l~·· :l Lil:;
• 0 :~ ,. , b :_;,~; :1
.Bi't.> L.Ci5
, 5:'i06'r9
• 'lll 1.71' c 2
• t2:HO.l
• Lli99Ci2
• 0 372. :JI'
• /''+i' 3«"/
.71<j91.Z
.f.1110:=..; a
• 3·1'1 17'1 ::i
• 'l~?.7701
.7i ..lf1"16
• Ei5rj3'1 J
.3::it",G::i ?
• bB<; .;:.u'I
.23193t.J
, :I ;:.J71
, Ei'J-170
. 19·H Ct
, 0691: ~1 .lE
• 0 li'F:i .I. "f i
• 3<; ~~ :.;27
• ~-:; ? ~i r•:5
• ~.'i 'd i'9:~
.76<;:3 7 3
• l.i ·1 ::: •t u:J
• ::i .to ~;;· J
• 3 ~j .... ::; ~=: ~~
• ~?. ~ ~ ii 7 1 ~:i
• ::J b 1? t; 15
_;9 :_. {:4
, {,;_:JJ ::: :"i
.615.!J<t 'j>
.'f'7"1112
.603~5 52
.:; z ~1 52
• ; :. 1
, 9,:,3e:..-1E
F~ •~ N
l: lkl i·IL. h [: H. t1
FUM:T.ro.~
• 4-=tt:i8t.J•1
·10 1;
THE
0'1
1--'
1--'
~
.90~1'i
.0El'f"i59
.96iHf9
• 5'1:3/ 92
• 78'!9~! 1
.600::!06
.1~3 ~j 9
·"~~ 6111
.60CT'f1'f
.15;>2.112
.2'f8B58
.701318
• 65"19'f9
.985-123
• 9627'S'7
• 0531H72
.502011
.2fJ65(i5
• 63;~·1-16
,5:;17(j97
.30653
• itis::..13
O'f7Ci~56
.219153
,'f02.G61
,93141'1
.77;!,982
• 866672
.260105
.'16176
.62'17'f9
.670~:;
.210'l57
.519232
.111'19.29
.715046
.7556~9
.178596
7, ~:H 7 oE ·-03
• 7 63,,12
• 6~i·1667
.11695CT
• 711655
.572322
.1UOtJ:U3
• B62'1Co.it
• 01EM.lf~!Ll
• 6~H93
.1:;0356
.7ti15'79
.'109085
.67-1912
• 313b~i6
• 0172.956
• 60799"1
.375513
• 9758'1.L
.86(i907
• 6BBJ'11
.2016(5
.753108
• 03Ei66i9
• 2'1 '1856
• '1796 ..16
•
.50996
.930677
.'127165
.B21tJ'f
.'17759
.7'f7357
.9135!.iB
.019B3'1£.
.7034:.ie>
.91395E
.190012
.ea:t766
.65c5!12.
.7(i608l
• 1'11'133
.9:;1859
• 03:; ..tts
.550658
.6261;~3
• 52~.)58
.7tJ523.lf
.B"l195'1
.99(1;:17
• 63'1773
.G55·183
• ()'i"l7 b
• OB3:J0 1.?7
• 71721'1
• 0 tflj 7963
• 793 1 198
.50675:;:
.579517
• 10 •107"
.19~066
.'407735
.6(i5J16
.86(69
.605L 1JB
• 'f75'7 ~·
• Z21B86
.'f97to:..;
.3:11790
.669263
.850265
.E1'f739Z
• 6:;5'7 27
.3t_;O 1~b
• :n;Jf06"i
.6B7'fS"9
• 1'fu573
• 'fl'lS1 2·;;
.01Z'11B5
.013'f902
.UM.t11
.B2ti7b5
.750363
.B3L951
.1111:n
.3'H003
.5060'f2
• 1131: 23
• 3t.1 39'f7
.167576
• ~;o 2:'.d.J
• 201B5"1
.851380
.673:.!91
.'1:;100~
.3?3'13i
.0503671
• 709;:.;:: 3
.629603
• 36;~672
• 973;· Ii 'f
• B~:i-135;:j
• 52 (•'J 3't
• 'f ::J'f 2
• 5736:j6
.'f666.l6
.9.!f9B'i9
...........
1--'
1--'
• ·1EU53o
~. 2.25~.tfi:-0:-i
.7!H'i6.l
.0996035
• 'f:l~?.5'i~
, 3H~::'.22
.333576
.051603
.0'16Ci2.o3
.89257'1
.333653
.2oc;· ~26
• 9;~26Ei'f
.Ei65523
• 6602.7"1
.1'10947
• 553~)62
.020·12
,737B·W
• 035::1·2
98,~CIBo
• lc';-10:;6
.5~G5S'7
, ·U7B3J.
• .lf2GOZ3
• 67"1155
•
.20~~30'1
.152652
,39;;.76
• 71'1~~6
• 51056 11
• o129·1.;9
.0767792.
.650363
.269'113
,95369
• 5862-2
.325~17
• 9506':19
.1,;;;.~93
• "1'1.l1
.259~65
7.'127'15E-03
• 3198·16
.615997
• 355'H "1
.50915
.'f827'17
• 3't8J7"1
.590077
.922628
.986137
.36163'5
.260567
.92767/f
.989862
.352079
.6'1'13CT3
.53866
• 79t1'I06
.06369&8
,5593:;;3
.1962·19
• 298'11 'I
• 055J~,.tZ
.32.'f'f :1~
.17'1259
.3~5853
.1297blf
• ::1557~:;3
.1235'73
.115273
.~H'799o
.2'f0(,'J2
.219285
.29b'i-1
.616.tf53
.25•1.36~
.157653
.'111871
.967716
.'l912.7
• "IJ0:;:~~5
.7625'18
.105;:27
.809J82
,988708
.861002
• 16917.6
.5675L5
.16632."-l
.09l.0092
• 3.lf 6:.'.. 9
.'1800L;6
.987195
.03965176
,UO:J05
,6'112.3
, 38C. 1; tH
• 7'f 1:rn1
.267111
• 07'7 83:='?
.816'715
.61'16'1-1
.6as1i.q5
, O'lfi•lc1ij.9
.309'155
.297679
.312861
.5EJ3931
• 95 111;· 1
.6'fOOo:3
.06'117'75
.78"r~77
.'17376'1
.108:372
.322.()95
120;~
1
, :H
, !'.Ji>.31 Oo
• 3:j6Ci:rn
.720760
.0117196
,30655S
, 'IH71
• 336,"67
• 71EMu6
• '17732.Z
.lf61iiMZ
.152051
.0~25761
.61'i··1UL.
.511537
.'157~.16
.8322o'i'
.51112.9
.2t9:H-t
.9600'1?
• 3~~-•o M
.3611~i'?'f
• 5•72~'.93
o339L~
.39H3
,6J6T57
.66290
~
~
CX>
APPENDIX B
COMPUTER PROGRAM AND PRINTOUT FOR
GENERATION AND A NON-PARAMETRIC TEST
I"""
nrM
l'lJ"H
111: 11
f>I M
Hll''"
r1111
Of H
llll'llf
I'• 7
,,,,.
lft'1
f'.)111
1-..11
l.,'7
11,\1
,,.,, ,,,.., ..
"U"\11 0
•Jt1IOl\'ll
I lhf
,.,,, , , , .. ,,
I\
CNI
,·,r
tllr
111\IJO"~I
121
llttllf'I llfi
yf.<;fyf,
"llMl•rn•;·1.1
Rl\NO•'•H NUHrrnr-;•
''" '•OlllTIVf'
I tr.T
,,,
1111 "" 11<•11\llllr(•llM
1 '1111
Yooll
I 7QI IPlf'llT ·11utt· .. utt
I ,_VI tr I •• •t1• r;l')l ·~
,,,., 11rH
11?
llF11
llr11
I I 7
1 tn
"77 ""'"
1t1rur •1tn\.I Hl\NY R/IMO<•H tllJHrr n!l '"·' Vc.•U I.I/INT. !ti
' ".' 11r11 n.r. .;- .11r1 11111 · 1111 ""'"'''11 tt•1Hllf·. n9
11111 IHH r. 1110; · ~1,n:;>tll•~01oNtHN•7Vll
I I., 111 11
I I 1, 0Ft1
II .•
MttfNI • 11\&
"'""
"7'1 nr-11
'7~,
77
7A
'1VI
RI
R7
71,
11;.
7 t
1:: ,,.,
'77
Tl-IF
'1fo
IN
•un111.n v•:•ll L ll<E THE RANDl'.•11 NUtmr:ns rA•)H /IN tlNIFtlRH on N(IN · llNJr(lnl1 Ol~TRIPVT IONI
r,~1
HIFN am1
Cln
IN l"\J T ·wi:•UI 0 Y(IV lll<E I\ HIX (IF HIE rwn Ol!:;llltr.llll•.>tl9 F('R TllE RllU()•'•H
UUHJ~ERSt
tNrUT
1r ttt•I 111r:N .;:•1nn
CLS
INrllT • WnllLO ynl} Lii<£ TO Tf.:!H Vt•UR OWN NUl'1~r· A5t INPUT CI I IF VE~•
I 21 IF" NOT• t tt2
IF r;,7.al TllEN .1100
flFH
G•H•> 70
flrH
nFH
"'., nrM
6.-, nEt1
67 nrH
1,9 nrtt
4',"1 RFH
7n 1Nru1
' ' l•l.q"'
4ft "f.:11 xxx ·~Tl~ 1.10no nil~ (IF Tl~ C(ll1rU1EA UTLl7EO IN TI~ /\OOITIV~ nu~noUllNE
'll XX'l.cJ27(1.7
4R J1r11 1 IS THE VlllllF. or Tlll"'. STllNOARD N(•Al1Al. AT ~'l. L£VF.L OF !'ilGNIFl/\CPJCF.• UTILIZED
( 11
IF
INrUt
TEST
1r
vfr,,
(I'
,~,
(.?I
tr U<'ll" I(;
IF N•.•T" tfil
vrc;,
RUNS Af-IUVE AN[) ~f.:LC•" lllE tlF.OIAN
N
~
0
t. l REM
162 nF.H
l 70 IF ,1=2 GOTO
nFH
nr-11
G• J<;Un
llrM
2f1QI
flfH
G•)•;un.~
:;: n ~
.·n-"
:' RI
'"VI
2 3CWI
r;1mr,,·,u1 JtJF.
R F. H
HE:t1
RFH
:;: ?rl
279
;·77
:-ue.nr:1ur
nF.H
nt M
279)
2 76
70!
INF.
r.osun
~
~'10171
r'EH
RFH
REH SUP.. P•:•UllrJf'
263
26'•
2f.~
OF
THE
(2)
27111171
7.:-\00
;:·'°'~l'I
(.l\l.C\11\l _TE
Cf\LCULATE'
Cl\LCUALlF.:
NEOll\N
TIU·:
NlJMf".r:n
(•r
Vl\LVE5 AP.•)VF
THE
Yf.:S<V>•
NC:•<N>"tl<•
nuNS
l\N[) r'·ELc)W ·rHE ME:OIAN
RANO(IH NUHf\ERS
OEVJf\TEs· 1 I
Rl:M SUJ~Hl)UT I NE l "100 USF.: FVNCT I ( •N RND < 0 >
G•.1!1Vf3 l 0t'l0
REM ~<JI) AND NN<JI> ARE THE RANDOM NUMBERS
B<Jl>,,.XN
NN < J t ) ,. XN
NF X r J l
RF.M
:;• ,c,t
2 ">.·: RF.11
21,0
2 '.1~
.2::1 0
~4~
2'1"f
;:·:i~
~ : 11.
m: H
RF.H
nEH
~ -J."?
:;:: :.D
REM
231
47~
TO N
GOTO
,.•Sli'I
A l.IST
OR EXP(lNENTif\L
"WOULD YOU Lll\E
( t)
r. :w1
·NoRMf\L
230 FOR Jl-l
IF
Gt)T(1
;' ?0
1=2
RFH
2rl2
21171
1'70 IMf'UT
l '7 t REH
192 RF.M
::171Q) INr'UT
.:: ~ l
REH
t f18
10'7
18f71 GOT(I 230
l
.......
N
.......
;'86
nrM
:J~l
2'•11!"'
2'•00
CALCULATE
REH . " .. CALCULATE AN l\~SOLUTF.
fffH BI Cl\L I.VAL TE THE Vl\LUE QF
310 IF A~~BI GOTO 33~
:J l '3 REH
Ff'•R
IM T
Fl-,H
1,riq
r,1·1' ()
HFM
fir 11
'• ~"
'•21
'• 7 2
f~
Tn
6 ]0
5Tf"I"
'•
) •0 (
.. •
·t·I :~ ·
• B ( w• I
N
t
1E~>T
w • :~ ) t n { "" '" ' )
IN;>. ·r-if- .. • lf1F
Tl)
l\Bl)VE
nvtis-·
I
fH
SUGGEST
fU\NOOH•
RUNS .. ••JR
JS N(•T
f\Tf'f' '•
I) .n(W• ~ ) .nn~• .JI
·r~•·. INI
•
'• I '" I '. n J "' T l' ( w )
'•I I Mr:. )( T W
l-1-l
t.PRINr
I_ I" fl
'•"7
r. t'!fl
'•t.-i1, I . PU f ti I
or
51\HPLE
F.:VJOr:NCE
- 11 rn 1 r1'
"'' •pf\flO(•H N•H11'. f.: OS". ·NllHOL:R ()F
•
t PRINT
L PR I NT
,,.,
nnn olHW•
'•""'•
'• t'I r,
lHF.
RUNS
/\ND P..F..:L(ll-J THE MF.DIAN
l\Nr> EGllJU\ 10 THE H EO ll\N
THE HEOIAN
TlfAT
Tiff:
SAMf'>LF.
IS
NOT
RANDl°•H•
Vl\LUE F()R THE DlrFF.:RNCF P~TWEFN NUMBER OF nvNS AND THr MEAN
91\ T l\NOl\RO DEV I A f I •:'IN l I H F.: 9 Z VAUJF..: I\ T ~ 'l. I. EVF.L t) F 5 I GN ir· I C/\NCE
nu::
•Nt-· tNl, "N/•" tN./,t "HF.-" tME"
•
IJ •) f• ) 6:Jlt,
Lf'JIJlll
'•"' ~,
t. : IQ!
"
t'1"tlUMr.r:n:,•,•NuHPr-n
•
"''2
401
i.1 .. 1
l.l'HINT
f.JF. )( T W
~1?'1'
'•"'n
1_ r
:i r:i '•
n r ,., l '
370 l.PRINT
:int't 1. POJNT
:, q I LP II INT
307 LPRIMT
· 1n:i l.f'fUNT
<J(lf'I)
LPRINT •THERE IS INSUF"'F'TCJ F..: Nl
Ir t{._,. .. N. G•)TI) 630
GrJT ( 1 '•'1!3
:J : ~VI l.r'HJNT •
3 1•17.1 IF ., ..... ,_,.
3:-,0 LNllNr •
31~0 LPlllNl
370
3.7'1
:L : A
316 RF.:H
:J l 7 REl1
:JIB REH
:119 REM
:l06
:J~:l
:rn2 nr-H
Ci•)S\JA
REM sve.n ( •\JTINE
nEH Nt NVMe.r:n or ()P.sr::nVATJONS l\e.0vr:
HF. f1 N2 NUM~Fn OF QOS E RVl\TIONS BELOW
r F N l < 20 •.•n N2 <·7 0 THF.:N '5"10
:11/tQ!
: ·96
2R7
:;: 9(1)
N
N
.........
'•'•0
REH
JMPUT
1Nrur
447
'~ '•fJ
"• '•9
"•~17)
'• 5 1
HFH
RE M
flEH
4A7
Jl'Jrur
n1.: 11
RFH
HFH
•
'7 '•
I_
•
Cl
1;1 ,1f 1t
CALCUAL n ::
CALCULl\TF.:
11u::
VALUE.5 r ( •ff
I Vlf)f - N<T
J!; N•IT
NtJHl'.FRS
OISTRIP.UTION"
mir'
!"'"·'·f''tT
Hiid
lf_ST
111r
:.AHr't_r
IS
11 - ! ; I
NUt1P. E. ns
Htf. WAL() - Wt,>l_Ft)W Ir l nu1-1
rtl\ND•.IM NUHl:?.EHS
nAtrPf"IH•
1(•
'so
Rl\NO• ) H
OISTRJf'.UTJ(IN" ,, P.I\
RANO(lH
E)(P(•NF.:NTJl\L
!"il\Hf 1tr-
1t1 :, u17r1c1r111
l11in
Jr;
<;•)T•) 1>:J0
"Hlf ,,,-
id 1
h• ~ "N"
P ll f ti I
IF
{llll
._,..,,,,.,,
':)"H'I
'1 ~. l-i
r
1r t..•~·t,.
(, •• .,,, ':'Ill "'
t J ' fl I ti
"orJI
~:l"'
~:;·(,
·, _:j
., _-.,,
~ 71110
; ·6"'"'
l6V.10
N(JRHAL
F <:•n F.Xr •)NFNTIAL
Cl\LCVLAl E
N•)Rt11\L
nrH ~JI l\llO w i Vl_AlJES (IF nu::: WAI 1) - Wt.1111r11WJTZ
Jr lfl >u Wt 1111 Jn .. 1.J_· lllf : N 1 -llfi
11Ft1
~HU
•Hvt
c;n! ; \JB
•Hi_~
f1Ef1 ~lH:\fl• . •U I I NI;
Gt l':)IJB ;:1,m,'t
ni-r1
rir H
..,01
)CllQI
'•'~5
1
'•? J
•75
1
14017)
• 1Nrur Ll\HP..01\ Vl\LUE
REM
n E H SUE'fl(1\.JflNF.
'•fl~ <;1):.1J1J
I A'110
1o'7VJ
GC:tl (1 2 7111
'•'7 t nr-:11
'• '7 :.: 11r-11
"•7'•
'•717)
'• 7 I
1172
,, 7.J
'•A? nrM
'• ..,o nr11
6
'th ~
111,
;(:7 QI
Gt )T t)
453
'•~Ill
DEVll\Tlt) N r-c :i n
C<:•NGlJIH: NTJl\L
n1srn1e.UTJ(IN• ,u
l\flDJTJVE
F(IR N(1RHl\L
Cl\LCUl\LTE
STl\NOARO
I '•t'l0
REM SUP.H(•UT I NE
"•S2 G•:isue.
"INPUT
• 1 Nrur
REH
n r-: M
rt F. M
,, '•b
'•'·~
l21ZWI
HEAN VAL\Jf:
RFH 5 UP.RC:lVTINr:
GOSUB 1 2 00
GOTO 270
4 -;·5
43r!
REH
REH
RFH
4 :''•
'• 2.3
N•.>J
Rl\Nl>11r-t•
........
w
N
LrnrNr
LPRINT
~?~
FOR W•t
LPRINT
NEXT W
~9~
6~0
61~
•
TO N STEP 4
"N;:~"
RVNS•"llR
F (1 R
W~
RF.. M
REH
99:1
RE M
REf1
REM
fl F M
f! E l1
991-,
?97
??0
999
9'7~
994
nrM
nrr1
992
P:MO
?71
f, 3(1)
11-.I~>
"NI .,. . tNl. • "N2 ..· • 1N 2 , "HF.-." IM E . ·w1-· "-11··w :: -··11-1 2
"
1 T fl N STEP 4
"
62Ci'J LPRtNT n<W> dHWH) oBIWt- 2 ).fqWt- : n
t.,;: I MF. X T W
6 I 9
617 LPRll'H
610 LPRUH
616 LPRINT
RVf"S .. " 1 IR
IN .2 • "HEc-" tME, "WlE"" lWl, "l.J.·, ,. ..
or
B<W>1BCW+l),~CW+2),0CWt-~)
•
"NI.-," INl,
Ni"NUMPERS" •• NUMBER
"
"
b 11
61 .2 GC:tl•) 63~
613 LrRJNT • •1 LPRINT"
6l4 LPRINf Mi"R/\l'll)(1H NVMPERS", "MVf1BER •)f7
615 LPRJNT •
LPRINT
LPRINT
5'72
591
LPRINf
LPRHIT
~70
~0111
+:=-
N
._.
R~TURN
1090
:-:'•C'I
~~50
nrM r. ( ·' ~ ) nf\N()nH NUMPT ns
B<J:J>-..XN
Nr:XT JJ
F•)ll C -= l 7 l •) N,. lb
PE1'1 l\Ol>ITJVE C(1NCiRVENTJf\l .
IF B<C> < l
GOTO 1:90
I ?91i'J NN < C > = P.· < C >
12?'j NFXT C
J 3vili'J HF TURN
1 -~ R0 B ( C > ae. < C > - 1
l ~·fl~> NN < (' ) "'~ < C >
l.c-08 G••TO l.?:it'I
1 77 171
1:':60 B<C>-=lf~<C-1 >+Btl. - 16> >IXX%
1;: ~;:_--,
I
I
1~3~
I ;_· .:·'.]
RNl)(l7J)
F(if!MttLI\
I .-: li'ltll nEM SlJr. n(1tJT I NE 1\01) I l I VL
I.~ It.) Ft)ff .J :Jr t
Tc) ti,
121:; m : H SUf'.Rl'llllNE lli'lt'IVI USE rUNCTJt'tN
I 22t'I G•)SVB 1 ~00
XN ~ HN0<0>
1010
SVH•JllT 1 NF UT IL 1Z1 N(1 F\JNC I I (1N f-U·JI.) < 0 >
RNO<l1!> Cl\l _CIJl\LTE UN(r1) 1H1 fll\Nf)IJM NVMP.('n<; ~E'T\..JfTN 171 Mm
REl1
HEl1
1000
11710'3
l
'.
N
Ul
.......
REM svr..ni:1VT JNE N(IHMAL
REH CALCUALTE N RANDOM NUHUEns
1410 FOR J•l TO N
1420 5VHa0
1~30 FQR
1~1
TO 12
l '•00
REM SVF!-R<:•UT I NE I t.'mt'I USE RNO < 0 > r\.JNC TI ON
G•)SUB 1 ~017.1
REM B2 <F) RAtJ()(•M NUMP.F. RS
P.. ~ f F > "'1- X N
NEXT F
Fnn A-1 TQ N
ron
167VI NFXT A
l 680 m=
: TUHN
16~4 nrH F•)RMVLI\ T(I FV/\l.UATE lHE EXP•)NF:NTJ/\I_ RAN00H NVMP.F.RS
1655 REH LBA l..At1P..OA V/\L\JF.: F•)R EXPONFNTIAL OISTRIDlJTION
lAAIZI P.fi\) "" ( - 1/I P.A>•LOG<f?.2(/\) >
lf,/,"j NN(l\)eB(/\)
1 6 .20
l 625
1 6 :Jli'!
l 6'•17.1
1650!
I A I.,
lh~VI REH SUBROUTINF EXPONENTIAL
160'.l RF.H Cl\LCV/\L TE N H/\NO•)H NUMBEnS
1610
F=l TO N
1463 REM V HEAN VAL\.JE FOR THE Nl)RMAL OISTRIP.VTJ1)N
l 1t66 nr:H so STl\NOl\RO DEVIATION F•)n THE N•)RHAL OISflllBVTl• '•N
1470 ~<J>•V+SD•<SUH-6>
I'• 7~ NN < J > oA ( J >
1480 NEXT J
1-,30 RETURN
l't40 Xl,.,.RNO<li'I>
l '•SIZI SVH..,,X 1-+SVH
l 1t60 NEXT I
140~
CJ)
N
~
S\JP.-R•)l.H(NE
GOSUP. 21'1>0
RF.H
2101.1
SORT
NUMP.F.ns
IS
l\SCF.l'WING
H l 'l. "' N/ 2
ME>• B < f-12% I
Vl ~ l\VE
S•)r~r
N
JN /\SCEf-10 I NG c·•Rl>F R
NVMl?EHS
NFX
r
.,....."'
> ... :. "'
27'•<71 NFXT 1. 1
~2 '"10 nF.T•JnN
';',:>,~
;· ~· ;·"" e <, ' 2
211QI F""(lR l tm ;: TO N
2121ft F•)R J _:::.,. 1 Tl) l_ I
2 1.~· ~
REN e < L 1 > ANO e. <,J /. >
R/\NOt)11 NUMI '. F II S
21 :-10 lF P, < L I > ' P. <,J ..... > THF:N 215<71
~ 140 G(•f"r") 2.:: ::m
/?I '1~ S/\,,,R.<L 1 >
21t<.lll H-:Ll-J2
.21 70 L9 == Lt
/. IA!71 F(•n I\ I~ I T(1 N
2170 e < L 9 > ,_. !?. < L 9 - 1 >
2~' 0'1\ L 9,.,.1 9
t
221<71 rwxr Kl
RE H
REM SORT NUl1['.FRS
AN
2 I Cll,,
21 ~·j
HF.DI
RE TURN
1 HF::
7~il1<71
HF.
HF..-<P.<Ht'l.>•~<H2Z+l))/2
RF.H
2._,-'>5
? 1711<71
2Plf>li't GOTO 20Bt'I
2<71~10
20'•0
2030 H2'l.n(N+I 1/2
IF Nl'l....,M2'l. lllEN ."2 070
21rVt'.3 RF.:H ME lHE MFDIAN VAUJE
~7'020
lt~E
t)Rl)E:R
7015 REH NIX AND M2 Z AUXILIAR V/\RIAP.t ES lO CALCU/\LTE
2~10
.20QI~
?0t'10 REM Cl\LCVLl\TE THE MEDIAN
MEDIAN
........
-......)
N
Tl) N
IF
B<J5> ~ -ME
THFN
NORMAL
APPROXIMATION
SD r..: SSl •
.".
~
VALVE
REH P- 1
24~0
RETURN
2 '• '•0 RI =SD• Z
2435
CALCUl\LlE
THE
THE
THE
VLAUE BETWEEN
DEVIATION TIMES
AP.-Sc)LUlE
STl\NOl\RD
CALCUAL TE
2429 nF.H IR NUNBER l)F RUNS
24~0 A•ABS<IR-EN>
2'•28 REH
2421
Z
VALVE
THE
AT
~'l.
NUMBER or
HEOll\N
REH
THE
TllE
ss-<<2•Nl•N2>•<2~Nl•N2 - Nl - N2))/(((Nt•N2>l2>•<Ml•N2 - 1))
DEVIATION roR
APPROXIMATION
Tc)
2420
STANDARD
r:c;iUl\L
2415
so
OR
THJ:: 11UHl\l'-I
N ;: > THF.: MFll I l\N
Tl If_ MF.O I l\N
l\Pc)VE
NORMAL
REH nur~s TEST /\BOVE /\NO BELOW
REH Nl)lll1AL ArPRl)XIHATION TESf
l~ETURN
(1eSERl\VT IONS
2350
24Ql6 REH EN MEl\N VLAUE FC>R lHE
2410 ENM(( 2 •Nl•N2)/(Nl+M2))+l
240QJ
2'•Ql'5
;·: ~Mll
2:3"i0 N l =N ·- N2
23:3QI
(1\..J<
e. < 15 > Rl\NDc)H N\JMRFRS
RF. 11 M2 NUt18ER c)F l)F3SERVl\Tl0NC) f'.EL'"'l-1
l~i"'l
N2~1'C+ 1
23'•0 t.JEXT 15
2 34'5 rlEM Nt NUMP.EH (IF
2:3 ~ 1
2 .1 ;:: QJ
2310 FOR
231 S REM
231710 REM FI ND V/\1..UES ABOVE ( tH > l\NO f '. Fl.
LEVEL
HUNS
OF
ANU
HEAN
SIGNIFICANCE
THE
........
co
N
flE:M
Wl
/\NO
TF.:ST
Vl\UJl::S FOR
JR =- JR . .
NEX f
.:' OH'J
2 fJJr,,
z n1.0 nF.nmN
J
I "' l
~n(1"1
MN<J> > ME
lF
279171
272~
THEN
203 (11
Gt)f•)
THE
rz
.?7:Jli'I
Nl..IHP.r- R (•F
lHE WALO - l-#l)f:"t)WI
nEM SlJCROUT J NE Tt) CALCUAL TE
R E M IR NUMBER c)f:" nUNS
REM NN Hf\MOt)M N\JMP. E.l~S
IF tlNl I >>MF.: THEN 1=2: IR•I •
1., 1 t 1 R ,,. J
REl\JRN
W.?
m::M IR rtlr-: l'llJ11P.ER or- RUM<)
?7 : W1 F(•R J ... :,· 10 N
.27'•0 l)N I Gl)T• ) 27 ')(7!, ·.;: 79Q!
27~0
117 NNl,J><HE THEN ;>e :JQ\
2760 t ~.7:
:'.. 7 7 fll I R = t f·H · t
27lHi'I r;1~ I 1) ;:- q :10
27Cl!6
271°'
27 .:t·Q)
27~3
27Ci'!0
2630
261171 Wt=-D<N21NI>
2f";:QI w_;: ,,HlNl oN2>
2605
::?h00 RFH 1-11\L[) - W(•l_FOWI TZ
mJNS
RIJN
T G >r
~
N
.......
29~~
B <,JI > ARE
RE11
3~08
3J7~ REH SVE\ROVTJNE
:1 t FJ0 Gt)SlJB .2 7 Qlr;:i,
319(1) GOT(• ~: 90
REM s venOVTINE
G•)SUf3 2 :rnlft
316~
:-• l 7Cit
2700
2300
201l''H21
31~~
nF.H S\llHl•)\JfitlE
Gt) f-1Vfl 2000
THEN
., 1'35
31 60
J ~~ N
IF
31~0
31~0
ENTER
TELL
THE
CALCUU\lE
sonT
CALCULATE
fNPlJr
,J ... J+I
NN<J>•XN
·w•)ULO YOU PLEASE
XN
rrHNT
3110
3120
BC~)aXN:
INPUT • Wc:tULf) YOU rLEASE
OIM B<N+2Ci'l>tNN<N~20>
312~
REM TESTING USER NUMBERS
2 9QI
TllE
MEl>ll\N
TtlE
NUMf?.ER
NUMBERS
TllE:
RUNS
OF
RUNS
NUMBERS /\RE
OF
NUHP.ERs·
MANY
NlJHe.ER
HEDl/\N
t-WW
YOUR
ME
TllF.:
NUMor::nr,
CALCULATE
317199
G• I ' 0
2700
DEVI AT I •)N
DF.:V If\ TES
CALCUU\TE
23Ci'l0 SORT
2000
1 'tl'J0 NOR HAL
STANOl\RD
Rl\NDOM NUMCERS
:1100
3102
:1'1) 1•0
r,n~;un
SUROUT INE
2 70L'l
REH
::n't:-· ~
rn
:.m ;· Q!
:10
Rt:.:11 SVC HOUT I NC
G•)SIJB 2300
: mt~
2111QIQ'I
flEH SUP.f-WUTINE
N•<HN'l. - 1>•2
31710~
:Jfi" I Q'I G<)SUB
REM SUP.R(•llT I NE
<it)')IJP. I '•'1lfl7
~'7?~
301110
FUNCTION
RANOt)H NUMBERS
50
TllE
THE
101210 USE
2970 NFXT J
29 7':') REM U MEl\N VALUE
2'1A0 U-.'31 S0=-.12~
2990 NrMN'l.
ARE
SIJJ3ROUTINE
1 000
REH
G(15UP.
P<J>•XN
295~ REM NN<Jl)
2760 NN<,J>ef:>.<J>
·291,")
2'7'.'0
2? .l'l
:;_:<;u ,Q!
RN0<0>
TO
DISTRJBUTl0NS
YOU GO I NG
REH HIX OF RANDOM NUHP~RS FORM UNIFORM AND NON - UNIFORM
INrur ·Hl)W Nl\NY NUMBERS DO YOU Wl\NT·1 N
2915 DIM P.<N+20),NN<N+20>
2970 MtJ'l.aN/2+1
2?30 FOR JaHN% TO N
2910
ENTER.lN
0
........
w
JS
.?0~"'-'2
.'77 . l~:Jl
'?'.'.'.>:176~
•
• h~ I '•9b
• 7 .•'•0lh I
.71.070'7
.01.2.-.1-,
• ""•Oll'>?O
. I 2:11lJ"14
• 2~"1'/1.1 1•0
•.-: 4500'•
• '•71 ,~ 0 ...
• ~:l'10?2
.61flh67
2'5
EVIDENCE
. 1~· ·,nqb
. OW??.;1
.9 :HJ., :H3
. 7" l " I'•
. ,,,, :22'•
• ')924'.'l : J
• s~c..isw1
. ,,;-,run
• ~ 1 1:17(,110
• Ci'J4 76lb
I I n.:-·h:l
• l '•.]?I
N.21.:
NU11Bt.ns
INSUF"f'71CIENT
nANOc)H
H l ... 2 '5
50
THFRE
~
• 9b I 300
0
0
• '7bR:J :11.
.90~.C.76
. ,,.,3·s 11
• '•rlt7'1 l
.OfJ0076
79
• ~hq:J11~
.6 1•17';',l
• 7 I l.0'70
• 74:1 U12
• 70771,2
:~50'•
1 : '7~~·
. ?'·~ 17 l
.4760".i?
• '..i~ I'• l
• 1-;.2 7633
.671?47
• 7 'l~ .Z f.1'\
. 1n1Yn
•
•.~.::·.;0?'.3
.
SAMPU?
• li't .lb Hlli't l
1>0~)S6
20
THE
• I 2 ·n,1t I
•
nut1~;...
THAT
.OhY)l~2
ME""
tjf7
f;VGGESl
NVf-ll'-t::R
T(I
TESTING RND(O) FUNCTION
IS NOl
nl\NOt)t-1
w
.914019
.6EJ7 :rn~
-~b~llllh
• 3 I '• t> '• I
.49:?J'3A
• h2:J0'j2
• AR21.::! I
N2r
t::VIJ>F.NCE
• 1991:;5
.34600
• '306396
• ~73h 1t~
12
I I
INSUFFICIENT
Rl\NOC:•M N\Jl10ERS
15
.02:19719
NI"
2]
THERE
. ~30'11~
• 76',922
.967'527
-~7.,~~.,
• 2 1 " '• , ,,
• '•3A0:11
• '3 I '• 'i' 3
HF. ,,.,
(1f
!;UGGF5T
NIJl1UE R
T(I
lllJNS,...
"fHA 'l
TESTING RND(O) FUNCTION
0
Sl\Hf'LF.
"
• '•.">11»~>73
• ~ : H'U11~
."'\00?1b
.n.-,9:;1t:J
• 2. ."'.97 ::11
Win
·~
lHF-
15 Nor
w;:... 0
Ul\NO(•M
N
w
l 2:i 7
1
1
•
E - l '•
l)F
IUJNS:w
• 752'•61
.9~0007
3. I 2 110F.:-
.617704
.R'7~72b
•
I~
• 10'79 l ~
• :-.:;~914
9C1_'~07b
2 •. 834?.:':E-0~
3. 1t9 11"LIF.:-ll'l'i
• ;·9~~20
l. 02349E- 10
3. 0 I 7 3 RE - I lr'I
7 .1{)086.lE- I 0
R. ,.,r,2471'.:'F. ·- l li't
.1 • . l'J.-::41..E - '11,
q. 0062:1'£-06
2. 2?6 116E - 0'3
N2• 24
NUMBER
fL 3'•3 l'•E- t 0
l. 2092:1E-QI?
q. 019~'•E-· 06
t. on:> l 7F. - 0~
2. 7:1:.171£.-(;lt~
•:;. 75:1..J:JF.- 10
2.7~j:7RF.-l0
1 •
:;-:5
N l""
'•9 NVMOF.RS
l.
AO~
I
7E:- · 0~
I A
.0 11RltU
• 9'• I b0'•
2 • ~ I 6 J '• E - l '•
Qt~
70171£-- 0~
•
.OIJ~
'196?
..71.6
• 91 /.02:1
I .ut".l76?F.. -·l4
.]'10~WI~
~I
•
2.9707hE-'1t~
2.
I • ':1 7 I f, 11 E -
a. rJ6~?7E-l.H1
~E-06
I. I ~ ,~,,~E-0~
2.1'70'• JE-0".>
2. R/ :H .l.E-05
• I ~:II 0 7
. 3 l ;: 0::~
1
•
0. 770rl7E- H'I
791.~~UE-10
'•.I. 7 3
4.
~. 70~Rl.f::: -
0. 2 '• "'J 71, C - I 0
9. 09'1'19 'TE-l A
I. 426~::u=--· t"'
:J. 46~'•7E- I (;II
7. 90'if-t2F.:- l0
HE•
9
THE SAMPLE IS NOT RANOOH
TESTING ADDITIVE CONGRUENTIAL METHOD
__,
w
w
9
•
?f.19121~6
.A07~67
-~09Q)07
.Zli'>ll~:l
9
F.:VIDENCE
4. (IU'S 7"lf:-lil~
• 2:5 7 .2'> l
• b:l l '70'•
• 8I'•1 El?
.91B26R
N2=
NUt1µF_H5
IN~\JrFICJE"NT
RAN()1)f1
IS
6 • I '• 171 l :JE - 06
NI ...
l A
Tflrnr::
•6 l
HUNS-
THAT
0~U6
~
!-1\HrLr
• 7~ .... ~)9.]
08~,.,97
•
7. 241'•£. - i,,6
2. 7742.:lE-Cll'.)
IS NOT
.039626
• 4' 1 ~9"•
• I 7 1e6 :J
1.!l •
l
TtlF
. ·rc.n1,
. l 1121
• ::-· A.2"• .?7
t1F "'
N\Jl10EH IJF
T(• SV<iGF.:ST
TESTING ADDITIVE CONGRUENTIAL METHOD '
W::?..,
I4
Rf\N()t)t1
+::>
w
__,
JS
• ., l
ei 1.~
.~lCllQl"t~
• 51on.-.
.5721'\9
. 1'>30701
.~:J03RI
• ~ ;· 1 ~ ;· f,
• snh .2 7h
• 6611':}97
l. (118607
Vlt.i '504
03 ~H,,,c,
I.
.9:1971-.1
t.
0
.9710?2
•
.0~'•11.ft
• 7 '• '•Qt:l
. ? I All 19
.6927~~
'.:1~ : •
.0.:?;'7
• 910121
7'-'6~2'.'\
.617100'.l,C,
.679367
12"l3
.~I
.
• '•I qq1,, 1
. L l8'75?
• :J :J 709'•
.497 22 2
• :lmi', :H?
- • l 2 1• 3 <°: 6
• (11 :37 I 703
.21736 1
.~IQJ9UB
- . 0 1• 5 3 4 I b
.lC)"J79l
HE:-
1?
• 4 7901 l
N7,...
SlJGGF: S T
tlUHOER c)F
T (l
.:176£161
1
• • : • I 077
• 4r-,9 .z ,<,2
• 1,9,c, ; ·oe
~1
F:VIOF-NCE
-.1'°'7".HH
.140724
• 22"')"J :m
• :J :lr1n I h
• : rn".:>~.l'l
• 1, : J1• 7 3
• '•67b·b'.l
NI,..
31
INSUFrICIENT
/-, 7. Rf\NO•)H NVMBr: ns
Tt ·IF.. HE
7
RUNS ~
THA T
~M·trLE
2 '·~
150
• 6 .l '• I'• I
• 7 '• :J :• I~
• f3.2A:19
.9fllA'•7'1
I. 0~0.27
0
.~7~217
• '-' I 7 I Ul'.l
-~100~?
• 34'•663
• 4.Zh3fl/,
• 4 't">?etb
• 1te .:.:n 1
•
-- .01107/,')
.1'9hlFl'1
3 I
nu:.
TES TI NG NORMAL DISTRIBUTION
15 NOT
nl\NDOM
U1
w
--'
2?~'1'•4
fHIN~i.,.
ltll\T
.607947
• "79819'•
• 8M'l?l'l.2
• 97M11lt4,
• 759AHI
.fl:JOI
• 8?677 -~
• '•~ ::? I 06
• ~I H 11'.Hl
.ld701l
.3 2 2 f-12"}
MF:.r
A :' I :;:- 1, 7
• bVl791t7
.~00'\ 2 3
. :m;-:-.:-ri
•2
N:<: .,
Nlll1[ff U t) I-
TtJ SUGG[Sf
'.)9"/'>''•"
1-,')8h67
l 5 ."J2?1~
:l5b9 I'•
'•r~97 t t.
I '•
13
INSVP:-FICJFNT EVJOF.:NCE
Rl\f'H>t)M NIJ11P..ER5
I~
.874~3f>
•
.
•
•
•
.
Nlr-
27
TllERF.:
0
Sf,Ml'l.E
~
.nb3 ~7 ~
.R~0H~2
.64~712
.~n~41n
.46~719
.~24721
\.oil-=
l '•
lltf""
TESTING NORMAL DISTRIBUTION
15 N(1T
W2m
Qi
Rl\l'H>(1H
O'I
w
. 1"1 :•96
•
•
.
•
• : \71.·1,o
1t/.'9 1 tf;l.~
•
•
:J(,~h .1?
"
0
.1. l 't7!c'l:l
• 9<7'?/t>O
1~n?
·101•
~.77".">.i>~
•
.'.') 2~314
.6 1tl607
• "•Qlh?'•fJ
• ~1VIH2q6
•
• '•'17 262
• 21 :111 : \r>
• I M 11HQl7
• Vt70'.:.i9:l7
10.?0'• 7
I 324'1'4
.ll lh4 l
:L?l• I ·1 q
. "'"" n 2 s2
• lt't'•O I ..?li'Jlt
• ~"'II, ·7 1, A I '•
• VI 7 I " I :Vt
• I H'l?~I
• t t.1.21,
• 2:.JI 7'.')0
• '11'• .'' B712
m11-1r,..,
.. Q13
bt, ~· I+
~. 'rn~1·;1,r:_
• I
• (l],:17'.\7 I 2
l'lf. ,.,
4.51~"iF - ~ll
;.:~
NUMUr::n or·
2. 69:J l :JE - 1.'U
.l?U::Jh.i' h
• 04 79:. : 6~
N2 ..
R:\NIK1M MUl1"'F ll'i
NI,.., ·7 3
'•'3
TESTING EXPONENTIAL DISTRIBUTION
,2(,f)~9b
"
• "1'+0'11?2
• H'•fJ.:>(,,4
.'J\i00?
. ~n 1 ·. : .J'•
•
• 1 9 I'• I b
• vi•1-.:•t+76
. I .?Id•'\ :1
• "''· I •• 9EJh
• 0.7?bOln
.t'l'•'•61<1(,
17
w
-......J
15
1NSUrFICIENr EVIDENCE
.5'•1872
• ~'· 1091
• 1021 ??
• =1'•9 .10f,
.171"H73?
.t9bl97
.372116
N2• A
.0t::J06~7
NI• R
lb RANO•)H NUt1BF.. ns
THERE
RUN~·
THAT
• 3;-:i I I~
.~7610?
• 21> I
I
• Tl~7 2
ll'I'•
• 11mn ·1
f"tf:""'
NUMBER OF
TO !)lJGGEST
'•
SAMPLE
• I 7".>'• 7".')
• 3""'117.L:J
• :109l·H 9
I. 1./17116
WI ..,
9
THE
TESTING EXPONENTIAL DISTRIBUTION
15 NOT
w2- t :J
Rf\Nl)•.1M
00
w
1;n:lT1 ~ 4
• '• 2? 113 l
• '• 71i•)l, 00
.'537 7 6"1
• ~R9:1'•6
• 6'1'.i .;: I :J
• 7967Yl
l 7 l 4£H1
• 2 1:t'l?7
• 34 . H,'• 7
•
..
20
. '•b 77<7
!>l\Hl'l.E
.~1744 :l
• A9lt''.HJ
• l.rl ' • 17' =~
• l>'ilOVlt'IU
71, l
.'.;7/l?t.
~
.: 'l
•
• b3l•
• 761ii·1.;:~
• q :1qb7'•
. "'•'•0? .1
.~17'1)7:J
• :1 ~ 11 l ~ '}
• 424'.'"1l7!fJ
• ;'f.9 ;'II'•
• I '•'•::18.7
...~.~
l I IE
.40:3677
• ~~ .:""90 2
• "597 '"73
• blt905'7
• A4.142
HIJN!I·:
n "' T
. J ~1 I '• 'l :J
. ,, ; ·J??'t
• '•A .2 3 11 .:'
• I Vlllll I
. .-·--, ; ·via7
t1f " .,
•) F
f ) \JGGI : !:; r
N\H1l' E 0
T(I
• .2 fl:J:l99
• 1,;;_· 1 fJn3
• 4 ,, l ::; : 1.~
• ;;.· 1 3</'t
1
• a0 .'1nn
N~
20
Nlr.
I NfjUFF I c I E NT E V I DE.NC£
Hl\NOOH NUf1l'Cnr,
Is
'•li't
11 If-. nE
19 N• q
f1Af-ll)f1H
TESTING A MIX OF UNI FORM AND NON-UNI FORM DISTRIBUTIONS
~
w
1"1'
• '• '· 'J l 5:}
• ~'•9470
• b7'30'1A
- 17U
SUGGEST
RiJNS-e
1111\T
.~171.b?.
.~7J44:l
.0i1a~7
.49'JQl0J
~~Cl2:Jl
•
• 6A 711\'18
~,,63 :1:1
.~~~~73
-
.00~~j~2
t1F..-:
NUNBF:R c)F
T11
.31931>
EVJOFNCE
.£'1391006
N~""
1171
INSUFFICJF.NT
RAND•"•H NlJl1Rl': RS
IS
'7. J93~l'•F:
• l347171~
Nie
20
Tltf"RF:
b
Sl\MF'LE
•
•
9q~1,
I 1
626H : ~4
• l ~61 l .7:.
• '·~::'81
• ~:J l W7:l
WI "
I l
TllF.
IS NOl
•~
Rl\l-AU1)t1
w;:-
TESTING A MIX OF UNIFORM AND NON-UNIFORM DISTRIBUTIONS
+::CJ
• , , , 7 : ~'1
.777no
.???'1?
193/,~
• 2'lFJ96
• ~:Jn~··9
. h71iT1
.7 ~ 019
• 9')1~")
"'
SAMPLE
• ?'1'1'1'1
Ci'I
. nnrmn
-~r11
• ':\','1<]'1
• ~Fl -, ..,'.:.
-~60?4
• 7
·'•771i0
• 37 1•6?
. lifUb:l
.AJ0 .19
• .;.'It
.01~<}7
.llJI 2 .T l
WI.,
.2 l
THF
• 2 .::· ·190
nlJNS "'
ltll\T
• I I l ti
• 2~n~18
·'•70'11
:f"!
. ..., ''•
.0 ..:' l 'Jb
.01111
. 01'170
• Ci'l I fflh
2~:1
~F.-Ci'14
• 37'• ,,~:
• t'I I
Mr-=
Nlll1['.J:: R t)F
T(I SUGGEST
l.
N2!9
EVIDENCE
IE -Ci'I:;
19
17
IM~.;uFFIClFNr
ru\N0•.1f1 NUHBF.: RS
IS
.(lll7:16
N1.,..,
3'3
THFRF
TESTING USER NUMBERS
IS
N•.11
\.12-
,.,
FU\tJDOH
+::-
•2
•2
Nl,..
lei
" ' NUt10ER5
. 2
0
• '2
.2
HE"•
• 2
'1t
l
• 2
N2a
NUl10En IJF RUNS,...
.2
THE SAMPLE IS NOT RANOOH
TESTING USER NUMBERS
0
• .c.
•2
..., ... 0
WL .. l7t
N
.+:::>
APPENDIX C
NORMAL AND
WALD~WOLFOWITZ
TABLES
144
TABLE 2
WALD-WOLFOWITZ TABLES
lio . 0 ~ 5
2 3 4
5
2
2
6
7
8
9 I0 I I 12
13
14
8
9
9
9
9
15
16
I 7 18
19 20
2
3
4
5
6
7
2
2
3
3
2 2
3
3
3
23
2 3
3
3
3
4
4
4
4
3
3
3
3
4
4
4
4
4
5
5
5
5
5
6
12
13
2
2
2
6
6
2 2 3
5
2
2
3
6
6
6
14
4
4
5
5
5
6
6
7
7
7
7
15
2
2
2
2
2
2
3
3
3
3
3
3
3
4
4
4
4
4
4
4
4
5
5
5
n 7
5
5
5
6
6
6
6
6
6
6
6
2
3 4
5
6
7
9
9
10
lo
JI
8
9
10
11
2
16
17
I~
19
20
5
s
5
s
6
7
7
8
7
7
8
7
7
7
8
8
8
8
8
9
8
9
I0
7
7
7
7
8
8
8
8
8
8
9
9
9
9
9
9
10
9
JO
li e
11
;
n
2
3
4
1
:
I
I s
6
7
8
5 7 9
11
12
13
14
15
16
17
18
19
20
,I
1.
12
12 13 13
11
12
JO
JO
II
11
12
!2
13
13
13
14
13
I.+
15
16
17
18
19
20
19
19
20
20
21
21
22
22
20
21
21
22
22
13
23
21
22 23
2:! 23
23 24
23 24
24 24
s
12
8
6
7
9
10
q-
10
10 11
11 11
11 11
II 12
4
I s
Is 1 s
! s -: s
I5 7 9
5
11
9 10
10 JO
10 10
12
10 II 12 13
s 1 9 11 12 13 13
5 7 9 11 12 13 14
5 7 9 I 1 12 13' 14
5 7 9 11 12 13 15
5 7 9 II 13 14 15
5 7 9 11 I 3 14 15
5 7 9 11 13 14 IS
5 7 9 II 13 15 16
5 7 9 11 I 3 15 16
5 7 9 JI 13 15 16
5 7 9 II 13 15 16
5 7 9 11 13 15 16
14
15
15
15
16
15 16
16 17
16 17
17 17
17 18
17 18
17 18
17 19
17 19
16
17
18
18
18
18
19
I9
19
20
20
18
19
19
20
20
20
21
21
2.+
24 25
25 25 26
25 26 26 27
SOURCE: Isaac N. Gibra, Probability and Statistical Inference for Scientists and Engineers (Englewood Cliffs, NJ: PrenticeHall, 1973), pp. 299-300.
ar
P \Z
. Y ~6U33
.91 /6'/J
.9 10305
.f. 1 017 I
. 9~
.04
.05
= .990650)
.!F9l50
. 9 ~ A /J6
. ~r·ue 11
.!P8 :!59
} 1t1;~18
.9 7 1144'
. 9~5R5!:1
. 91~4!;7
.9 ~ 2Ci!J6
.!l:'o:!53
. ~07itr,
.CJ"19J2
.!J81l\2
.93812
.!.M950
.9590'1
.!l67f2
.91 J81
.~n.01
.8500
.072!J
.l1n5
.9tJ'.JR8
.7703
.79!.I!>
.8i64
.7JR9
. 70!)4
.5160
.!>!i!:-7
.5!J-lf'
.En!
.f70l)
.eon
. 9 ~' 8!.i7
.9 15975
.9 -' 70J(l
.9 1 .1 814
. 9"1M1f
.9'UR5fi
.9~4fit4
1
.97982
.98412
.S8778
.9 :'0613
.!.16784
.97441
.9!J~94
.93943
.95l)5J
.8511
.tl749
,(1944
.91149
.926"7
.8289
.1422
.77Jit
.1oee
.fHJG
.6368
.5~87
.!'•!>'t6
.5199
.. ,· ·:·:.
.. , .
I-~
\
166
.918893
.9 7 fM6Z
.9'7111)
.9!7U82
9 ~ 6093
.9~.i
.970JO ·
.98461
.98009
.9 "0RGJ
.9'3U53
. 97~00
.94062
.95154
.9G080
.968!.i6
.P.!iM
.8770
.0962
.91309
.92785
.7454
.7'164
.R0!>1
.8315
.7123
.!l6JO
.6016
.6'106
.6772
.5239
.01
l)
I -
. ~r7!M8
. 9 ~ 1'511
.9 1 0930
. 9 ~ 7197
.9'4915
.9'6207
.91!077
.!JB500
.91J840
.9 1 11ee
9 1 3244
.97558
. ~6926
.94179
.95254
.96164
.8577
.8790
.8980
.91466
.92!J22
.1Hi1
.7486
.7794
.0078
.8:140
.5279
.5676
.6064
.t144J
.6000
.'J7
l
ci
.01
.9 ~ 860~
.!FR9C:5
. 9~8C'12
.9!0999
. 9 ~ 85!i9
.9172112
.9'5201
_915417
.917:.t65
.9 7 UOH
.9~3ft13
.9 .. 1576
. 9U09~
.98169
.9fl574
.94408
.95'149
.!'6327
.970fi2
.91610
.8661
.0810
.90l "7
.91774
.9Jl09
.7R':>2
.A133
.8J09
.7~it9
.7224
.5359
.6753
.6141
.6517
.6819
.09
.9 25060
.!' 26)19
_9113o1-1
.9 7 3431
.98124
.9%31
.98870
.94295
.95352
.9ti216
.9699:>
.97615
.8599
.8810
.8997
.91 fi21
.93056
.71!JO
.7511
.7823
.9106
.8J65
.5319
.5714
.6103
.6480
.68"4
~_ii.~;. ·._ .r;~>· - -
Aren
SOURCE: Isaac N. Gibra, Prob ab i1 i ty and Statistical Inference for Scientists
and Engineers_ (Englewood Cliffs, rtJ: Prentice-Hall, 1973), p. 561.
. ~.FOli50
. 9 ~81:J4
.9 ~ 7"115
f!>•l9
.!;:r; 13fi
1.1
J .8
2.9
3 .0
_!1''6liJfi
.9:'7523
.9:'H193
9:· n1;o4
. :l ~ 54'1J
9 7 5 :J:i!I
. !.l ~ IJr.J:t
.9~5fl•)4
. ~J.':.!014
.!J'Jt'63
. 9!] '/~0
l.I
2.e
.9'4297
.91!;731
.91if1J:
. !lf!'J!>(J
. 9 1 1802
.983'11
.91J713
.!J!0097
. 9~2 "51
.978~2
.97J~O
.9J6!J!J
.94845
.!J5818
.9fifi38
.!'8~21)
.9/U31
.98 '.JllO
.~urn 19
.9!!!.183
.91?240
.9:1!17-t
.9"73(?
.!l5n.J
.96!Jlil
97257
.!:ln:Z•J
.P4'85
. U7UR
.890'/
.90824
.913fi4
.82JO
.796 '1
.70t9
.7357
.767J
.6bt;4
.6nJ
• )911)
.6110
.5517
2.J
J.4
.977711
.!1'1257
• 1 t;J6it5
. 977~5
.9 7 HlJ
. C)lj4'J!j
. '.JR21·1
.90610
2.0
J.1
1.:t.
1.1
1.9
. 9 ~l631
.934"8
.!M6 .!0
.8iiCi!J
. ~0·1!.10
.92073
.~1914
.8-t61
.7M1
.7939
8212
.7J:1"
.6985
.OJ
. 918650
-----------·- - ---- - -·- -
UfltJ6
.'11319
.9452()
.9554)
.:Jfl-107
.971:l'.J
t.I
1.1
.oz
.5080
.5478
.5R71
.6:1!>5
.tW2il
-
.fltlUR
. 90658
.6Y50
.71Yl
. 7fi"
7!.JH:
.IJlffli
.6591
.5040
.5":10
.su:1 2
.fP17
---
.l>1
1 - «
.04'1tl
.86b5
1.1
1.3
1.4
1.0
1.1
1.l
·'
.8
z:
.8413
.8fi43
.8049
.90310
.n51
. /!>IJO
.7001
.Ul59
.I
.1
6915
.I
....1
.z
5398
.5793
61H
.6!)!14
5~
..
< z, -• l
~-
Entry
(Note:
rABLE D-l'm•t.
NORMAL TABLE
TABLE 3
..t::a
......
(.11
LIST OF REFERENCES
Chacko, George K. Computer-Aided Decision-Making.
American Elsevier Publishing Co., 1978.
Daniel, Wayne W. Applied Non-Parametric Statistics.
Houghton Mifflin Co., 1978.
New York:
Boston:
Emshoff, James R., and Sisson, Roger L. Designing and Use of
Computer Simulation Models. New York: MacMillan Co., 1970.
Federer, Walter T.
Co., 1955.
Experimental Design.
New York:
MacMillan
Gibbons, Jane D. Non-Parametric Statistical Inference.
York: McGraw-Hill Book Co., 1971.
New
Gibra, Isaac N. Probability and Statistical Inference for
Scientists and Engineers... Englewood Cliffs, NJ: PrenticeHa 11, 1973.
Gordon, Geoffrey. The Applications of GPSS V to Discrete System
Simulation. Englewood Cliffs, NJ: Prent1ce-1"lall, 1975.
Graybeal, Wayne J., and Pooch, Udo w•. Simulation: Princ itJ es
and Methods. Carnbri dge, MA: t~1 nthrop 'Pub I 1 she rs, 1 0 .
GPSS Primer.
Greenberg, Stanley.
Sons, 1972.
New York:
John Wiley &
Hajek, Jarsolav. A Course in Non-Parametric Statistics.
Francisco: Holden-Day, 1969.
San
International Business Machine Corporation. "Random Number
Generation and Testing," In Reference Manual C20-8011.
New York: 1959.
Kunth, Donald E. The Art of Computer Programming. Vol , 2;
Seminumerical Algorithms. New Yor~i Addison-Wesley
Publishing Co., 1969.
Landauer, Edwin G.
The Effects of Random Numbers on Appl i cations." Research Report, University of Central Florida,
1980.
11
147
Lewis, Theodore G. Distribution Sampling for Computer Simulation. Cambridge, MA: Lexington Books, 1972.
Phillips, Don T.; Ravindran, A.; and Solberg, James J.
Research. New York: John Wiley &Sons, 1976.
Reitman, Julian. Computer Simulation Applications.
Wiley-Interscience, 1971.
Operations
New York:
Schmidt, Joseph W., and Taylor, Robert E. Simulation and Analysis
of Industrial Systems. Homewood, IL: R. D. Irwin, 1970.
Shannon, R. E. Systems Simulation: ·The Art and Science.
wood Cliffs, NJ: Prentice-Hal1, 1975.
Snedecor, G. W. Statistical Methods.
versity Press, 1963.
Ames, IA:
Tocher, K. D. The Art of Simulation.
sities Press, 1963.
London:
Engle-
Iowa State UniEnglish Univer-
Wald, A., and Wolfowitz, J. "On a Test Whether Two Samples Are
from the Same Population. 11 Annals of Mathematical Statistics, Vol. 11 (May 1940): 68-84.