Вы находитесь на странице: 1из 24

NOTE TO USERS

W
IE
EV
PR

This reproduction is the best copy available.

UMI

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
W
IE
EV
PR

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Random Number Generators: MC Integration
and TSP-Solving By Simulated Annealing,
Genetic, and Ant System Approaches

by

Tathagata Samanta

W
Bachelor of Science
Applied Mathematics
Jadavpur University, India
IE
1997

Masters of Science
EV

Applied Mathematics
Jadavpur University, India
2000
PR

A Thesis
submitted to the
Florida Institute of Technology
in partial fulfillment of the requirements
for the degree of

Doctorate of Philosophy
in
Applied Mathematics

Melbourne, Florida
May 2006

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
UMI Number: 3206620

INFORMATION TO USERS

The quality of this reproduction is dependent upon the quality of the copy

W
submitted. Broken or indistinct print, colored or poor quality illustrations and
photographs, print bleed-through, substandard margins, and improper
IE
alignment can adversely affect reproduction.
In the unlikely event that the author did not send a complete manuscript
and there are missing pages, these will be noted. Also, if unauthorized
EV

copyright material had to be removed, a note will indicate the deletion.


PR

UMI
UMI Microform 3206620
Copyright 2006 by ProQuest Information and Learning Company.
All rights reserved. This microform edition is protected against
unauthorized copying under Title 17, United States Code.

ProQuest Information and Learning Company


300 North Zeeb Road
P.O. Box 1346
Ann Arbor, Ml 48106-1346

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
© Copyright 2006 Tathagata Samanta
All Rights Reserved

W
IE
EV
PR

The author grants permission to make single copies I

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
We the undersigned committee hereby recommends
that the attached document be accepted as fulfilling in part
the requirements for the degree of
Doctorate of Philosophy in Applied Mathematics

‘Random Number Generators: MC Integration And TSP-Solving’'


a thesis by Tathagata Samanta

K. ■ ^
Syamal K. Sen, Ph D, /
Major Advisor
Professor, Department of Mathematical Sciences
Dissertation Advisor

W
IE

Michael D. Shaw, Ph.D.
Associate Professor and Associate Head,
EV

Department of Mathematical Sciences


PR

■<ZSU
Ravi P. AgarwalfPh.Dr
Professor, Department of Mathematical Sciences

Debasis Mitra, Ph.D.


Associate Professor, Department of Computer Sciences

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
ABSTRACT

Random Number Generators: MC Integration and TSP-solving

by Simulated Annealing, Genetic and Ant System Approaches

Author: Tathagata Samanta

Major Advisor: Professor S.K. Sen, Ph.D.

W
Pseudo-random number generators (PRNGs) based on linear congruential, combined
IE
linear congruential, generalized feedback shift register, and subtract with borrow
EV

procedures and Quasi-random number generators (QRNGs) such as Halton, Sobol,

Faure, and Niederreiter are used for simulating Monte Carlo integration (MCI) and

Traveling Salesman Problem (TSP). MCI can be used for evaluation of integrals and
PR

integral equations, boundary value problems for partial differential equations in heat

conduction and radiation, and ordinary stochastic differential equations occurring in

option pricing. TSP occurs in VLSI design, network routing problems including

airlines, vehicle and telecommunication systems, and job scheduling problems.

Integration based on MC methods and polynomial time algorithms for TSP are

randomized and so rely heavily on the random number (RN) generation. It is believed

that the solutions of the algorithms are sensitive with the quality of RNs which lead to

iii

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
the urge of developing different methods to produce RNs. This research tries to find

whether the choice of RNGs affects the final solution of the algorithm, the reason

behind that and rank the RNGs based on the solutions of the problem.

The performances of the RNGs have been compared with some available

statistical tests, viz., Chi-square test, Kolmogorov-Smimoff test, Spectral test, cycle

length and generation time. The performances of the RNGs are then compared based

on the solution of one, two, and three dimensional MCIs. The RNGs are also

implemented on three heuristic methods for TSP-solving, viz., 2-Opt and 3-Opt based

Simulated Annealing (SA), Genetic Algorithm (GA), and Ant System (AS) technique.

W
Their performances are compared statistically.
IE
This study finds that the QRNGs (more uniform but less random) performs

much better in terms of the accuracy of result than PRNGs (less uniform but more
EV

random) in MCIs. PRNGs are found to perform better than QRNGs in SA, while

choosing of PRNGs and QRNGs did not effect in the GA. In AS approach the QRNGs
PR

were found to be a little better than the PRNGs. It is often felt that the performances of

these generators are controversial mainly because of the experience that from one

problem to another problem of the same type the same generator behaves sometimes

better and sometimes worse than another generator. In addition, there was an attempt

to suggest pre-generation of RNs to reduce time complexity of the algorithms.

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
TABLE OF CONTENTS

ABSTRACT.................................................................................................................iii

LIST OF FIGURES....................................................................................................viii

LIST OF TABLES........................................................................................................ x

ACKNOWLEDGEMENTS........................................................................................xii

Chapter

1 Introduction................................................................................................1

1.1 Statement of the Problem......................................................................2

W
1.2 Available Test Methods......................................................................... 3

1.3 Why MC Integration and TSP?.............................................................4


IE
1.4 Organization of the thesis...................................................................... 5

1.6 Computaional Resources....................................................................... 5


EV

2 Random Number Generators................................................................... 6

2.1 Pseudo-random Number Generators..................................................... 8


PR

2.1.1 Linear Congruential Method....................................................... 8

2.1.2 Combined Linear Congruential Method.................................... 11

2.1.3 Lagged Fibonacci Method......................................................... 14

2.1.4 Generalized Feedback Shift Register Method........................... 15

2.1.5 Multiple with Carry Method...................................................... 16

2.1.6 Other PRN Generation Methods............................................... 17

2.2 Quasi-random Number Generators...................................................... 18

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
2.2.1 Halton Method 18

2.2.2 Sobol Method............................................................................. 20

2.2.3 Faure Method.............................................................................. 24

2.2.4 Niederreiter Method................................................................... 27

2.2.5 Other QRN Generation Methods................................................29

3 Statistical Test for RNGs........................................................................ 30

3.1 Empirical Test..................................................................................... 31

3.1.1 Frequency Test........................................................................... 31

3.1.2 Discrepancy................................................................................ 32

W
3.1.3 Spectral Test............................................................................... 34
IE
3.2 Numerical Results and Graphical Representation............................... 37

4 RNGs in Monte Carlo Integration.........................................................46


EV

4.1 Riemann Integral.................................................................................46

4.2 Probability based Monte Carlo Integration.........................................47


PR

4.3 Change of Interval of Integration........................................................ 50

4.4 Summation based MC Integration: Single, Double, and Triple..........52

4.5 Numerical Results and Graphical Representation............................... 56

4.6 Remark................................................................................................ 71

5 RNGs in Traveling Salesman Problem.................................................. 72

5.1 IP Formulation for TSP....................................................................... 73

5.2 Held-Karp Lower Bound..................................................................... 75

5.3 Heuristic Algorithms for TSP.............................................................. 76


vi

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
5.3.1 Simulated Annealing.................................................................. 76

5.3.2 Genetic Algorithm...................................................................... 84

5.3.3 Ant System................................................................................. 92

5.4 Numerical Results and Graphical Representation.............................96

6 Conclusions............................................................................................. 114

Bibliography............................................................................................................. 120

W
IE
EV
PR

vii

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
LIST OF FIGURES

Figure 3.1 : Time taken by RNGs to generate 4096 RNs..........................................41

Figure 3.2 : Uniformity of QRN Faure.....................................................................42

Figure 3.3 : Uniformity of PRN Apple.....................................................................42

Figure 3.4 : Uniformity of QRN Sobol....................................................................43

Figure 3.5 : Uniformity of PRN Rand......................................................................43

Figure 3.6 : Randomness of QRN Falton.................................................................44

Figure 3.7 : Randomness of PRN Apple..................................................................44

W
Figure 3.8 : Randomness of QRN Sobol..................................................................45

Figure 3.9 : Randomness of PRN Rand...................................................................45


IE
Figure 4.1 : Riemann Sum........................................................................................47

Figure 4.2 : MC Integration for f(x) > 0 ..................................................................48


EV

Figure 4.3 : Generalized MC Integration.................................................................49

Figure 4.4 : Time Complexities of RNs inOne-D MCI............................................59


PR

Figure 4.5 : One-D MCI: RNs generated versus Computed Accuracy..................... 70

Figure 4.6 : 7Vo-D MCI: RNs generated versus Computed Accuracy..................... 70

Figure 4.7 : Three-D MCI: RNs generatedversus Computed Accuracy..................71

Figure 5.1 : A 2-Opt Move.......................................................................................77

Figure 5.2 : Two possible 3-Opt Moves...................................................................78

Figure 5.3 : Tour Lengths in SA and AS algorithms for 51 nodes.......................... 100

Figure 5.4 : Tour Lengths in SA and AS algorithms for 52 nodes.......................... 102

viii

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Figure 5.5 : Tour Lengths in SA and AS algorithms for 70 nodes......................... 104

Figure 5.6 : Tour Lengths in SA and AS algorithms for 99 nodes......................... 106

Figure 5.7 : Tour Lengths in SA and AS algorithms for 150 nodes....................... 108

Figure 5.8 : Number of RNs generated in SA, GA and AS algorithms.................. I l l

Figure 5.9 : Time complexity in SA, GA and AS algorithms in log scale.............112

Figure 5.10 : Computational time of Pre- Generation versus Generation of RNs during

compilation for 10 nodes with SA....................................................... 113

Figure 5.11: Computational time of Pre- Generation versus Generation of RNs during

compilation for 22 nodes with SA....................................................... 113

W
IE
EV
PR

ix

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
LIST OF TABLES

Table 3.1 : Period / Cycle Lengths for various RNGs.............................................. 38

Table 3.2 : Statistical Tests with RNGs.................................................................... 39

Table 3.3 : Discrepancy measure for various RNs generated by each RNGs 40

Table 4.1 : Probability based MCI error with QRNG Halton................................... 56

Table 4.2 : Summation based MCI error with QRNG Halton................................... 56

Table 4.3 : Probability based MCI error with PRNG Rand....................................... 57

Table 4.4 : Summation based MCI error with PRNG Rand......................................57

W
Table 4.5 : No. of RNs needed for summation and probability based MCIs: 1-D, 2-D,

3-D, ands-D ............................................................................................ 58


IE
Table 4.6 : PRNs : Expected accuracy, Computed accuracy, and Time complexity in

7 j ..................................................................................................................61
EV

Table 4.7 : PRNs : Expected accuracy, Computed accuracy, and Time complexity in

/, 62
PR

Table 4.8 : QRNs : Expected accuracy, Computed accuracy, and Time complexity in

/ , ............................................................................................................. 63

Table 4.9 : PRNs : Expected accuracy, Computed accuracy, and Time complexity in

I 2 ...................................................................................................................64

Table 4.10 : PRNs : Expected accuracy, Computed accuracy, and Time complexity in

I 2............................................................................................................. 65

Table 4.11 : QRNs : Expected accuracy, Computed accuracy, and Time complexity in

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
Table 4.12 : PRNs : Expected accuracy, Computed accuracy, and Time complexity in

h ............................................................................................................. 67

Table 4.13 : PRNs : Expected accuracy, Computed accuracy, and Time complexity in

I3............................................................................................................. 68

Table 4.14 : QRNs : Expected accuracy, Computed accuracy, and Time complexity in

h ............................................................................................................. 69

Table 5.1 : Mean Tour Lenghts, Standard Deviation and Confidence Interval (95\%)

W
for TSP using SA and GA with 22 nodes................................................98

Table 5.2 : Mean Tour Lenghts, Standard Deviation and Confidence Interval (95\%)
IE
for TSP using SA and GA with 51 nodes................................................99
EV
Table 5.3 : Mean Tour Lenghts, Standard Deviation and Confidence Interval (95\%)

for TSP using SA and GA with 52 nodes.............................................. 101

Table 5.4 : Mean Tour Lenghts, Standard Deviation and Confidence Interval (95\%)
PR

for TSP using SA and GA with 70 nodes.............................................. 103

Table 5.5 : Mean Tour Lenghts, Standard Deviation and Confidence Interval (95\%)

for TSP using SA and GA with 99 nodes.............................................. 105

Table 5.6 : Mean Tour Lenghts, Standard Deviation and Confidence Interval (95\%)

for TSP using SA and GA with 150 nodes............................................ 107

Table 5.7 : Mean Tour Lenghts, Standard Deviation and Confidence Interval (95\%)

for TSP using SA and GA with 380 and 1000 nodes............................ 110

xi

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
ACKNOWLEDGEMENTS

I would like to express the deepest gratitude to my advisor Professor S.K. Sen,

for continually injecting in me the spirit of research. Without his guidance and

assistance this research work would not have been possible. I owe him much for

sharing his insights and the freedom to pursue my own interest. I would also like to

thank my other committee members, Dr. M.D. Shaw, Professor R.P. Agarwal, and Dr.

D. Mitra for their valuable comments and time towards my thesis. I thank Professor V.

W
Lakshmikantham, Head, Department of Mathematical Sciences, Florida Institute of

Technology for providing the financial support.


IE
I would also like to thank my friends specially Hariharan, Sameer, and Madan
EV

for their vital tips in latex and Andrea Reese for proof reading my thesis. I would also

thank all the Math Graduate Students, Abhijit, Raka, Gopal, Soumyadipto, Priyobrata,
PR

Rohit, Sunil, and Ashim. Also, I am obliged to Penny Flynn and Sally Sellings for

their help and support throughout.

A special thanks to my wife Kamalika for her motivation and continuous

inspiration. I am grateful to my parents, my brother, my sister-in-law, my mother-in-

law and my brother-in-law. I would also like to thank my grandfather (maternal uncle)

Nilachal Samanta. Their love, support and encouragement has been invaluable to me.

xii

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
C hapter 1

Introduction

W
In this dissertation, different Random Number Generators (RNGs) axe statis­
tically compared and ranked based on the empirical results obtained solving
IE
Monte Carlo Integration (MCI) and Traveling Salesman Problem (TSP). Monte
Carlo (MC) simulations, randomized algorithms, statistical tests, and crypto­
graphical applications all rely heavily on the RNGs. Most programming lan­
EV

guages includes built-in RNG functions that prove inadequate for applications
where huge amount of random values need to be generated. Ideally, a random
number (RN) generator must not produce repetitive or cyclical values and so
PR

currently computer applications axe increasingly turning towards using physi­


cal/hardware data (external/internal) for getting number which axe as random
as possible.

This work attempts ranking RNGs based on the accuracy and time com­
plexity of computation of test MCIs and test TSPs. This is as opposed to a
direct ranking independent of any application of an RNG by the available statis­
tical tests. A direct ranking of RNGs is only involved, in this context, obtaining
a measure of discrepancy (uniformity) and randomness for each generator. This
indirect ranking is more desirable since the primary interest of this work is the

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
solution of a real world problem and not as such in the internal properties of
RNGs.

1.1 S ta tem en t o f th e P rob lem

Simulation is an experiment which models and executes a real world problem. It


is important in situations where errors would be too dangerous or too expensive,
like in neural surgery or rocket science. And in almost all types of simulation
there is the need to generate RNs. Since MCI and TSP are nondeterministic
algorithms they rely heavily on the random number (RN) generation. It is
believed that the solutions of the algorithms are sensitive with the quality of RNs

W
which lead to the urge of developing different methods to produce RNs. Various
researchers have invented techniques to test the uniformity and randomness of
IE
the RNGs, but are yet to produce a full-proof test or test suite by which all
RNGs can respectively be tested and ranked. This research tries to find whether
EV
the choice of RNGs affects the final solution of the algorithm. It provides an
alternative way to rank the available RNGs. Methods like this can be of great
benefit to choose the ideal RNG for specific simulations. It is often felt that
the performances of these generators axe controversial mainly because of the
PR

experience that from one problem to another problem of the same type the
same generator behaves sometimes better and sometimes worse than another
generator. In addition, there was an attempt to suggest pre-generation of RNs
to reduce time complexity of the algorithms.

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
1.2 A vailab le T est M eth o d s

Generation of RNs were done by tossing a coin, rolling dice or using a roullete
wheel. Over the last 70 years several methods to produce RNs were introduced.
The first method was suggested by John von Neumann, known as the Middle-
square method in 1946 and most recently, the Mersenne Twister was invented
by M. Matsomuto and T. Nishimura in 1997. Statistical testing is employed to
check the randomness and uniformity of a sequence of numbers, preferably a
large sequence generated by an RNG. Some standard test suites available are
as follows.

Empirical tests Described in Knuth [1], includes frequency, serial, gap,

W
poker, coupon collector’s, permutation, run, maximum-of-t, collision, birthday
spacings, and serial correlation tests. Apart from the foregoing empirical tests
IE
there is the spectral test (empirical and theoretical), which is the most powerful
test for the quality of RNGs.
EV

Diehard Test Suite Developed by George Marsaglia [2] consist of the follow­
ing set of tests, viz., birthday spacings, overlapping permutations, ranks of 31 x
31 and 32 x 32 matrices, ranks of 6 x 8 matrices, OQSO, DNA, count the l ’s in
a stream of bytes, count the l ’s in specific bytes, parking lot, minimum distance,
PR

random spheres, squeeze, overlapping sums, runs, and craps tests, monkey tests
on 20 -bit words, and monkey tests OPSO.

Crypt-X Suite of tests Developed by researchers at the Information Security


Research Centre at Queensland University of Technology in Australia [3] include
frequency, binary derivative, change point, runs, sequence complexity and linear
complexity tests.

NIST Test Suite Developed by the Computer Security Division and the
Statistical Engineering Division at NIST [4] include the frequency, block fre-

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
quency, cumulative sums, runs, long runs, Marsaglia’s rank, spectral (based on
the Discrete Fourier Transform), nonoverlapping template matchings, overlap­
ping template matchings, Maurer’s universal statistical, approximate entropy
(based on the work of Pincus, Singer and Kalman), random excursions (due to
Baron and Rukhin), Lempel-Ziv complexity, linear complexity, and serial tests.

The literature review for the MCI and TSP-solving with Simulated An­
nealing, Genetic and Ant System approaches are in the respective sections.

1.3 W h y M C In tegration and T S P ?

W
With the advancement of technology various methodology are developed to solve
a problem. MC methods, one of the premier technique in simulation, are ran­
domized in nature and hence uses RNs to simulate. It has applications in eval­
IE
uation of integrals including path integrals, integral equations, boundary value
problems for PDE’s, ordinary differential equations with random walks, ordinary
EV

stochastic differential equations, simulation of random variables, stochastic pro­


cesses and fields. Practical problems needs the evaluation of multi-dimensional
integrals and MCI provides the solution with a much faster rate of convergence
PR

as compared to the available methods, like trapezoidal rule, Simpson’s rule.


However, each has its own advantages and disadvantages. MCI method is i)
simple to implement, ii) efficient for multi-dimensional integrals, and in ) effi­
cient with complex domains and integrals. But, it needs many sample points
(in this study RNGs) for convergence which implies more computational cost.

The second problem studied is the TSP. It refers to the problem of finding
the shortest path for a traveling salesman visiting all of N cities only once
starting at a city and returning to it in the end. The complexity of the TSP is
(N —1)! = x ( ^ ) N for the deterministic algorithm. For over half a century

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
its study has led the way to improved randomized algorithms which are always
polynomial time. The most popular ones are Simulated Annealing (with 2-Opt,
3-Opt, fc-Opt), Genetic algorithm, and Ant System approaches. The goal of
this study is to investigate the effect of the RNGs in the quality of result and
rank them according to that.

1.4 O rganization o f th e th esis

The work included in this thesis presents an overview of the existing RNGs
in Chapter 2 and in Chapter 3 discusses some important statistical tests for
uniformity and randomness and presented the results based on them. MCI

W
for single, double, and triple integrations with results are given in Chapter 4.
Chapter 5 provides introduction to TSP, its Integer Programming formulation,
IE
Held-Karp lower bound for solutions, and the different heuristic techniques,
viz., Simulated Annealing, Genetic Algorithm, and Ant System approach with
EV
results. Ranking of the RNGs based on the empirical results, observations and
remarks are included in Chapter 6 .
PR

1.5 C om p u tation al R esources

All the work in this research has been performed on desktop computers with
Intel Pentium 4 Processor 3.1 GHz, 592MHz, 1 GB RAM and 2MB L2 Cache
machine running Windows XP. The programs are coded in Matlab and compiled
using Matlab7 and the plots are also generated using Matlab7. All concerned
Matlab programs are included to readily check/run for data considered here as
well as for data not considered here.

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
C hapter 2

Random Num ber Generators

W
What is a random number generator? A random number generator (RNG) is
a physical or mechanical device designed to generate a sequence of numbers
that does not have any recognizable pattern and hence called random numbers
IE
(RNs). The motivation for this generation is from nature, for example, brown­
ian motion (where motion of a particle is random), DNA structure (where the
EV

genetic patterns are random), and chaos theory (where small variation in the
initial condition generates randomness throughout the system).

Where do we need them? RNG were originally constructed to carry out


PR

computer simulation of physical phenomena, specifically the simulation of neu­


tron transport in nuclear fission. Now RNGs have several important applica­
tions.

• Sampling

• Numerical analysis

• Computer programming: random inputs randomized algorithms

• Decision making: optimal strategies in game theory

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
• Financial markets: Option derivatives

• Cryptography and cryptanalysis

• Parapsychology as a test of precognition

• Entertainment: Electronic casino game, Lottery

How do we get them? We can obtain RNGs broadly in two different ways.

i) Physical: A physical RNG is based on an essentially random physical


events, viz., changes in physical characteristics of devices, electronic noise, ra­
dioactive decay or electromagnetic interference. Examples of such are Quantis,
from Id Quantique [5], is a physical RNG exploiting an elementary quantum

W
optics process. SGI [6 ] has patented a method called lavarand for generating
random numbers using digital snapshots of lava lamps. The properties for these
IE
types of RNGs are slow, not portable, unpredictable, and no mathematical (i.e.,
theoretical) analysis is possible.
EV

ii) Computational: A computational RNG is generated by a specific algo­


rithm which can be replicated exactly to yield an identical sequence, thus they
are called pseudo-RNs and the generators are called pseudo-random number
PR

generators (PRNGs). The properties of PRNGs are as follows:

• Must be uniformly distributed.

• Must be statistically independent.

• Must be reproducible.

• Must have larger periods (repeatability cycle).

• Generation of the RNs must be fast.

• Generation of RNs should use as little memory as possible.

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.
2.1 P seu d o-ran d om N u m b er G enerators

Nondeterministic algorithms that use randomness rely heavily on PRNGs. Se­


quences generated by good PRNGs pass statistical and theoretical tests, whereas
sequences generated by inferior PRNGs do not. Most of the commonly used
PRNGs are based on linear congruential (special case of multiple recursive gen­
erator) methods while others on lagged Fibonacci method, generalized feedback
shift register procedure, subtract with borrow (special case of multiply with
carry) technique, and combined linear congruential methods. We briefly de­
scribe these methods below. Knuth [1] has described in detail the mathematical
aspects of the PRNGs. All these RNGs have been generated in the semi-closed
interval [0, 1). A generalization to any other interval [a, b) is immediate since

W
the new RN will be a + r(b —a), where r is the RN in [0, 1).
IE
2.1.1 Linear C ongruential M ethod
EV

The method for the linear congruential generator LCG (a, c, m, x0) proposed by
Lehmer in 1948 [1], [7], [8 ], [10] is as follows. The sequence of RNs xn is given
by the recursion
PR

xn — (ax n-1 -I- c) mod m (2 . 1 )

where, m = modulus (m > 0 ), a — multiplier (0 < a < m), c = increment


(0 < c < m), xa = seed (0 < x < m). In general, a linear congruential generator
of order k, known as multiplicative recursive congruential generator, denoted by
LCG ( a i,..., a/t, c, m, x0), is based on the k th - order linear recurrence

xn = (aixi + ... + akxn- k + c) mod m (2 .2 )

where the order k and the modulus m are positive integer and the coefficients
are integer in the interval [—(m —1), (m —1)]. The numbers xn of the sequence
are then usually scaled to the interval [0,1] by rn = xn/m . When c = 0, this

Reproduced with permission of the copyright owner. Further reproduction prohibited without permission.

Вам также может понравиться