Uniform random numbers generators
|
|
- Miles Lawson
- 6 years ago
- Views:
Transcription
1 Uniform random numbers generators Lecturer: Dmitri A. Moltchanov
2 OUTLINE: The need for random numbers; Basic steps in generation; Uniformly distributed random numbers; Von Neumann s generator; Congruential methods: additive, multiplicative, linear; Tausworthe generator; Composite generators. Statistical tests for uniform random numbers. Independence: runs test and correlation test; Independence: χ 2 and Kolmogorov test. Lecture: Uniform random numbers generators 2
3 1. The need for random numbers Examples of randomness in telecommunications: interarrival times between arrivals of packets, tasks, etc.; service time of packets, tasks, etc.; time between failure of various components; repair time of various components;... Importance for simulations: random events are characterized by distributions; simulations: we cannot use distribution directly. For example, M/M/1 queuing system: arrival process: exponential distribution with mean 1/λ; service times: exponential distribution with mean 1/µ. Lecture: Uniform random numbers generators 3
4 Discrete-event simulation of M/M/1 queue INITIALIZATION time:=0; queue:=0; sum:=0; throughput:=0; generate first interarrival time; MAIN PROGRAM while time < runlength do case nextevent of arrival event: time:=arrivaltime; add customer to a queue; start new service if the service is idle; generate next interarrival time; departure event: time:=departuretime; throughput:=throughtput + 1; remove customer from a queue; if (queue not empty) sum:=sum + waiting time; start new service; OUTPUT mean waiting time = sum / throughput Lecture: Uniform random numbers generators 4
5 2. General notes All computer generated numbers are pseudo ones: we know the method how they are generated; we can predict any random sequence in advance. The goal is then: imitate random sequences as good as possible. Requirements for generators: must be fast; must have low complexity; must be portable; must have sufficiently long cycles; must allow to generate repeatable sequences; numbers must be independent; numbers must closely follow a given distribution. Lecture: Uniform random numbers generators 5
6 General approach nowadays: transforming one random variable to another one; as a reference distribution a uniform distribution is often used. Note the following: most languages contain generator of uniformly distributed numbers in interval (0, 1). most languages do not contain implementations of arbitrarily distributed random numbers. The procedure is to: generate RN with inform distribution between a and b, b >>>> a; transform it somehow to random number with uniform distribution on (0, 1); transform it somehow to a random number with desired distribution. Lecture: Uniform random numbers generators 6
7 2.1. Step 1: uniform random numbers in (a, b) Basic approach: generate random number with uniform distribution on (a, b); transform these random numbers to (0, 1); transform it somehow to a random number with desired distribution. Uniform generators: old methods: mostly based on radioactivity; Von Neumann s algorithm; congruential methods. Basic approach: next number is some function of previous one γ i+1 = F (γ i ), i = 0, 1,..., (1) recurrence relation of the first order; γ 0 is known and directly computed from the seed. Lecture: Uniform random numbers generators 7
8 2.2. Step 2: transforming to random numbers in (0, 1) Basic approach: generate random number with uniform distribution on (0, 1); transform these random numbers to (0, 1); transform it somehow to a random number with desired distribution. Uniform U(0, 1) distribution has the following pdf: 1, 0 x 1 f(x) = 0, otherwise. (2) Lecture: Uniform random numbers generators 8
9 Mean and variance are given by: E[X] = 1 0 xdx = x = 1 2, σ 2 [X] = (3) How to get U(0, 1): by rescaling from U(0, m) as follows: y i = γ i /m, (4) where m is the biggest possible number that can be generated. What we get: something like: 0.12, 0.67, 0.94, 0.04, 0.65, 0.20,... ; sequence that appears to be random... Lecture: Uniform random numbers generators 9
10 2.3. Step 3: non-uniform random numbers Basic approach: generate random number with uniform distribution on (a, b); transform these random numbers to (0, 1); transform it somehow to a random number with desired distribution. If we have generator U(0, 1) the following techniques are avalable: discretization: bernoulli, binomial, poisson, geometric; rescaling: uniform; inverse transform: exponential; specific transforms: normal; rejection method: universal method; reduction method: Erlang, Binomial; composition method: for complex distributions. Lecture: Uniform random numbers generators 10
11 3. Uniformly distributed random numbers The generator is fully characterized by (S, s 0, f, U, g): S is a finite set of states; s 0 S is the initial state; f(s S) is the transition function; U is a finite set of output values; g(s U) is the output function. The algorithm is then: let u 0 = g(s 0 ); for i = 1, 2,... do the following recursion: s i = f(s i 1 ); u i = g(s i ). Note: functions f( ) and g( ) influence the goodness of the algorithm heavily. Lecture: Uniform random numbers generators 11
12 user choice s 0 u 0 =g(s 0 ) u 0 u 4 s 1 =f(s 0 ) s 1 s 0 s 3 s 4 s 4 =f(s 3 ) u 1 =g(s 1 ) u 4 =g(s 4 ) u 3 =g(s 3 ) u 1 u 3 s 2 =f(s 1 ) s 3 =f(s 2 ) s 2 u 2 u 2 =g(s 2 ) Figure 1: Example of the operations of random number generator. Here s 0 is a random seed: allows to repeat the whole sequence; allows to manually assure that you get different sequence. Lecture: Uniform random numbers generators 12
13 3.1. Von Neumann s generator The basic procedure: start with some number u 0 of a certain length x (say, x = 4 digits, this is seed); square the number; take middle 4 digits to get u 1 ; repeat... example: with seed 1234 we get 1234, 5227, 3215, 3362, 3030, etc. Shortcoming: sensitive to the random seed: seed 2345: 2345, 4990, 9001, 180, 324, 1049, 1004, 80, 64, (will always < 100); may have very short period: seed 2100: 2100, 4100, 8100, 6100, 2100, 4100, 8100,... (period = 4 numbers). To generate U(0, 1): divide each obtained number by 10 x (x is the length of u 0 ). Note: this generator is also known as midsquare generator. Lecture: Uniform random numbers generators 13
14 3.2. Congruential methods There are a number of versions: additive congruential method; multiplicative congruential method; linear congruential method; tausworthe generator. General congruential generator: u i+1 = f(u i, u i 1,... ) mod m, (5) u i, u i 1,... are past numbers. For example, quadratic congruential generator: u i+1 = (a 1 u 2 i + a 2 u i 1 + c) mod m. (6) Note: if here a 1 = a 2 = 1, c = 0, m = 2 we have the same as midsquare method. Lecture: Uniform random numbers generators 14
15 3.3. Additive congruential method Additive congruential generator is given: u i+1 = (a 1 u i + a 2 u i a k u i k ) mod m. (7) The common special case is sometimes used: u i+1 = (a 1 u i + a 2 u i 1 ) mod m. (8) Characteristics: divide by m to get U(0, 1); maximum period is m k ; note: rarely used. Shortcomings: consider k = 2: consider three consecutive numbers u i 2, u i 1, u i ; we will never get: u i 2 < u i < u i 1 and u i 1 < u i < u i 2 (must be 1/6 of all sequences). Lecture: Uniform random numbers generators 15
16 3.4. Multiplicative congruential method Multiplicative congruential generator is given: u i+1 = (au i ) mod m. (9) Characteristics: divide by m to get U(0, 1); theoretical maximum period is m; note: rarely used. Shortcomings: can never produce 0. Choice of a, m is very important: recommended m = (2 p 1) with p = 2, 3, 5, 7, 13, 17, 19, 31, 61 (Fermat numbers); if m = 2 q, q 4 simplifies the calculation of modulo; practical maximum period is at best no longer than m/4. Lecture: Uniform random numbers generators 16
17 3.5. Linear congruential method Linear congruential generator is given: u i+1 = (au i + c) mod m, (10) where a, c, m are all positive. Characteristics: divide by m to get U(0, 1); maximum period is m; frequently used. Choice of a, c, m is very important. To get full period m choose: m and c have no common divisor; c and m are prime number (distinct natural number divisors 1 and itself only); if q is a prime divisor of m then a = 1, mod q; if 4 is a divisor of m then a = 1, mod 4. Lecture: Uniform random numbers generators 17
18 The step-by-step procedure is as follows: set the seed x 0 ; multiply x by a and add c; divide the result by m; the reminder is x 1 ; repeat to get x 2, x 3,.... Examples: x 0 = 7, a = 7, c = 7, m = 10 we get: 7,6,9,0,7,6,9,0,... (period = 4); x 0 = 1, a = 1, c = 5, m = 13 we get: 1,6,11,3,8,0,5,10,2,7,12,4,9,1... (period = 13); x 0 = 8, a = 2, c = 5, m = 13 we get: 8,8,8,8,8,8,8,8,... (period = 1!). Recommended values: a = 314, 159, 269, c = 453, 806, 245, m = 231 for 32 bit machine. Lecture: Uniform random numbers generators 18
19 Complexity of the algorithm: addition, multiplications and division: division is slow: to avoid it set m to the size of the computer word. Overflow problem when m equals to the size of the word: values a, c and m are such that the result ax i + c is greater than the word; it may lead to loss of significant digits but it does not hurt! How to deal with: register can accommodate 2 digits at maximum; the largest number that can be stored is 99; if m = 100: for a = 8, u 0 = 2, c = 10 we get (au i + c) mod 100 = 26; if m = 100: for a = 8, u 0 = 20, c = 10 we get (au i + c) mod 100 = 170; au i = 8 20 = 160 causing overflow; first significant digit is lost and register contains 60; the reminder in the register (result) is: ( ) mod 70 = 70. the same as 170 mod 100 = 70. Lecture: Uniform random numbers generators 19
20 3.6. How to get good congruental generator Characteristics of good generator: should provide maximum density: no large gaps in [0, 1] are produced by random numbers; problem: each number is discrete; solution: a very large integer for modulus m. should provide maximum period: achieve maximum density and avoid cycling; achieve by: proper choice of a, c, m, and x 0. effective for modern computers: set modulo to power of 2. Lecture: Uniform random numbers generators 20
21 3.7. Tausworthe generator Tausworthe generator (case of linear congruential generator or order k): ( k ) z i = (a 1 z i 1 + a 2 z i a k z i k + c) mod 2 = a j z i j + c mod 2. (11) where a j {0, 1}, j = 0, 1,..., k; the output is binary: j=1 Advantages: independent of the system (computer architecture); independent of the word size; very large periods; can be used in composite generators (we consider in what follows). Note: there are several bit selection techniques to get numbers. Lecture: Uniform random numbers generators 21
22 A way to generate numbers: choose an integer l k; split in blocks of length l and interpret each block as a digit: u n = l 1 j=0 z nl+j 2 (j+1). (12) In practice, only two a i are used and set to 1 at places h and k. We get: Example: h = 3, k = 4, initial values 1,1,1,1; we get: ; period is 2 k 1 = 15; if l = 4: 13/16, 7/16, 8/16, 9/16, 10/16, 15/16, 1/16, 3/16... z n = (z i h + z i k ) mod 2. (13) Lecture: Uniform random numbers generators 22
23 3.8. Composite generator Idea: use two generators of low period to generate another with wider period. The basic principle: use the first generator to fill the shuffling table (address - entry (random number)); use random numbers of second generator as addresses in the next step; each number corresponding to the address is replaced by new random number of first generator. The following algorithm uses one generator to shuffle with itself: 1. create shuffling table of 100 entries (i, t i = γ i, i = 1, 2,..., 100); 2. draw random number γ k and normalize to the range (1, 100); 3. entry i of the table gives random number t i ; 4. draw the next random number γ k+1 and update t i = γ k+1 ; 5. repeat from step 2. Note: table with 100 entries gives fairly good results. Lecture: Uniform random numbers generators 23
24 4. Tests for random number generators What do we want to check: independence; uniformity. Important notes: if and only if tests passed number can be treated as random; recall: numbers are actually deterministic! Commonly used tests for independence: runs test; correlation test. Commonly used tests for uniformity: Kolmogorov s test; χ 2 test. Lecture: Uniform random numbers generators 24
25 4.1. Independence: runs test Basic idea: compute patterns of numbers (always increase, always decrease, etc.); compare to theoretical probabilities. 1/3 1/3 1/3 1/3 1/3 1/3 Figure 2: Illustration of the basic idea. Lecture: Uniform random numbers generators 25
26 Do the following: consider a sequence of pseudo random numbers: {u i, i = 0, 1,..., n}; consider unbroken subsequences of numbers where numbers are monotonically increasing; such subsequence is called run-up; example: 0.78,081,0.89,0.81 is a run-up of length 3. compute all run-ups of length i: r i, i = 1, 2, 3, 4, 5; all run-ups of length i 6 are grouped into r 6. calculate: R = 1 n 1 i,j 6 (r i nb i )(r j nb j )a ij, 1 i, j 6, (14) where (b 1, b 2,..., b 6 ) = ( 1 6, 5 24, , 19 ) 720, , 1, (15) 840 Lecture: Uniform random numbers generators 26
27 Coefficients a ij must be chosen as an element of the matrix: Statistics R has χ 2 distribution: number of freedoms: 6; n > If so, observations are i.i.d. Lecture: Uniform random numbers generators 27
28 4.2. Independence: correlation test Basic idea: compute autocorrelation coefficient for lag-1; if it is not zero and this is statistically significant result, numbers are not independent. Compute statistics (lag-1 autocorrelation coefficient) as: R = N (u j E[u])(u j+1 E[u])/ j=1 N (u j E[j]) 2. (16) j=1 Practice: if R is relatively big there is serial correlation. Important notes: exact distribution of R is unknown; for large N: if u j uncorrelated we have: P r{ 2/ N R 2/ N}; therefore: reject hypotheses of non-correlated at 5% level if R is not in { 2/ N, 2/ N}. Notes: other tests for correlation Ljung and Box test, Portmanteau test, etc. Lecture: Uniform random numbers generators 28
29 4.3. Uniformity: χ 2 test The algorithm: divide [0, 1] into k, k > 100 non-overlapping intervals; compute the relative frequencies of falling in each category, f i : ensure that there are enough numbers to get f i > 5, i = 1, 2,..., k; values f i > 5, i = 1, 2,..., k are called observed values. if observations are truly uniformly distributed then: these values should be equal to r i = n/k, i = 1, 2,..., k; these values are called theoretical values. compute χ 2 statistics for uniform distribution: χ 2 = k n that must have k 1 degrees of freedom. k i=1 ( f i n k ) 2. (17) Lecture: Uniform random numbers generators 29
30 Hypotheses: H 0 observations are uniformly distributed; H 1 observations are not uniformly distributed. H 0 is rejected if: computed value of χ 2 is greater than one obtained from the tables; you should check the entry with k 1 degrees of freedom and 1-a level of significance. Lecture: Uniform random numbers generators 30
31 4.4. Kolmogorov test Facts about this test: compares empirical distribution with theoretical ones; empirical: F N (x) number of smaller than or equal to x, divided by N; theoretical: uniform distribution in (0, 1): F (x) = x, 0 < x < 1. Hypotheses: H 0 : F N (x) follows F (x); H 1 : F N (x) does not follow F (x). Statistics: maximum absolute difference over a range: R = max F (x) F N (x). (18) if R > R α : H 0 is rejected; if R R α : H 0 is accepted. Note: use tables for N, α (significance level), to find R α. Lecture: Uniform random numbers generators 31
32 Example: we got 0.44, 0.81, 0.14, 0.05, 0.93: H 0 : random numbers follows uniform distribution; we have to compute: R (j) j/n j/n R (j) R (j) (j-1)/n compute statistics as: R = max F (x) F N (x) = 0.26; from tables: for α = 0.05, R α = > R; H 0 is accepted, random numbers are distributed uniformly in (0, 1). Lecture: Uniform random numbers generators 32
33 4.5. Other tests The serial test: consider pairs (u 1, u 2 ), (u 3, u 4 ),..., (u 2N 1, u 2N ); count how many observations fall into N 2 different subsquares of the unit square; apply χ 2 test to decide whether they follow uniform distribution; one can formulate M-dimensional version of this test. The permutation test look at k-tuples: (u 1, u k ), (u k+1, u 2k ),..., (u (N 1)k+1, u Nk ); in a k-tuple there k! possible orderings; in a k-tuple all orderings are equally likely; determine frequencies of orderings in k-tuples; apply χ 2 test to decide whether they follow uniform distribution. Lecture: Uniform random numbers generators 33
34 The gap test let J be some fixed subinterval in (0, 1); if we have that: u n+j not in J, 0 j k, and both u n 1 J, u n+k+1 J; we say that there is a gap of length k. H 0 : numbers are independent and uniformly distributed in (0, 1): gap length must be geometrically distributed with some parameter p; p is the length of interval J: P r{gap of length k} = p(1 p) k. (19) practice: we observe a large number of gaps, say N; choose an integer and count number of gaps of length 0, 1,..., h 1 and h; apply χ 2 test to decide whether they independent and follow uniform distribution. Lecture: Uniform random numbers generators 34
35 4.6. Important notes Some important notes on seed number: do not use seed 0; avoid even values; do not use the same sequence for different purposes in a single simulation run. Note: these instruction may not be applicable for a particular generator. General notes: some common generators are found to be inadequate; even if generator passed tests, some underlying pattern might still be undetected; if the task is important use composite generator. Lecture: Uniform random numbers generators 35
Slides 3: Random Numbers
Slides 3: Random Numbers We previously considered a few examples of simulating real processes. In order to mimic real randomness of events such as arrival times we considered the use of random numbers
More informationHow does the computer generate observations from various distributions specified after input analysis?
1 How does the computer generate observations from various distributions specified after input analysis? There are two main components to the generation of observations from probability distributions.
More informationUNIT 5:Random number generation And Variation Generation
UNIT 5:Random number generation And Variation Generation RANDOM-NUMBER GENERATION Random numbers are a necessary basic ingredient in the simulation of almost all discrete systems. Most computer languages
More informationSources of randomness
Random Number Generator Chapter 7 In simulations, we generate random values for variables with a specified distribution Ex., model service times using the exponential distribution Generation of random
More informationVariance reduction techniques
Variance reduction techniques Lecturer: Dmitri A. Moltchanov E-mail: moltchan@cs.tut.fi http://www.cs.tut.fi/kurssit/elt-53606/ OUTLINE: Simulation with a given accuracy; Variance reduction techniques;
More informationHow does the computer generate observations from various distributions specified after input analysis?
1 How does the computer generate observations from various distributions specified after input analysis? There are two main components to the generation of observations from probability distributions.
More informationSystems Simulation Chapter 7: Random-Number Generation
Systems Simulation Chapter 7: Random-Number Generation Fatih Cavdur fatihcavdur@uludag.edu.tr April 22, 2014 Introduction Introduction Random Numbers (RNs) are a necessary basic ingredient in the simulation
More informationCPSC 531: Random Numbers. Jonathan Hudson Department of Computer Science University of Calgary
CPSC 531: Random Numbers Jonathan Hudson Department of Computer Science University of Calgary http://www.ucalgary.ca/~hudsonj/531f17 Introduction In simulations, we generate random values for variables
More informationDiscrete-event simulations
Discrete-event simulations Lecturer: Dmitri A. Moltchanov E-mail: moltchan@cs.tut.fi http://www.cs.tut.fi/kurssit/elt-53606/ OUTLINE: Why do we need simulations? Step-by-step simulations; Classifications;
More informationVariance reduction techniques
Variance reduction techniques Lecturer: Dmitri A. Moltchanov E-mail: moltchan@cs.tut.fi http://www.cs.tut.fi/ moltchan/modsim/ http://www.cs.tut.fi/kurssit/tlt-2706/ OUTLINE: Simulation with a given confidence;
More informationGenerating Random Variables
Generating Random Variables These slides are created by Dr. Yih Huang of George Mason University. Students registered in Dr. Huang's courses at GMU can make a single machine-readable copy and print a single
More informationB.N.Bandodkar College of Science, Thane. Random-Number Generation. Mrs M.J.Gholba
B.N.Bandodkar College of Science, Thane Random-Number Generation Mrs M.J.Gholba Properties of Random Numbers A sequence of random numbers, R, R,., must have two important statistical properties, uniformity
More informationGenerating Uniform Random Numbers
1 / 43 Generating Uniform Random Numbers Christos Alexopoulos and Dave Goldsman Georgia Institute of Technology, Atlanta, GA, USA March 1, 2016 2 / 43 Outline 1 Introduction 2 Some Generators We Won t
More informationLehmer Random Number Generators: Introduction
Lehmer Random Number Generators: Introduction Revised version of the slides based on the book Discrete-Event Simulation: a first course LL Leemis & SK Park Section(s) 21, 22 c 2006 Pearson Ed, Inc 0-13-142917-5
More information2905 Queueing Theory and Simulation PART IV: SIMULATION
2905 Queueing Theory and Simulation PART IV: SIMULATION 22 Random Numbers A fundamental step in a simulation study is the generation of random numbers, where a random number represents the value of a random
More informationGenerating Uniform Random Numbers
1 / 41 Generating Uniform Random Numbers Christos Alexopoulos and Dave Goldsman Georgia Institute of Technology, Atlanta, GA, USA 10/13/16 2 / 41 Outline 1 Introduction 2 Some Lousy Generators We Won t
More informationIndependent Events. Two events are independent if knowing that one occurs does not change the probability of the other occurring
Independent Events Two events are independent if knowing that one occurs does not change the probability of the other occurring Conditional probability is denoted P(A B), which is defined to be: P(A and
More informationIE 303 Discrete-Event Simulation L E C T U R E 6 : R A N D O M N U M B E R G E N E R A T I O N
IE 303 Discrete-Event Simulation L E C T U R E 6 : R A N D O M N U M B E R G E N E R A T I O N Review of the Last Lecture Continuous Distributions Uniform distributions Exponential distributions and memoryless
More informationPseudo-Random Numbers Generators. Anne GILLE-GENEST. March 1, Premia Introduction Definitions Good generators...
14 pages 1 Pseudo-Random Numbers Generators Anne GILLE-GENEST March 1, 2012 Contents Premia 14 1 Introduction 2 1.1 Definitions............................. 2 1.2 Good generators..........................
More informationDepartment of Electrical- and Information Technology. ETS061 Lecture 3, Verification, Validation and Input
ETS061 Lecture 3, Verification, Validation and Input Verification and Validation Real system Validation Model Verification Measurements Verification Break model down into smaller bits and test each bit
More informationComputer Simulation Techniques: The definitive introduction!
Clients CPU Computer Simulation Techniques: The definitive introduction! 1 2 2 3 3 7 b 4 5 6 9 6 9 Yes Is CPU No MCL = tarr queue MCL = MCL + 1 empty? A new arrival event occurs A departure event occurs
More informationGenerating Uniform Random Numbers
1 / 44 Generating Uniform Random Numbers Christos Alexopoulos and Dave Goldsman Georgia Institute of Technology, Atlanta, GA, USA 10/29/17 2 / 44 Outline 1 Introduction 2 Some Lousy Generators We Won t
More informationReview of Statistical Terminology
Review of Statistical Terminology An experiment is a process whose outcome is not known with certainty. The experiment s sample space S is the set of all possible outcomes. A random variable is a function
More informationDesign of discrete-event simulations
Design of discrete-event simulations Lecturer: Dmitri A. Moltchanov E-mail: moltchan@cs.tut.fi http://www.cs.tut.fi/kurssit/tlt-2707/ OUTLINE: Discrete event simulation; Event advance design; Unit-time
More informationAlgorithms and Networking for Computer Games
Algorithms and Networking for Computer Games Chapter 2: Random Numbers http://www.wiley.com/go/smed What are random numbers good for (according to D.E. Knuth) simulation sampling numerical analysis computer
More information2008 Winton. Review of Statistical Terminology
1 Review of Statistical Terminology 2 Formal Terminology An experiment is a process whose outcome is not known with certainty The experiment s sample space S is the set of all possible outcomes. A random
More informationISyE 6644 Fall 2014 Test #2 Solutions (revised 11/7/16)
1 NAME ISyE 6644 Fall 2014 Test #2 Solutions (revised 11/7/16) This test is 85 minutes. You are allowed two cheat sheets. Good luck! 1. Some short answer questions to get things going. (a) Consider the
More informationEEC 686/785 Modeling & Performance Evaluation of Computer Systems. Lecture 19
EEC 686/785 Modeling & Performance Evaluation of Computer Systems Lecture 19 Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org (based on Dr. Raj Jain s lecture
More informationStochastic Simulation of
Stochastic Simulation of Communication Networks -WS 2014/2015 Part 2 Random Number Generation Prof. Dr. C. Görg www.comnets.uni-bremen.de VSIM 2-1 Table of Contents 1 General Introduction 2 Random Number
More informationComputer Applications for Engineers ET 601
Computer Applications for Engineers ET 601 Asst. Prof. Dr. Prapun Suksompong prapun@siit.tu.ac.th Random Variables (Con t) 1 Office Hours: (BKD 3601-7) Wednesday 9:30-11:30 Wednesday 16:00-17:00 Thursday
More informationOutline. Simulation of a Single-Server Queueing System. EEC 686/785 Modeling & Performance Evaluation of Computer Systems.
EEC 686/785 Modeling & Performance Evaluation of Computer Systems Lecture 19 Outline Simulation of a Single-Server Queueing System Review of midterm # Department of Electrical and Computer Engineering
More informationRandom Number Generation. CS1538: Introduction to simulations
Random Number Generation CS1538: Introduction to simulations Random Numbers Stochastic simulations require random data True random data cannot come from an algorithm We must obtain it from some process
More informationSimulation. Where real stuff starts
1 Simulation Where real stuff starts ToC 1. What is a simulation? 2. Accuracy of output 3. Random Number Generators 4. How to sample 5. Monte Carlo 6. Bootstrap 2 1. What is a simulation? 3 What is a simulation?
More informationSimulation. Where real stuff starts
Simulation Where real stuff starts March 2019 1 ToC 1. What is a simulation? 2. Accuracy of output 3. Random Number Generators 4. How to sample 5. Monte Carlo 6. Bootstrap 2 1. What is a simulation? 3
More informationRecap. Probability, stochastic processes, Markov chains. ELEC-C7210 Modeling and analysis of communication networks
Recap Probability, stochastic processes, Markov chains ELEC-C7210 Modeling and analysis of communication networks 1 Recap: Probability theory important distributions Discrete distributions Geometric distribution
More informationQueueing Theory I Summary! Little s Law! Queueing System Notation! Stationary Analysis of Elementary Queueing Systems " M/M/1 " M/M/m " M/M/1/K "
Queueing Theory I Summary Little s Law Queueing System Notation Stationary Analysis of Elementary Queueing Systems " M/M/1 " M/M/m " M/M/1/K " Little s Law a(t): the process that counts the number of arrivals
More informationRelations. Binary Relation. Let A and B be sets. A (binary) relation from A to B is a subset of A B. Notation. Let R A B be a relation from A to B.
Relations Binary Relation Let A and B be sets. A (binary) relation from A to B is a subset of A B. Notation Let R A B be a relation from A to B. If (a, b) R, we write a R b. 1 Binary Relation Example:
More informationStochastic Simulation of Communication Networks
Stochastic Simulation of Communication Networks Part 2 Amanpreet Singh (aps) Dr.-Ing Umar Toseef (umr) (@comnets.uni-bremen.de) Prof. Dr. C. Görg www.comnets.uni-bremen.de VSIM 2-1 Table of Contents 1
More informationUniform Random Binary Floating Point Number Generation
Uniform Random Binary Floating Point Number Generation Prof. Dr. Thomas Morgenstern, Phone: ++49.3943-659-337, Fax: ++49.3943-659-399, tmorgenstern@hs-harz.de, Hochschule Harz, Friedrichstr. 57-59, 38855
More informationNotation Precedence Diagram
Notation Precedence Diagram xix xxi CHAPTER 1 Introduction 1 1.1. Systems, Models, and Simulation 1 1.2. Verification, Approximation, and Validation 8 1.2.1. Verifying a Program 9 1.2.2. Approximation
More informationTopics in Computer Mathematics
Random Number Generation (Uniform random numbers) Introduction We frequently need some way to generate numbers that are random (by some criteria), especially in computer science. Simulations of natural
More informationEEC 686/785 Modeling & Performance Evaluation of Computer Systems. Lecture 18
EEC 686/785 Modeling & Performance Evaluation of Computer Systems Lecture 18 Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org (based on Dr. Raj Jain s lecture
More informationGI/M/1 and GI/M/m queuing systems
GI/M/1 and GI/M/m queuing systems Dmitri A. Moltchanov moltchan@cs.tut.fi http://www.cs.tut.fi/kurssit/tlt-2716/ OUTLINE: GI/M/1 queuing system; Methods of analysis; Imbedded Markov chain approach; Waiting
More informationSeminar on Simulation of Telecommunication Sistems
Politecnico di Milano Dipartimento di Elettronica e Informazione Seminar on Simulation of Telecommunication Sistems Massimo Tornatore Francesco Musumeci (Author of the original slides: Fabio Martignon)
More informationRandom processes and probability distributions. Phys 420/580 Lecture 20
Random processes and probability distributions Phys 420/580 Lecture 20 Random processes Many physical processes are random in character: e.g., nuclear decay (Poisson distributed event count) P (k, τ) =
More information2008 Winton. Statistical Testing of RNGs
1 Statistical Testing of RNGs Criteria for Randomness For a sequence of numbers to be considered a sequence of randomly acquired numbers, it must have two basic statistical properties: Uniformly distributed
More informationProbability and Statistics Concepts
University of Central Florida Computer Science Division COT 5611 - Operating Systems. Spring 014 - dcm Probability and Statistics Concepts Random Variable: a rule that assigns a numerical value to each
More informationLecture 7: Simulation of Markov Processes. Pasi Lassila Department of Communications and Networking
Lecture 7: Simulation of Markov Processes Pasi Lassila Department of Communications and Networking Contents Markov processes theory recap Elementary queuing models for data networks Simulation of Markov
More informationMonte Carlo Techniques
Physics 75.502 Part III: Monte Carlo Methods 40 Monte Carlo Techniques Monte Carlo refers to any procedure that makes use of random numbers. Monte Carlo methods are used in: Simulation of natural phenomena
More information2 Random Variable Generation
2 Random Variable Generation Most Monte Carlo computations require, as a starting point, a sequence of i.i.d. random variables with given marginal distribution. We describe here some of the basic methods
More informationLecture 5: Random numbers and Monte Carlo (Numerical Recipes, Chapter 7) Motivations for generating random numbers
Lecture 5: Random numbers and Monte Carlo (Numerical Recipes, Chapter 7) Motivations for generating random numbers To sample a function in a statistically controlled manner (i.e. for Monte Carlo integration)
More information( ) ( ) Monte Carlo Methods Interested in. E f X = f x d x. Examples:
Monte Carlo Methods Interested in Examples: µ E f X = f x d x Type I error rate of a hypothesis test Mean width of a confidence interval procedure Evaluating a likelihood Finding posterior mean and variance
More informationS6880 #6. Random Number Generation #2: Testing RNGs
S6880 #6 Random Number Generation #2: Testing RNGs 1 Testing Uniform RNGs Theoretical Tests Outline 2 Empirical Tests for Independence Gap Tests Runs Test Coupon Collectors Test The Poker Test 3 Other
More informationLecture Notes 7 Random Processes. Markov Processes Markov Chains. Random Processes
Lecture Notes 7 Random Processes Definition IID Processes Bernoulli Process Binomial Counting Process Interarrival Time Process Markov Processes Markov Chains Classification of States Steady State Probabilities
More informationGlossary availability cellular manufacturing closed queueing network coefficient of variation (CV) conditional probability CONWIP
Glossary availability The long-run average fraction of time that the processor is available for processing jobs, denoted by a (p. 113). cellular manufacturing The concept of organizing the factory into
More informationPart IA Numbers and Sets
Part IA Numbers and Sets Definitions Based on lectures by A. G. Thomason Notes taken by Dexter Chua Michaelmas 2014 These notes are not endorsed by the lecturers, and I have modified them (often significantly)
More informationLecture Notes of Communication Network I y: part 5. Lijun Qian. Rutgers The State University of New Jersey. 94 Brett Road. Piscataway, NJ
Lecture Notes of Communication Network I y: part 5 Lijun Qian Department of Electrical Engineering Rutgers The State University of New Jersey 94 Brett Road Piscataway, NJ 08854-8058 October 6, 1998 Abstract
More informationExercises Stochastic Performance Modelling. Hamilton Institute, Summer 2010
Exercises Stochastic Performance Modelling Hamilton Institute, Summer Instruction Exercise Let X be a non-negative random variable with E[X ]
More informationChapter 4: Monte Carlo Methods. Paisan Nakmahachalasint
Chapter 4: Monte Carlo Methods Paisan Nakmahachalasint Introduction Monte Carlo Methods are a class of computational algorithms that rely on repeated random sampling to compute their results. Monte Carlo
More informationName of the Student:
SUBJECT NAME : Probability & Queueing Theory SUBJECT CODE : MA 6453 MATERIAL NAME : Part A questions REGULATION : R2013 UPDATED ON : November 2017 (Upto N/D 2017 QP) (Scan the above QR code for the direct
More informationChapter 5. Statistical Models in Simulations 5.1. Prof. Dr. Mesut Güneş Ch. 5 Statistical Models in Simulations
Chapter 5 Statistical Models in Simulations 5.1 Contents Basic Probability Theory Concepts Discrete Distributions Continuous Distributions Poisson Process Empirical Distributions Useful Statistical Models
More information14 Random Variables and Simulation
14 Random Variables and Simulation In this lecture note we consider the relationship between random variables and simulation models. Random variables play two important roles in simulation models. We assume
More informationProbability Distributions
02/07/07 PHY310: Statistical Data Analysis 1 PHY310: Lecture 05 Probability Distributions Road Map The Gausssian Describing Distributions Expectation Value Variance Basic Distributions Generating Random
More informationQueuing Networks: Burke s Theorem, Kleinrock s Approximation, and Jackson s Theorem. Wade Trappe
Queuing Networks: Burke s Theorem, Kleinrock s Approximation, and Jackson s Theorem Wade Trappe Lecture Overview Network of Queues Introduction Queues in Tandem roduct Form Solutions Burke s Theorem What
More informationM/G/1 and M/G/1/K systems
M/G/1 and M/G/1/K systems Dmitri A. Moltchanov dmitri.moltchanov@tut.fi http://www.cs.tut.fi/kurssit/elt-53606/ OUTLINE: Description of M/G/1 system; Methods of analysis; Residual life approach; Imbedded
More information57:022 Principles of Design II Final Exam Solutions - Spring 1997
57:022 Principles of Design II Final Exam Solutions - Spring 1997 Part: I II III IV V VI Total Possible Pts: 52 10 12 16 13 12 115 PART ONE Indicate "+" if True and "o" if False: + a. If a component's
More informationLecture 6: Introducing Complexity
COMP26120: Algorithms and Imperative Programming Lecture 6: Introducing Complexity Ian Pratt-Hartmann Room KB2.38: email: ipratt@cs.man.ac.uk 2015 16 You need this book: Make sure you use the up-to-date
More informationLecturer: Olga Galinina
Renewal models Lecturer: Olga Galinina E-mail: olga.galinina@tut.fi Outline Reminder. Exponential models definition of renewal processes exponential interval distribution Erlang distribution hyperexponential
More informationRandom Number Generators
1/18 Random Number Generators Professor Karl Sigman Columbia University Department of IEOR New York City USA 2/18 Introduction Your computer generates" numbers U 1, U 2, U 3,... that are considered independent
More informationComputer Architecture 10. Residue Number Systems
Computer Architecture 10 Residue Number Systems Ma d e wi t h Op e n Of f i c e. o r g 1 A Puzzle What number has the reminders 2, 3 and 2 when divided by the numbers 7, 5 and 3? x mod 7 = 2 x mod 5 =
More informationWorkshop on Heterogeneous Computing, 16-20, July No Monte Carlo is safe Monte Carlo - more so parallel Monte Carlo
Workshop on Heterogeneous Computing, 16-20, July 2012 No Monte Carlo is safe Monte Carlo - more so parallel Monte Carlo K. P. N. Murthy School of Physics, University of Hyderabad July 19, 2012 K P N Murthy
More informationCommunication Networks
Politecnico di Milano Department of Electronics, Information and Bioengineering (DEIB) of Communication Networks 5hr-Seminar in the course «Network Design and Planning» ECS289i Massimo Tornatore (Courtesy
More information1.225J J (ESD 205) Transportation Flow Systems
1.225J J (ESD 25) Transportation Flow Systems Lecture 9 Simulation Models Prof. Ismail Chabini and Prof. Amedeo R. Odoni Lecture 9 Outline About this lecture: It is based on R16. Only material covered
More informationAdvanced Herd Management Probabilities and distributions
Advanced Herd Management Probabilities and distributions Anders Ringgaard Kristensen Slide 1 Outline Probabilities Conditional probabilities Bayes theorem Distributions Discrete Continuous Distribution
More informationCSCE 564, Fall 2001 Notes 6 Page 1 13 Random Numbers The great metaphysical truth in the generation of random numbers is this: If you want a function
CSCE 564, Fall 2001 Notes 6 Page 1 13 Random Numbers The great metaphysical truth in the generation of random numbers is this: If you want a function that is reasonably random in behavior, then take any
More informationProbability Models in Electrical and Computer Engineering Mathematical models as tools in analysis and design Deterministic models Probability models
Probability Models in Electrical and Computer Engineering Mathematical models as tools in analysis and design Deterministic models Probability models Statistical regularity Properties of relative frequency
More informationReadings: Finish Section 5.2
LECTURE 19 Readings: Finish Section 5.2 Lecture outline Markov Processes I Checkout counter example. Markov process: definition. -step transition probabilities. Classification of states. Example: Checkout
More informationIE 303 Discrete-Event Simulation
IE 303 Discrete-Event Simulation 1 L E C T U R E 5 : P R O B A B I L I T Y R E V I E W Review of the Last Lecture Random Variables Probability Density (Mass) Functions Cumulative Density Function Discrete
More informationRandom Number Generation. Stephen Booth David Henty
Random Number Generation Stephen Booth David Henty Introduction Random numbers are frequently used in many types of computer simulation Frequently as part of a sampling process: Generate a representative
More informationMAS1302 Computational Probability and Statistics
MAS1302 Computational Probability and Statistics April 23, 2008 3. Simulating continuous random behaviour 3.1 The Continuous Uniform U(0,1) Distribution We have already used this random variable a great
More informationHand Simulations. Christos Alexopoulos and Dave Goldsman 9/2/14. Georgia Institute of Technology, Atlanta, GA, USA 1 / 26
1 / 26 Hand Simulations Christos Alexopoulos and Dave Goldsman Georgia Institute of Technology, Atlanta, GA, USA 9/2/14 2 / 26 Outline 1 Monte Carlo Integration 2 Making Some π 3 Single-Server Queue 4
More informationNetwork Simulation Chapter 5: Traffic Modeling. Chapter Overview
Network Simulation Chapter 5: Traffic Modeling Prof. Dr. Jürgen Jasperneite 1 Chapter Overview 1. Basic Simulation Modeling 2. OPNET IT Guru - A Tool for Discrete Event Simulation 3. Review of Basic Probabilities
More informationIE 581 Introduction to Stochastic Simulation
1. List criteria for choosing the majorizing density r (x) when creating an acceptance/rejection random-variate generator for a specified density function f (x). 2. Suppose the rate function of a nonhomogeneous
More informationRandom Number Generators: Metrics and Tests for Uniformity and Randomness
Random Number Generators: Metrics and Tests for Uniformity and Randomness E. A. Yfantis and J. B. Pedersen Image Processing, Computer Vision and Machine Intelligence Lab School of Computer Science College
More information2DI90 Probability & Statistics. 2DI90 Chapter 4 of MR
2DI90 Probability & Statistics 2DI90 Chapter 4 of MR Recap - Random Variables ( 2.8 MR)! Example: X is the random variable corresponding to the temperature of the room at time t. x is the measured temperature
More informationChapter 7 Random Numbers
Chapter 7 Random Numbers February 15, 2010 7 In the following random numbers and random sequences are treated as two manifestations of the same thing. A series of random numbers strung together is considered
More informationAnswers to selected exercises
Answers to selected exercises A First Course in Stochastic Models, Henk C. Tijms 1.1 ( ) 1.2 (a) Let waiting time if passengers already arrived,. Then,, (b) { (c) Long-run fraction for is (d) Let waiting
More informationUniform Random Number Generators
JHU 553.633/433: Monte Carlo Methods J. C. Spall 25 September 2017 CHAPTER 2 RANDOM NUMBER GENERATION Motivation and criteria for generators Linear generators (e.g., linear congruential generators) Multiple
More informationOutline. Finite source queue M/M/c//K Queues with impatience (balking, reneging, jockeying, retrial) Transient behavior Advanced Queue.
Outline Finite source queue M/M/c//K Queues with impatience (balking, reneging, jockeying, retrial) Transient behavior Advanced Queue Batch queue Bulk input queue M [X] /M/1 Bulk service queue M/M [Y]
More informationB. Maddah ENMG 622 Simulation 11/11/08
B. Maddah ENMG 622 Simulation 11/11/08 Random-Number Generators (Chapter 7, Law) Overview All stochastic simulations need to generate IID uniformly distributed on (0,1), U(0,1), random numbers. 1 f X (
More informationPUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.
PUTNAM TRAINING NUMBER THEORY (Last updated: December 11, 2017) Remark. This is a list of exercises on Number Theory. Miguel A. Lerma Exercises 1. Show that the sum of two consecutive primes is never twice
More informationChi-Squared Tests. Semester 1. Chi-Squared Tests
Semester 1 Goodness of Fit Up to now, we have tested hypotheses concerning the values of population parameters such as the population mean or proportion. We have not considered testing hypotheses about
More informationCDA5530: Performance Models of Computers and Networks. Chapter 4: Elementary Queuing Theory
CDA5530: Performance Models of Computers and Networks Chapter 4: Elementary Queuing Theory Definition Queuing system: a buffer (waiting room), service facility (one or more servers) a scheduling policy
More informationLink Models for Circuit Switching
Link Models for Circuit Switching The basis of traffic engineering for telecommunication networks is the Erlang loss function. It basically allows us to determine the amount of telephone traffic that can
More informationPseudo-random Number Generation. Qiuliang Tang
Pseudo-random Number Generation Qiuliang Tang Random Numbers in Cryptography The keystream in the one-time pad The secret key in the DES encryption The prime numbers p, q in the RSA encryption The private
More informationLecture notes: Algorithms for integers, polynomials (Thorsten Theobald)
Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald) 1 Euclid s Algorithm Euclid s Algorithm for computing the greatest common divisor belongs to the oldest known computing procedures
More information1.1 Linear Congruential Method D. H. Lehmer [15] introduced in 1948 the idea of generating a random number sequence using the following formula: X n+1
Testing Pseudo-Random Number Generators Abstract Julian Ortiz C. and Clayton V. Deutsch (jmo1@ualberta.ca - cdeutsch@civil.ualberta.ca) Department of Civil& Environmental Engineering, University of Alberta
More informationClass 12. Random Numbers
Class 12. Random Numbers NRiC 7. Frequently needed to generate initial conditions. Often used to solve problems statistically. How can a computer generate a random number? It can t! Generators are pseudo-random.
More informationSo far we discussed random number generators that need to have the maximum length period.
So far we discussed random number generators that need to have the maximum length period. Even the increment series has the maximum length period yet it is by no means random How do we decide if a generator
More informationTae-Soo Kim and Young-Kyun Yang
Kangweon-Kyungki Math. Jour. 14 (2006), No. 1, pp. 85 93 ON THE INITIAL SEED OF THE RANDOM NUMBER GENERATORS Tae-Soo Kim and Young-Kyun Yang Abstract. A good arithmetic random number generator should possess
More information