Chapter 6
Random Number
Random Numbers
A number chosen from some specified distribution randomly.
Random numbers are samples drawn from a uniformly distributed random
variable between some satisfied intervals, they have equal probability of
occurrence.
A number chosen from some specified distribution randomly such that selection of
large set of these numbers reproduces the underlying distribution is called random
number.
Every number is equally likely to occur and there is no pattern, and thus no way of
predicting what number will be next in sequence.
Most simulations are random number driven.
General Properties of Random Number
•
3 Maximum Density: The large samples of random number should be generated
in a given range.
4 Maximum Cycle: It states that the repetition of numbers should be allowed only
after a large interval of time.
Pseudo Random Numbers
Here pseudo means false.
Pseudo implies that the random numbers are generated by using some known
arithmetic operation.
Since, the arithmetic operation is known and the sequence of random numbers can
be repeatedly obtained, the numbers cannot be called truly random.
However, the pseudo random numbers generated by many computer routines, very
closely fulfill the requirement of desired randomness.
Pseudo Random Numbers
If the method for generating random number or the random number generator is
defective then generated pseudo random numbers may have following departures
from idle randomness:
1. The generated numbers may not be uniformly distributed
2. The generated numbers may not be continuous
3. The mean of the generated numbers may be too high or too low
4. The variance may be too high or too low.
5. There may be cyclic patterns in the generated There may be cyclic patterns in
the generated numbers, like
a) Auto correction between numbers
b) a group of numbers continuously above the mean, followed by group
continuously below of mean.
Thus, before employing a pseudo random number generator, it should be properly
validated, by testing the generated random numbers for randomness.
Generation of random number
In computer simulation, where a very large number of random
numbers is generally required, the random numbers can be obtained by
the following methods:
1. Random numbers may be drawn from the random number tables
stored in the memory of the computer.
2. Using electronics devices-Very expensive
3. Using arithmetic operation
Requirements of a good pseudo random generator
1. The sequence of generated random numbers must follow uniform distribution.
2. The sequence of random numbers generated must be statistically independent.
3. The sequence must be non-repeating for any desired length. Although
theoretically not possible, a long repeatability cycle is adequate for practical
purposes.
4. Generation of random numbers must be fast because in simulation studies, a
large number of random numbers are required. A slow generator will greatly
increase the time and cost fro simulation studies.
5. The generator must require less computer memory as will as computational
resources.
Algorithm for generating Random Numbers
1. Linear Congruential Method
A sequence of integers X1, X2, X3, ……….. are produced between zero and m-1 by
using the recursive relation as follows:
X(i+1) = (a X(i) + c) mod m, for i = 0, 1, 2, 3, 4, ………..
The initial random integer X(0) is known as seed, a is called multiplier, c is
increment and m is the modulus.
a. If a = 1 in above expression, the expression reduces to additive congruential
method
i.e. X(i+1) = (X(i) + c) mod m
b. If c = 0 in above equation, the expression reduces to multiplicative congruential
method,
i.e. X(i+1) = aX(i) mod m
c. If a>1 and c>0 in above expression, then it represents mixed type congruential
method. For this type we use
X(i+1) = (a X(i) + c) mod m, for i = 0, 1, 2, 3, 4, ………..
2. Combined Linear Congruential Method: Combined linear congruential method
uses the combination of two or more multiplicative congruential generators so as
to provide good statistical properties and a longer period.
Note
If question asks you to generate random numbers using Linear Congruential
Method and provides you with multiplier, increment, modulus and seed values
then always use the original formula.
i.e. X(i+1) = (a X(i) + c) mod m, for i = 0, 1, 2, 3, 4, ………..
Numerical
Let multiplier = 13, increment = 1 and modulus value = 19. Use
congruential method to generate random numbers taking seed value = 1.
soln: Given a = 13, c = 1, m = 19 and X(0) = 1
We have, X(i+1) = (aX(i) + c) mod m
For i = 0, X(1) = (aX(0) + c) mod m
= (13 * 1 + 1) mod 19
= 14 mod 19 = 14
For i = 1, X(2) = (aX(1) + c) mod 19
= (13*14+1) mod 19
= 12
And so on.
Condition to stop Iteration
1. If question provides condition, do accordingly.
2. If condition not provided:
a. Stop if same number repeats
b. Else go and find all random numbers
Numerical
Use Linear Congruential Method to generate a sequence of three two digit random
integers.
Given seed value = 32, multiplier = 8, increment = 47, modulus value = 100.
Numerical
Use Linear Congruential Method to generate a sequence of three two digit random
integers.
Given seed value = 32, multiplier = 8, increment = 47, modulus value = 100.
Soln Given X(0) = 32, a = 8, c = 47, m = 100
X(1) = (8*32+47) mod 100 = 3 (Not OK)
X(2) = (8*3+47) mod 100 = 71 (OK)
X(3) = (8*71+47) mod 100 = 15 (OK)
X(4) = (8*15+47) mod 100 = 67 (OK)
Numerical
Use Multiplicative Congruential Method to generate a sequence of four three digit
random integers.
Given seed value = 117, multiplier = 8, increment = 47, modulus value = 1000.
Test For Random Numbers
1. Frequency test: Uses the Kolmogorov-Smirnov(KS) or the chi-square test to
compare the distribution of the set of numbers generated to a uniform
distribution.
2. Runs test: Tests the runs up and down or the runs above and below the mean by
comparing the actual values to expected values. The statistic for comparison is
the chi-square.
3. Autocorrelation test: Tests the correlation between numbers and compares the
sample correlation to the expected correlation of zero.
4. Gap test. Counts the number of digits that appear between repetitions of a
particular digit and then uses the Kolmogorov-Smirnov(KS) test to compare
with the expected number of gaps.
5. Poker test. Treats numbers grouped together as a poker hand. Then the hands
obtained are compared to what is expected using the chi-square test.
Kolmogorov-Smirnov(KS) Test
It is a test for random number developed by A.N. Kolmogorov and
N.V. Smirnov.
It is used to test the uniformity of random numbers i.e. whether
random numbers are uniformly generated or not.
This test is designed for continuous distributions where the Observed
Cumulative Distribution Function(CDF) is compared with empirical
CDF.
KS Test Algorithm
KS Test Algorithm
Numerical –KS Test
Perform uniformity test using KS test with a level of significance α = 0.05 on the
following five generated numbers.
0.44, 0.81, 0.14, 0.05, 0.93
Numerical
K-S test is to be performed to test the uniformity of following random
numbers with a level of significance of α = 0.05.
0.24, 0.89, 0.11, 0.61, 0.23, 0.86, 0.41, 0.64, 0.50, 0.65
i R(i) i/n (i-1)/n (i/n)-R(i) R(i)-((i-1)/n)
1 0.11 0.1 0 -0.01 0.11
2 0.23 0.2 0.1 -0.03 0.13
3 0.24 0.3 0.2 0.06 0.04
4 0.41 0.4 0.3 -0.01 0.11
5 0.50 0.5 0.4 0 0.10
6 0.61 0.6 0.5 -0.01 0.11
7 0.64 0.7 0.6 0.06 0.04
8 0.65 0.8 0.7 0.15 -0.05
9 0.86 0.9 0.8 0.04 0.06
10 0.89 1 0.9 0.11 -0.01
Chi-Square Test
It is a type of frequency test
It is a test used to check the randomness of a distribution
This statistical test is used to determine how often certain observed data fit the
theoretically expected data.
This method compares the observed frequency with the theoretical. So it
determines how often certain observed data fit the theoretically expected data.
Chi-Square Test
•
Chi-Square Test
Note:
1. For chi square test, degree of freedom = n-1
• where n represents number of classes
2. Chi Square test is usually recommended when Ei ≥ 5
i.e number of expected occurrence/frequency in each class ≥ 5
Chi-Square Test - Procedure
•
Chi-Square Test (Example)
The two Digit random numbers generated by a multiplicative congruential
method are given below. Determine Chi-Square. Is it acceptable at 95%
confidence level?
36, 91, 51, 02, 54, 06, 58, 06,58,02, 54, 01, 48, 97, 43, 22, 83, 25, 79, 95, 42, 87,
73, 17, 02, 42, 95, 38, 79, 29, 65, 09, 55, 97, 39, 83, 31, 77,17, 62, 03, 49, 90, 37,
13, 17, 58, 11, 51, 92, 33, 78, 21, 66, 09, 54, 49, 90, 35, 84, 26, 74, 22, 62, 12,
90,36, 83, 32, 75, 31, 94, 34, 87, 40, 07, 58, 05, 56,22, 58,77, 71, 10,
73,23,57,13,36,89,22,68,02,44,99,27,81,26,85, 22
soln : Let H0 represents null hypothesis where H0: the numbers are acceptable
for given confidence level
Here, Total number of samples (N) = 100
Let us divide these data into 10 classes i.e. n =10
Ei=N/n=100/10=10
`
Classes Observed (Oi - Ei) (Oi - Ei)2
Frequency(Oi)
0 < r ≤ 10 13 3 9 0.9
10 < r ≤ 20 7 -3 9 0.9
20 < r ≤ 30 12 2 4 0.4
30 < r ≤ 40 13 3 9 0.9
40 < r ≤ 50 7 -3 9 0.9
50 < r ≤ 60 13 3 9 0.9
60 < r ≤ 70 5 -5 25 2.5
70 < r ≤ 80 10 0 0 0
80 < r ≤ 90 12 2 4 0.4
90 < r ≤ 100 8 -2 4 0.4
•
•
K-S test vs Chi-Square Test
K-S test Chi-Square Test
Done for smaller samples. Done for larger samples.
Difference between observed and Difference between observed and
expected CDFs(Cumulative Distribution expected PDFs(Probability Density
Function) Function)
Uses each observed sample without Group observations
grouping
Numerical – 2074 Bhadra
Classes Observed (Oi - Ei) (Oi - Ei)2
Frequency(Oi)
0<r≤6 5 1 1 0.25
6 < r ≤12 6 2 4 1
12 < r ≤ 18 4 0 0 0
18 < r ≤ 24 3 -1 1 0.25
24 < r ≤ 30 3 -1 1 0.25
30 < r ≤ 36 4 0 0 0
36 < r ≤ 42 4 0 0 0
42 < r ≤ 48 4 0 0 0
48 < r ≤ 54 4 0 0 0
54 < r ≤ 60 3 -1 1 0.25
∑=2
Note: Ei=N/n
•
Gap Test
•
Algorithm for Gap Test
•
Algorithm for Gap Test
•
Step 4
Determine the critical value Dα, from Table( K-S critical value) for the specified
value of α and the sample size N.
Step 5
If the calculated value of D is greater than the tabulated value of Dα , the null
hypothesis of independence is rejected.
Numerical- Gap Test
Based on the frequency with which gaps occur, analyze following 110 digits
to test whether they are independent. Use α = 0.05
4 1 3 5 1 7 2 8 2 0 7 9 1 3 5 2 7 9 4 1 6 3 3 9 6
3 4 8 2 3 1 9 4 4 6 8 4 1 3 8 9 5 5 7 3 9 5 9 8 5
3 2 2 3 7 4 7 0 3 6 3 5 9 9 5 5 5 0 4 6 8 0 4 7 0
3 3 0 9 5 7 9 5 1 6 6 3 8 8 8 9 2 9 1 8 5 4 4 5 0
2 3 9 7 1 2 0 3 6 3
soln : Let H0 represents null hypothesis.
H0 : The numbers are independent
Here digits are from 0 to 9. So total number of distinct digits = 10
So number of gaps(N) = Number of data values – Number of distinct digits
= 110 -10 = 100
Numerical- Gap Test
Gap Length Frequency Relative Frequency Cumulative Relative F(x) = 1 – 0.9x+1 | F(x) – SN(x) |
frequency
0–3 35 0.35 0.35 0.3439 0.0061
4–7 22 0.22 0.57 0.5695 0.0005
8 – 11 17 0.17 0.74 0.7176 0.0224
12 – 15 9 0.09 0.83 0.8147 0.0153
16 – 19 5 0.05 0.88 0.8784 0.0016
20 – 23 6 0.06 0.94 0.9202 0.0198
24 – 27 3 0.03 0.97 0.9497 0.0223
28 – 31 0 0 0.97 0.9657 0.0043
32 – 35 0 0 0.97 0.9775 0.0075
36 – 39 2 0.02 0.99 0.9852 0.0043
40 – 43 0 0 0.99 0.9903 0.0003
44 – 47 1 0.01 1 0.9936 0.0064
Numerical- Gap Test
•
Gap Test Example For Exam
Explain the algorithm for gap test with an example.
Let us assume 110 random numbers between 0 to 9 with varying gap length. Let the
maximum gap length be 34.
Let H0 represents null hypothesis.
H0 : The numbers are independent
Here digits are from 0 to 9. So total number of distinct digits = 10
So number of gaps(N) = Number of data values – Number of distinct digits
= 110 -10 = 100
Numerical- Gap Test
Gap Length Frequency Relative Frequency Cumulative Relative F(x) = 1 – 0.9x+1 | F(x) – S (x) |
frequency N
0–5 45 0.45 0.45 0.4685 0.0185
6 – 11 15 0.15 0.6 0.7175 0.1175
12 – 17 12 0.12 0.72 0.8499 0.1299
18 – 23 8 0.08 0.8 0.920 0.12
24 – 29 13 0.13 0.93 0.9576 0.0276
30 – 35 7 0.07 1 0.9774 0.0226
Numerical- Gap Test
•
Poker Test
This test gets its name from a game of cards called poker.
Poker test for independence is based on the frequency with which certain digits are
repeated.
Poker test not only tests for randomness of the sequence of numbers, but also the
digits comprising of each number.
Poker test treats numbers grouped together as a poker hand. Then the hands
obtained are compared to what is expected using the chi-square test.
Poker test for 3 digit random number
Possibilities for 3 digit number:
a. Three different digits
b. Three like digits
c. Exactly one pair
Calculating Probabilities of each possibility
•
Numerical
A sequence of 1000 three-digit numbers has been generated and an
analysis indicates that 680 have three different digits, 289 contain
exactly one pair of like digits, and 31 contain three like digits. Based on
the poker test, are these numbers independent? Take α = 0.05.
soln: Let H0 be null hypothesis.
H0 : The numbers are independent
Total number of three-digit numbers(N) = 1000
Numerical
•
Combination Expected Frequency Observed
(i) (Ei) = Probability(i)*N Frequency (Oi)
Three Different Digits 0.72*1000 = 720 680 2.22
Three like digits 0.01*1000 = 10 31 44.10
Exactly one pair 0.27*1000 = 270 289 1.33
1000 1000
•
Numerical
A sequence of 1000 three-digit numbers has been generated and an
analysis indicates that 695 have three different digits, 293 contain
exactly one pair of like digits, and 12 contain three like digits. Based on
the poker test, are these numbers independent? Take α = 0.05.
Poker test for 4 digit random number
Possibilities for 4 digit number:
a. Four different digits
b. Exactly one pair
c. Two pairs
d. Three of a kind
e. All four like digits
Calculating Probabilities of each possibility
•
Calculating Probabilities of each possibility
•
Numerical
A sequence of 1000 four-digit numbers has been generated and an
analysis indicates:
Combinations Observed Frequency
Four Different Digits 540
One pair 320
Two pairs 70
Three like digits 50
Four like digits 20
1000
Based on poker test, test these numbers are independent for α = 0.05
•
Combination Expected Frequency Observed
(i) (Ei) = Probability(i)*N Frequency (Oi)
Four different Digits 0.504*1000 = 504 540 2.5714
Exactly one pair 0.432*1000 = 432 320 29.037
Two Pairs 0.027*1000 = 27 70 68.4814
Three like digits 0.036*1000= 36 50 5.444
Four like digits 0.001*1000 = 1 20 361
1000 1000
•
Numerical
A set of 10,000 4-digit random values have been generated. An
observation shows than 5065 values have all different digits, 2000 have 2
of a kind digits, 760 have 3 of a kind, 1500 have 2 pairs and 675 have all
same digits. Test these values for randomness using Poker test (Use α
:0.05).
Numerical
Write an algorithm for gap test. Formulate 4-digit poker test with
suitable data with example.
2071 Bhadra
Poker test for 5 digit random number
Possibilities for 5 digit number:
a. All different digits
b. Exactly one pair
c. Two pairs
d. Three of a kind
e. Full House/Three of a kind + Two of a kind
f. Four of a kind
g. Five of a kind
Calculating Probabilities of each possibility
•
Calculating Probabilities of each possibility
•
Numerical
•
•
Combination Expected Frequency Observed
(i) (Ei) = Probability(i)*N Frequency (Oi)
All different Digits 3024 3044 0.1322
one pair 5040 5020 0.0793
Two Pairs 1080 1090 0.0925
Three of a kind 720 700 0.5556
Full House 90 95 0.2778
Four of a kind 45 40 0.5556
Five of a kind 1 11 100
10000 10000
•
Numerical
A sequence of 10,000 random numbers has been generated and an analysis shows
following combinations and frequencies. For α = 0.05 check whether generated
numbers are independent or not.
Combination Observed Frequency
All different Digits 3054
one pair 5020
Two Pairs 1073
Three of a kind 710
Full House 95
Four of a kind 44
Five of a kind 4
Runs Test
•
Runs Test
•
Numerical
Consider the following series representing 44 computer chips which
may be either Defective(D) or Acceptable(A). Based on the runs up and
down, determine the hypothesis of independence for α = 0.05.
D AAAAAAA D D D D AAAAAAAA D D AAAAAAAA
D D D D AAAAAAAAAA
soln: Here observed number of runs xr = 8
Let n1 represents number of Defective(D) chips and n2 represents
Acceptable(A) chips
•
Here - Zα/2 = -1.96
Since Z0 < - Zα/2 (i.e. - Zα/2 ≤ Z0 ≤ Zα/2 not valid ) the hypothesis for
independence is rejected.
Auto-Correlation Test
Autocorrelation is a statistical test that determines whether a random number
generator is producing independent random numbers in a sequence.
The tests for auto-correlation are concerned with the dependence between
numbers in a sequence.
The test computes the autocorrelation between every m numbers (m is also known
as the lag) starting with the ith number (i is also known as the index).
Important variables to remember:
1. m - is the lag, the space between the numbers being tested
2. i - is the index, or the number in the sequence that you start with
3. N - the number of numbers generated in a sequence
4. M – is the largest integer such that i + (M + 1)m ≤ N
Auto-Correlation Test Algorithm
1. Define the hypothesis.
2. Find the value of ‘i’ and lag value ‘m’
3. Using the value of ‘i’, ‘m’ and ‘N’ calculate the value of M as i + (M + 1)m ≤ N
where
a. m - is the lag, the space between the numbers being tested
b. i - is the index, or the number in the sequence that we start with
c. N - the number of numbers generated in a sequence
d. M – is the largest integer such that i + (M + 1)m ≤ N
•
Numerical
Consider a sequence of 30 numbers generated by a random number generator. Test whether
the 3rd, 8th and 13th numbers in the sequence are auto-correlated with α = 0.05 and Z0.025 =
1.96.
0.12, 0.01, 0.23, 0.28, 0.89, 0.31, 0.64, 0.28, 0.83, 0.93, 0.99, 0.15, 0.33, 0.35, 0.91
0.41, 0.60, 0.27, 0.75, 0.88, 0.68, 0.49, 0.05, 0.43, 0.95, 0.58, 0.19, 0.36, 0.69, 0.87
Soln: Let H0 represent null hypothesis where H0 : Numbers in sequence are auto-correlated.
Here m = 5
We have, i + (M + 1)m ≤ N
or, 3 + (M + 1)*5 ≤ 30
or, M ≤ 4.4 ~ 4
•
Methods of generating non-uniform Variables: Generating discrete
distributions
A discrete distribution describes the probability of occurrence of each value of a
discrete random variable.
A discrete random variable is a random variable that has countable values such as
list of non-negative integers.
When the discrete distribution is uniform, the requirement is to pick one of N
alternatives with equal probability given to each.
Given a random number U(0≤U<1), the process of multiplying by N and taking
the integral portion of the product, which is denoted mathematically by the
expression [UN], gives N different outputs. The output are the numbers
0,1,2,….,(N-1).
The result can be changed to the range of values C to N+C-1 by adding C.
Methods of generating non-uniform Variables: Generating discrete
distributions
A discrete distribution describes the probability of occurrence of each value of a
discrete random variable.
A discrete random variable is a random variable that has countable values such as
list of non-negative integers.
When the discrete distribution is uniform, the requirement is to pick one of N
alternatives with equal probability given to each.
Given a random number U(0≤U<1), the process of multiplying by N and taking
the integral portion of the product, which is denoted mathematically by the
expression [UN], gives N different outputs. The output are the numbers
0,1,2,….,(N-1).
Methods of generating non-uniform Variables: Generating discrete
distributions
The result can be changed to the range of values C to N+C-1 by adding C.
Generally, the requirement is for a discrete distribution that is not uniform, so that
a different probability is associated with each output.
Number of Items Xi Number of Customers Ni Probability Distribution Cumulative Probability
P(Xi) Distribution
1 25 0.10 0.10
2 128 0.51 0.61
3 47 0.19 0.8
4 38 0.15 0.95
5 12 0.05 1
Generating discrete distributions
Suppose, for example , it is necessary to generate a random variable representing
the number of items bought by a customer at store , where the probability function
is the discrete distribution given in previous table.
A table is formed to list the number of items X , and the cumulative probability Y,
as shown below:
Number of Items X Probability P(X) Cumulative Probability(Y)
1 0.10 0.10
2 0.51 0.61
3 0.19 0.8
4 0.15 0.95
5 0.05
Number of Items Bought by Customers 1
Generating discrete distributions
Taking the output of a uniform random number generator, U, the value is
compared with the values of Y.
If the value falls in an interval Yi<U≤Yi+1(i=0,1,…….,4), the corresponding value
of Xi+1 is taken as desired output.
It is not necessary that the intervals be in any particular order.
A computer routine will usually search the table from the first entry .
The amount of searching can be minimized by selecting the intervals in decreasing
order of probability
Generating discrete distributions
For computer routine above data can be arranged as:
Probability Cumulative Probability Number of Items
0.51 0.51 2
0.19 0.70 3
0.15 0.85 4
0.10 0.95 1
0.05 1 5
With this arrangement , 51% of the searches will only need to go to the first entry,
70% to the first or second and so on.
With the original ordering, only 10% are satisfied with the first entry and only 61%
with the first two
Inversion, Rejection and Composition - Inversion
In the simplest case of inversion, we have a continuous random variable X with a
strictly increasing distribution function F.
Then F has an inverse F-1 defined on the open interval (0,1): for 0<u<1, F-1 (u) is the
unique real number x such that F(x)=u i.e.
F(F-1 (u))=u, and F-1 (F(x))=x
P(F-1(u)≤x) = P(u≤F(x)) =F(x)
Let u~unif(0,1) denote a uniform random variable on (0,1) Then F-1 (u) has distribution
function F.
Inversion, Rejection and Composition - Inversion
To extend this result to a general distribution function F, the generalized inverse of
F is:
F- (u) = inf{x: F(x) ≥ u}
0<u<1
Where inf represents the Infimum value(greatest lower bound value)
And F-(u) represents u- quartile
Inversion, Rejection and Composition - Rejection
The rejection method is applied when the probability density function f(x), has a
lower and upper limit to its range, lower bound a and b and an upper bound c
respectively.
The method can be specified as follows:
• Compute the values of two independent uniformly distributed variates(a
quantity having a numerical value for each member of group) U1 and U2.
• Compute X0=a+U1(b-a).
• Compute Y0=cU2
• Either accept X0 as the desired output otherwise repeat the process with two
new uniform variates.
Inversion, Rejection and Composition - Rejection
This method is closely related to the process of evaluating an integral using
Monte-Carlo technique. The probability density function is enclosed in a rectangle
with side lengths b-a and c.
In the rejection method the curve is probability density function so that the area
under curve must be 1 i.e. c(b-a)=1.
Inversion, Rejection and Composition - Rejection
•
Inversion, Rejection and Composition - Composition
Sometimes the random variables X of interest involves the sum of n>1 independent
random variables:
X=Y1+Y2+Y3+…+Yn
To generate a value for X, we can generate a value for each of the random variables
Y1, Y2, Y3, Yn and add them together. This is called composition.
Composition can also be used to generate random numbers that are approximately
normally distributed.
The normal distribution is one of the most important and frequently used continuo
The notion N(μ , σ ) refers to the normal distribution with mean μ and variance σ ².
Inversion, Rejection and Composition - Composition
•
Convolution Method
The probability distribution of a sum of two or more independent random
variables is called a convolution of the distributions of the original variables.
The convolution method thus refers to adding together two or more random
variables to obtain a new random variable with the desired distribution.
Technique can be used for all random variables X that can be expressed as the sum
of n random variables
X = Y1 + Y2 + Y3 + . . . + Yn
In this case, one can generate a random variate X by generating n random
variates, one from each of the Yi, and summing them.
Numerical
Use Chi-Square test to test the uniformity of following random numbers for 95%
confidence level And given critical value for degree of freedom = 8 is 15.51.
25 33 5 54 9 31 14 40 17 52 33
49 61 62 26 67 6 28 55 22 68 34
50 2 66 77 86 12 41 88 19 96 70
81 47 85 3 59 94 8 42 71 37 79
82 51 91 11 75 43 39 44 64 58 46