Chapter 4: Monte Carlo Methods. Paisan Nakmahachalasint

Size: px
Start display at page:

Download "Chapter 4: Monte Carlo Methods. Paisan Nakmahachalasint"

Transcription

1 Chapter 4: Monte Carlo Methods Paisan Nakmahachalasint

2 Introduction Monte Carlo Methods are a class of computational algorithms that rely on repeated random sampling to compute their results. Monte Carlo simulation methods are especially useful in studying systems with a large number of coupled degrees of freedom.

3 Introduction Monte Carlo methods describe a large and widely-used class of approaches which tend to follow a particular pattern: Define a domain of possible inputs. Generate inputs randomly from the domain using a certain specified probability distribution. Perform a deterministic computation using the inputs. Aggregate the results of the individual computations into the final result.

4 Uniform Random Number Generators Monte Carlo simulations are inherently probabilistic, and thus make frequent use of programs to generate random numbers. On a computer these numbers are not random at all -- they are strictly deterministic and reproducible, but they look like a stream of random numbers. For this reason such programs are more correctly called pseudorandom number generators.

5 Uniform Random Number Generators Essential Properties Repeatability -- the same sequence should be produced with the same seeds. Randomness -- should produce independent uniformly distributed random variables that pass all statistical tests for randomness. Long period The period should be much longer than the amount of random numbers needed. Insensitive to seeds -- period and randomness properties should not depend on the initial seeds.

6 Uniform Random Number Generators Additional Properties Portability -- should give the same results on different computers. Efficiency -- should be fast (small number of floating point operations) and not use much memory. Disjoint subsequences -- different seeds should produce long independent (disjoint) subsequences so that there are no correlations between simulations with different initial seeds. Homogeneity -- sequences of all bits should be random.

7 Uniform Random Number Generators Middle-Square Method Start with a four-digit number x 0, called the seed. Square it to obtain an eight-digit number (add a leading zero if necessary). Take the middle four digits as the next random number. n x n

8 Uniform Random Number Generators Linear Congruence Generator (LCG) Introduced by D. H. Lehmer in A great majority of pseudo-random numbers used today are based on this method. x n+1 = (ax n + b) (mod m) Example: if x 0 = 7, a = 1, b = 7, m = 10, we obtain the following sequence: 7, 4, 1, 8, 5, 2, 9, 6, 3, 0, 7, 4,

9 Uniform Random Number Generators Choice of the modulus, m. m should be as large as possible since the period can never be larger than m. One usually chooses m to be near the largest integer that can be represented. Choice of the multiplier, a It was proven by M.Greenberger in 1961 that the sequence will have period m if and only if b is a relative prime to m. a 1 is a multiple of p for all p m. 4 m 4 a 1.

10 Uniform Random Number Generators With b = 0, one cannot get the full period, but in order to get the maximum possible, the followings should be satisfied: x 0 is a relative prime to m. a is a primitive root modulo m. It is possible to obtain a period of length m 1, but usually the period is around m/4.

11 Uniform Random Number Generators A Disadvantage of LCG RANDU is a popular random number generator distributed by IBM in 1960 s with the algorithm x n+1 = 65539x n (mod 2 31 ). This generator was later found to have a serious problem all random numbers fall into hyperplanes.

12 Uniform Random Number Generators 5000 random points in 1 and 2 dimensions generated from RANDU Histogram of 5000 random numbers. Distribution of 5000 points in 2 dimensions

13 Uniform Random Number Generators 5000 random points in 3 dimensions generated from RANDU viewed at two different view points.

14 Uniform Random Number Generators LCGs in rand() in various compilers. Source a b Output bits in rand() Borland C/C Glibc (GCC) ANSI C Borland Delphi Microsoft C/C In all above compilers, m = 2 32

15 Uniform Random Number Generators Lagged-Fibonacci Generator (LFG) Lagged Fibonacci pseudo-random number generators have become increasingly popular in recent years. These generators are so named because of their similarity to the familiar Fibonacci sequence. LFG uses the algorithm x n = x n l + x n k (mod m) where l > k > 0 with m initial values {x 0, x 1,, x l 1 }.

16 Uniform Random Number Generators For most applications of interest, m is a power of two; i.e., m = 2 M. With a proper choice of l, k and the initial values, the period P of LFG is (2 l 1) 2 M 1. Two commonly used LFGs. x n = x n 17 + x n 5 (mod 2 31 ) period 2 47 x n = x n 55 + x n 24 (mod 2 31 ) period 2 85

17 Uniform Random Number Generators Unlike LCG, the value of the modulus, m, does not by itself limit the period of the generator. LFG is computationally simple: an integer add, a logical AND (to accomplish the mod 2 M operation), and the advancing of two array pointers are the only operations required to produce a new random number.

18 Random Variables and Distribution A random variable can be thought of as an unknown value that may change every time it is inspected. Thus, a random variable can be thought of as a function mapping the sample space of a random process to the real numbers. A random variable can be discrete or continuous.

19 Random Variables and Distribution Example (Discrete RV) The sample space of tossing 2 fair coins is S = {HH, HT, TH, TT}. Let X = number of heads, then X = {(HH,2), (HT,1), (TH,1), (TT,0)}.

20 Random Variables and Distribution Example (Cont d) The probability function of X is given by The mean of X is The variance of X is 1 if x = if x = 1 2 PX ( = x) = 1 if x 2 4 = 0 otherwise μ = E[ X] = x P( x ) = = 1 X i i i Var[ X] = E[( X μ ) ] = E[ X ] μ = X X 2

21 Random Variables and Distribution Example: Binomial Distribution X ~ B(n,p) n x n x PX ( = x) = x p ( 1 p) x = 0,1,, n n E[ X] = xp( x) = np x= 0 n 2 2 Var[ ] ( ) 1 x= 0 ( ) ( ) X = x P x np = np p

22 Random Variables and Distribution Example: Continuous Uniform Distribution X ~ U(a,b) 2 Var[ ] ( ) X f X 1 for a x b b a ( x) = 0 otherwise 1 2 ( ) E[ X] = xf ( x) dx = a + b X a + b 1 X = x f x dx = b a ( ) 2

23 Random Variables and Distribution Cumulative Distribution Function Example f X F ( x ) P ( X x ) f ( t ) dt X 1 for a x b b a ( x) = 0 otherwise = = x X 0 x < a x a F ( x) = fora x b X b a 1 x > b

24 Random Variables and Distribution Example: X ~ U(0,1) and Y = X 2. 0 if y < 0 ( 2 F () y = P X y) = y if0 y 1 Y 1 if y > f Y () y 1 y 2 y df () y if 0 1 Y = = y 0 otherwise

25 Random Variables and Distribution Example: X ~ U(0,1) and ( 1 X ) 2 0 if y < 0 ( 1 2 F () y = P ( X ) y) = 2 y if0 y 1 Y if y > 4 Y = 2 8 f Y () y df () y if 0 y Y = = y 0 otherwise 1 1 y

26 Random Variables and Distribution Example: X ~ U(0,1), Y ~ U(0,1), Z = X+Y. 0 if z < 0 if z z 2 = ( + ) = 2 (2 z ) < z F () z P X Y z Z 1 if if z > f Z () z df () z 1 1 z if 0 z 2 Z = = z 0 otherwise

27 Non-uniform Random Numbers Inverse CDF Method If X is a random variable having the probability density function f X (x) and the cumulative distribution function (CDF) F ( x x ) = f ( t ) dt X X then the random variable U = F X (X) is uniformly distributed on the interval [0,1]. Thus X = F 1 ( U) has the desired distribution. X

28 Non-uniform Random Numbers Example: An exponential distribution f X x λe λ for x > 0 ( x) = 0 for x 0 0 if x < 0 λx F ( x) = 1 e if 0 x 1 X 1 if x > X lnu = where U λ U(0,1)

29 Non-uniform Random Numbers Example: A triangular distribution f F X X 2 2 4x for 0 x 1 ( x) = 0 otherwise 0 if x < x if 0 x 2 ( x) = (1 x) if < x if x > 1 X if U = 1 ifu > U U where U U(0,1)

30 Non-uniform Random Numbers Simulated Result: A triangular distribution 3 N=10 4 N=10 5 N=10 6 N=10

31 Non-uniform Random Numbers Acceptance/Rejection Method X is a random variable with pdf f X (x). We want to generate a random variable Y with pdf f Y (x) and there is a constant c for which f ( x) cf ( x). Y X cf () x X f () x Y x

32 Non-uniform Random Numbers Acceptance/Rejection Algorithm Generate a random value x from X. Generate a random value u from U(0,1). f ( x) ( x) Y If u, then x is accepted. cf X Otherwise, x is rejected (and repeat with the step of the generation of x).

33 Non-uniform Random Numbers Box-Muller Method for Normal Distribution Let U ~ U(0,1) and generate u 1 and u 2 from U. Then x = cos(2 πu ) 2 ln u x = sin(2 πu ) 2 ln u are independently distributed as the standard normal distribution.

34 Central Limit Theorem Central Limit Theorem (CLT) The sum of a sufficiently large number of independent and identically distributed (i.i.d.) random variables, each with finite mean and variance, will be approximately normally distributed.

35 Central Limit Theorem Let X 1, X 2,..., X n be a sequence of n i.i.d. random variables each having finite values of expectation μ and variance σ 2 > 0. Let S n = X 1 + X X n. If we define Z then Z n N(0,1). n = X n σ nμ n

36 Central Limit Theorem Example: If a fair coin is tossed 10 6 times, and we let X = number of heads, then E[ X] = np = 500, 000 Var[ X] = np(1 p) = 250, 000 X 500, N(0,1)

37 Monte Carlo Simulation Monte Carlo simulation was named for Monte Carlo, Monaco, where the primary attractions are casinos containing games of chance. Games of chance such as roulette wheels, dice, and slot machines, exhibit random behavior. Monte Carlo simulation randomly generates values for uncertain variables over and over to simulate a model.

38 Monte Carlo Simulation Why Simulation? In some circumstances, it may not be feasible to observe the behavior directly or to conduct experiment. A system of elevators during rush hour. Automobile traffic controlling. In other situations, the system for which alternative procedures need to be tested may not even exist yet. Communication networks in an office building Locations of machines in a new industrial plant.

39 Monte Carlo Simulation In such instances, the modeler might simulate the behavior and test the various alternatives being considered to estimate how each affects the behavior. Build a scaled model. Drag force on a proposed submarine. Designs of a jet airplane. Monte Carlo simulation which is typically accomplished with the aid of a computer.

40 Monte Carlo Simulation Processes with an element of chance involved are called probabilistic, as opposed to deterministic. Behavior Probabilistic Deterministic Model Probabilistic Deterministic Monte Carlo simulation is a probabilistic model. It can also be used to approximate a deterministic behavior.

41 Monte Carlo Simulation Probabilistic Behavior: an Unfair Die Consider a probability model where each event is not equally likely. Assume a die is biased according to the following distribution. Roll value P(roll) Value of x i Assignment [0, 0.1] ONE (0.1, 0.2] TWO (0.2, 0.4] THREE (0.4, 0.7] FOUR (0.7, 0.9] FIVE (0.9, 1.0] SIX

42 Monte Carlo Simulation Expected Results Die Value

43 Monte Carlo Integration Let p be the probability of a die having a desired value. Let N be the number of total tosses, and n be the number of tosses with the desired value. E[ n] = pn Var[ n] = p(1 p) N

44 Monte Carlo Integration n ˆ, N 1 E[ pˆ ] = E[ n] = p N 1 Var[ pˆ ] = Var[ n] = 2 N If p = then Example: If p = 0.1, then p ( 1 p) N σ pˆ ( p) = Var[ pˆ ] = p 1 = 0.3 N N

45 Monte Carlo Integration Area under a curve area under curve area of rectangle number of points counted below curve total number of random points

46 Monte Carlo Integration The area under the curve y = cos x over the interval -π/2 x π/2. Number of points Approximation to area Number of points Approximation to Area

47 Monte Carlo Integration Let the area under the curve be I, while the area of the rectangle is R. Suppose that n out of N points fall under the curve, then we estimate the integral to be ˆ n I = R N There is a probability I/R that each random point will fall under the curve.

48 Monte Carlo Integration Thus, the number of random points fall under the curve will be binomially distributed. I E[ n] = N R I I Var[ n] = N 1 R R

49 Monte Carlo Integration ˆ R E[ I] = E[ n] = I N 2 I R Var[ ˆ R I] = Var[ n] = N N ( I) Example: For π/2 π/2 cos xdx, I = 2, R= π. σ Iˆ ( π ) 2 2 ˆ 1.5 = Var[ I ] = N N

50 Monte Carlo Optimization Powerful applications of Monte Carlo simulation lie in numerical optimization. There are many Monte Carlo optimization methods including Genetic Algorithm and Simulated Annealing. The method is relatively simple, but can effectively solve many famous complex problems.

51 Monte Carlo Optimization Simulated Annealing Simulated annealing is an analogy with thermodynamics when liquids freeze and crystallize, or metals cool and anneal. At high temperatures, the molecules of liquids move freely. If the liquid is cooled slowly, thermal mobility is lost. Atoms line up to form a pure crystal, which is the state of minimum energy.

52 Monte Carlo Optimization If the liquid is cooled quickly or quenched, it will not reach the ground state but ends up in some other states having somewhat higher energy. The essence of the process is slow cooling, allowing ample time for redistribution of the atoms as they lose mobility. This is the technical definition of annealing.

53 Monte Carlo Optimization A system in thermal equilibrium at temperature T has its energy probabilistically distributed among all different energy states E according to the Boltzman distribution: PE ( ) e E/ kt where k is the Boltzman s constant.

54 Monte Carlo Optimization At low temperatures, the system can still be in a high energy state with a small probability. This allow the system to get out of a local minimum in favor of finding a better, more global, one. As the temperature is lowered, the system will be less likely to be in a higher energy state.

55 Monte Carlo Optimization In 1953, Metropolis et al propose that a system will change its configuration from energy E 1 to energy E 2 with probability PE ( 1 E2) = 1 if E < E ( E2 E1)/ kt e if E E This general scheme is known as the Metropolis algorithm.

56 Monte Carlo Optimization To make use of the Metropolis algorithm in general systems, we must provide: Possible system configurations. Random changes in the configuration An objective function E to be minimized. A control parameter T and an annealing schedule. Could be accomplished with a physical insight or an trial-and-error experiments.

57 Monte Carlo Optimization The Traveling Salesman Problem A salesman visits N cities with given positions (x i,y i ), finally returning to the city of origin. Each city is to be visited only once, and the route is to be made as short as possible. The cities are number i = 1, 2,, N.

58 Monte Carlo Optimization Configuration: A configuration is the order in which the cities are visited; thus, it is a permutation of 1, 2,, N. Rearrangments: An efficient suggested moves are done by Reversal: A section of path is removed and replaced with the same cities in opposite order. Transport: A section of path is removed and replaced in between two cities on another randomly chosen part of the path.

59 Monte Carlo Optimization Objective Function: E is just the total length of journey N i= 1 ( ) ( ) 2 2 i i+ 1 i i+ 1 E = x x + y y where the city N+1 is just the city 1.

60 Monte Carlo Optimization Annealing Schedule: Require some experiments. First generate some random rearrangements to determine the range of ΔE, then proceed in multiplicative steps each amounting to a 10% decrease in T. Hold a new T for 100N reconfiguration or 10N successful reconfiguration, whichever comes first. Until efforts to reduce E further becomes discouraging.

2008 Winton. Review of Statistical Terminology

2008 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 information

Review of Statistical Terminology

Review 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 information

How does the computer generate observations from various distributions specified after input analysis?

How 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 information

Statistics, Data Analysis, and Simulation SS 2013

Statistics, Data Analysis, and Simulation SS 2013 Mainz, May 2, 2013 Statistics, Data Analysis, and Simulation SS 2013 08.128.730 Statistik, Datenanalyse und Simulation Dr. Michael O. Distler 2. Random Numbers 2.1 Why random numbers:

More information

Lecture 20. Randomness and Monte Carlo. J. Chaudhry. Department of Mathematics and Statistics University of New Mexico

Lecture 20. Randomness and Monte Carlo. J. Chaudhry. Department of Mathematics and Statistics University of New Mexico Lecture 20 Randomness and Monte Carlo J. Chaudhry Department of Mathematics and Statistics University of New Mexico J. Chaudhry (UNM) CS 357 1 / 40 What we ll do: Random number generators Monte-Carlo integration

More information

CPSC 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 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 information

( x) ( ) F ( ) ( ) ( ) Prob( ) ( ) ( ) X x F x f s ds

( x) ( ) F ( ) ( ) ( ) Prob( ) ( ) ( ) X x F x f s ds Applied Numerical Analysis Pseudo Random Number Generator Lecturer: Emad Fatemizadeh What is random number: A sequence in which each term is unpredictable 29, 95, 11, 60, 22 Application: Monte Carlo Simulations

More information

2 Random Variable Generation

2 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 information

Random Number Generation. CS1538: Introduction to simulations

Random 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 information

How does the computer generate observations from various distributions specified after input analysis?

How 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 information

Random processes and probability distributions. Phys 420/580 Lecture 20

Random 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 information

System Simulation Part II: Mathematical and Statistical Models Chapter 5: Statistical Models

System Simulation Part II: Mathematical and Statistical Models Chapter 5: Statistical Models System Simulation Part II: Mathematical and Statistical Models Chapter 5: Statistical Models Fatih Cavdur fatihcavdur@uludag.edu.tr March 20, 2012 Introduction Introduction The world of the model-builder

More information

( ) ( ) Monte Carlo Methods Interested in. E f X = f x d x. Examples:

( ) ( ) 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 information

Random numbers and generators

Random numbers and generators Chapter 2 Random numbers and generators Random numbers can be generated experimentally, like throwing dice or from radioactive decay measurements. In numerical calculations one needs, however, huge set

More information

A simple algorithm that will generate a sequence of integers between 0 and m is:

A simple algorithm that will generate a sequence of integers between 0 and m is: Using the Pseudo-Random Number generator Generating random numbers is a useful technique in many numerical applications in Physics. This is because many phenomena in physics are random, and algorithms

More information

MATH Notebook 5 Fall 2018/2019

MATH Notebook 5 Fall 2018/2019 MATH442601 2 Notebook 5 Fall 2018/2019 prepared by Professor Jenny Baglivo c Copyright 2004-2019 by Jenny A. Baglivo. All Rights Reserved. 5 MATH442601 2 Notebook 5 3 5.1 Sequences of IID Random Variables.............................

More information

Topics in Computer Mathematics

Topics 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 information

STAT2201. Analysis of Engineering & Scientific Data. Unit 3

STAT2201. Analysis of Engineering & Scientific Data. Unit 3 STAT2201 Analysis of Engineering & Scientific Data Unit 3 Slava Vaisman The University of Queensland School of Mathematics and Physics What we learned in Unit 2 (1) We defined a sample space of a random

More information

Independent 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 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 information

Slides 3: Random Numbers

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 information

Computer Applications for Engineers ET 601

Computer 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 information

Monte Carlo Techniques

Monte 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 information

Class 12. Random Numbers

Class 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 information

Random Number Generation. Stephen Booth David Henty

Random 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 information

IE 581 Introduction to Stochastic Simulation. One page of notes, front and back. Closed book. 50 minutes. Score

IE 581 Introduction to Stochastic Simulation. One page of notes, front and back. Closed book. 50 minutes. Score One page of notes, front and back. Closed book. 50 minutes. Score Schmeiser Page 1 of 4 Test #1, Spring 2001 1. True or false. (If you wish, write an explanation of your thinking.) (a) T Data are "binary"

More information

Monte Carlo. Lecture 15 4/9/18. Harvard SEAS AP 275 Atomistic Modeling of Materials Boris Kozinsky

Monte Carlo. Lecture 15 4/9/18. Harvard SEAS AP 275 Atomistic Modeling of Materials Boris Kozinsky Monte Carlo Lecture 15 4/9/18 1 Sampling with dynamics In Molecular Dynamics we simulate evolution of a system over time according to Newton s equations, conserving energy Averages (thermodynamic properties)

More information

Stochastic Simulation of

Stochastic 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 information

Optimization Methods via Simulation

Optimization Methods via Simulation Optimization Methods via Simulation Optimization problems are very important in science, engineering, industry,. Examples: Traveling salesman problem Circuit-board design Car-Parrinello ab initio MD Protein

More information

Stochastic Simulation of Communication Networks

Stochastic 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 information

Course: ESO-209 Home Work: 1 Instructor: Debasis Kundu

Course: ESO-209 Home Work: 1 Instructor: Debasis Kundu Home Work: 1 1. Describe the sample space when a coin is tossed (a) once, (b) three times, (c) n times, (d) an infinite number of times. 2. A coin is tossed until for the first time the same result appear

More information

B. Maddah ENMG 622 Simulation 11/11/08

B. 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 information

Random Number Generators

Random 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 information

Uniform Random Number Generators

Uniform 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 information

A Probability Primer. A random walk down a probabilistic path leading to some stochastic thoughts on chance events and uncertain outcomes.

A Probability Primer. A random walk down a probabilistic path leading to some stochastic thoughts on chance events and uncertain outcomes. A Probability Primer A random walk down a probabilistic path leading to some stochastic thoughts on chance events and uncertain outcomes. Are you holding all the cards?? Random Events A random event, E,

More information

Chapter 3 Single Random Variables and Probability Distributions (Part 1)

Chapter 3 Single Random Variables and Probability Distributions (Part 1) Chapter 3 Single Random Variables and Probability Distributions (Part 1) Contents What is a Random Variable? Probability Distribution Functions Cumulative Distribution Function Probability Density Function

More information

Chapter 3, 4 Random Variables ENCS Probability and Stochastic Processes. Concordia University

Chapter 3, 4 Random Variables ENCS Probability and Stochastic Processes. Concordia University Chapter 3, 4 Random Variables ENCS6161 - Probability and Stochastic Processes Concordia University ENCS6161 p.1/47 The Notion of a Random Variable A random variable X is a function that assigns a real

More information

This does not cover everything on the final. Look at the posted practice problems for other topics.

This does not cover everything on the final. Look at the posted practice problems for other topics. Class 7: Review Problems for Final Exam 8.5 Spring 7 This does not cover everything on the final. Look at the posted practice problems for other topics. To save time in class: set up, but do not carry

More information

Hands-on Generating Random

Hands-on Generating Random CVIP Laboratory Hands-on Generating Random Variables Shireen Elhabian Aly Farag October 2007 The heart of Monte Carlo simulation for statistical inference. Generate synthetic data to test our algorithms,

More information

System Simulation Part II: Mathematical and Statistical Models Chapter 5: Statistical Models

System Simulation Part II: Mathematical and Statistical Models Chapter 5: Statistical Models System Simulation Part II: Mathematical and Statistical Models Chapter 5: Statistical Models Fatih Cavdur fatihcavdur@uludag.edu.tr March 29, 2014 Introduction Introduction The world of the model-builder

More information

UNIT 5:Random number generation And Variation Generation

UNIT 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 information

Discrete Random Variables

Discrete Random Variables CPSC 53 Systems Modeling and Simulation Discrete Random Variables Dr. Anirban Mahanti Department of Computer Science University of Calgary mahanti@cpsc.ucalgary.ca Random Variables A random variable is

More information

Uniform random numbers generators

Uniform random numbers generators Uniform random numbers generators Lecturer: Dmitri A. Moltchanov E-mail: moltchan@cs.tut.fi http://www.cs.tut.fi/kurssit/tlt-2707/ OUTLINE: The need for random numbers; Basic steps in generation; Uniformly

More information

Chapter 2: Random Variables

Chapter 2: Random Variables ECE54: Stochastic Signals and Systems Fall 28 Lecture 2 - September 3, 28 Dr. Salim El Rouayheb Scribe: Peiwen Tian, Lu Liu, Ghadir Ayache Chapter 2: Random Variables Example. Tossing a fair coin twice:

More information

Physics 403 Probability Distributions II: More Properties of PDFs and PMFs

Physics 403 Probability Distributions II: More Properties of PDFs and PMFs Physics 403 Probability Distributions II: More Properties of PDFs and PMFs Segev BenZvi Department of Physics and Astronomy University of Rochester Table of Contents 1 Last Time: Common Probability Distributions

More information

Recitation 2: Probability

Recitation 2: Probability Recitation 2: Probability Colin White, Kenny Marino January 23, 2018 Outline Facts about sets Definitions and facts about probability Random Variables and Joint Distributions Characteristics of distributions

More information

6.1 Randomness: quantifying uncertainty

6.1 Randomness: quantifying uncertainty 6.1 Randomness: quantifying uncertainty The concepts of uncertainty and randomness have intrigued humanity for a long time. The world around us is not deterministic and we are faced continually with chance

More information

ECE Lecture 4. Overview Simulation & MATLAB

ECE Lecture 4. Overview Simulation & MATLAB ECE 450 - Lecture 4 Overview Simulation & MATLAB Random Variables: Concept and Definition Cumulative Distribution Functions (CDF s) Eamples & Properties Probability Distribution Functions (pdf s) 1 Random

More information

IE 581 Introduction to Stochastic Simulation. One page of notes, front and back. Closed book. 50 minutes. Score

IE 581 Introduction to Stochastic Simulation. One page of notes, front and back. Closed book. 50 minutes. Score One page of notes, front and back. Closed book. 50 minutes. Score Schmeiser Page 1 of 4 Test #1, Spring 2001 1. True or false. (If you wish, write an explanation of your thinking.) (a) T F Data are "binary"

More information

Simulation Modeling. Random Numbers

Simulation Modeling. Random Numbers Mathematical Modeling Lia Vas Simulation Modeling. Random Numbers In many cases one of the following situations might occur: - It is not possible to observe the behavior directly or to conduct experiments.

More information

Random Variables and Their Distributions

Random Variables and Their Distributions Chapter 3 Random Variables and Their Distributions A random variable (r.v.) is a function that assigns one and only one numerical value to each simple event in an experiment. We will denote r.vs by capital

More information

The probability of an event is viewed as a numerical measure of the chance that the event will occur.

The probability of an event is viewed as a numerical measure of the chance that the event will occur. Chapter 5 This chapter introduces probability to quantify randomness. Section 5.1: How Can Probability Quantify Randomness? The probability of an event is viewed as a numerical measure of the chance that

More information

Midterm Exam 1 Solution

Midterm Exam 1 Solution EECS 126 Probability and Random Processes University of California, Berkeley: Fall 2015 Kannan Ramchandran September 22, 2015 Midterm Exam 1 Solution Last name First name SID Name of student on your left:

More information

Northwestern University Department of Electrical Engineering and Computer Science

Northwestern University Department of Electrical Engineering and Computer Science Northwestern University Department of Electrical Engineering and Computer Science EECS 454: Modeling and Analysis of Communication Networks Spring 2008 Probability Review As discussed in Lecture 1, probability

More information

1.1 Review of Probability Theory

1.1 Review of Probability Theory 1.1 Review of Probability Theory Angela Peace Biomathemtics II MATH 5355 Spring 2017 Lecture notes follow: Allen, Linda JS. An introduction to stochastic processes with applications to biology. CRC Press,

More information

4.5 Applications of Congruences

4.5 Applications of Congruences 4.5 Applications of Congruences 287 66. Find all solutions of the congruence x 2 16 (mod 105). [Hint: Find the solutions of this congruence modulo 3, modulo 5, and modulo 7, and then use the Chinese remainder

More information

Numerical Methods I Monte Carlo Methods

Numerical Methods I Monte Carlo Methods Numerical Methods I Monte Carlo Methods Aleksandar Donev Courant Institute, NYU 1 donev@courant.nyu.edu 1 Course G63.2010.001 / G22.2420-001, Fall 2010 Dec. 9th, 2010 A. Donev (Courant Institute) Lecture

More information

Probability and Distributions

Probability and Distributions Probability and Distributions What is a statistical model? A statistical model is a set of assumptions by which the hypothetical population distribution of data is inferred. It is typically postulated

More information

ELEG 3143 Probability & Stochastic Process Ch. 2 Discrete Random Variables

ELEG 3143 Probability & Stochastic Process Ch. 2 Discrete Random Variables Department of Electrical Engineering University of Arkansas ELEG 3143 Probability & Stochastic Process Ch. 2 Discrete Random Variables Dr. Jingxian Wu wuj@uark.edu OUTLINE 2 Random Variable Discrete Random

More information

Lecture Notes 1 Probability and Random Variables. Conditional Probability and Independence. Functions of a Random Variable

Lecture Notes 1 Probability and Random Variables. Conditional Probability and Independence. Functions of a Random Variable Lecture Notes 1 Probability and Random Variables Probability Spaces Conditional Probability and Independence Random Variables Functions of a Random Variable Generation of a Random Variable Jointly Distributed

More information

Workshop 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 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 information

Outline PMF, CDF and PDF Mean, Variance and Percentiles Some Common Distributions. Week 5 Random Variables and Their Distributions

Outline PMF, CDF and PDF Mean, Variance and Percentiles Some Common Distributions. Week 5 Random Variables and Their Distributions Week 5 Random Variables and Their Distributions Week 5 Objectives This week we give more general definitions of mean value, variance and percentiles, and introduce the first probability models for discrete

More information

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

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 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 information

B.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 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 information

Random variables. DS GA 1002 Probability and Statistics for Data Science.

Random variables. DS GA 1002 Probability and Statistics for Data Science. Random variables DS GA 1002 Probability and Statistics for Data Science http://www.cims.nyu.edu/~cfgranda/pages/dsga1002_fall17 Carlos Fernandez-Granda Motivation Random variables model numerical quantities

More information

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 12. Random Variables: Distribution and Expectation

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 12. Random Variables: Distribution and Expectation CS 70 Discrete Mathematics and Probability Theory Fall 203 Vazirani Note 2 Random Variables: Distribution and Expectation We will now return once again to the question of how many heads in a typical sequence

More information

Decision making and problem solving Lecture 1. Review of basic probability Monte Carlo simulation

Decision making and problem solving Lecture 1. Review of basic probability Monte Carlo simulation Decision making and problem solving Lecture 1 Review of basic probability Monte Carlo simulation Why probabilities? Most decisions involve uncertainties Probability theory provides a rigorous framework

More information

EECS 126 Probability and Random Processes University of California, Berkeley: Spring 2015 Abhay Parekh February 17, 2015.

EECS 126 Probability and Random Processes University of California, Berkeley: Spring 2015 Abhay Parekh February 17, 2015. EECS 126 Probability and Random Processes University of California, Berkeley: Spring 2015 Abhay Parekh February 17, 2015 Midterm Exam Last name First name SID Rules. You have 80 mins (5:10pm - 6:30pm)

More information

Discrete Mathematics and Probability Theory Fall 2012 Vazirani Note 14. Random Variables: Distribution and Expectation

Discrete Mathematics and Probability Theory Fall 2012 Vazirani Note 14. Random Variables: Distribution and Expectation CS 70 Discrete Mathematics and Probability Theory Fall 202 Vazirani Note 4 Random Variables: Distribution and Expectation Random Variables Question: The homeworks of 20 students are collected in, randomly

More information

Random Number Generators - a brief assessment of those available

Random Number Generators - a brief assessment of those available Random Number Generators - a brief assessment of those available Anna Mills March 30, 2003 1 Introduction Nothing in nature is random...a thing appears random only through the incompleteness of our knowledge.

More information

Analysis of Engineering and Scientific Data. Semester

Analysis of Engineering and Scientific Data. Semester Analysis of Engineering and Scientific Data Semester 1 2019 Sabrina Streipert s.streipert@uq.edu.au Example: Draw a random number from the interval of real numbers [1, 3]. Let X represent the number. Each

More information

Tae-Soo Kim and Young-Kyun Yang

Tae-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

Lecture 8: Continuous random variables, expectation and variance

Lecture 8: Continuous random variables, expectation and variance Lecture 8: Continuous random variables, expectation and variance Lejla Batina Institute for Computing and Information Sciences Digital Security Version: autumn 2013 Lejla Batina Version: autumn 2013 Wiskunde

More information

Simulated Annealing for Constrained Global Optimization

Simulated Annealing for Constrained Global Optimization Monte Carlo Methods for Computation and Optimization Final Presentation Simulated Annealing for Constrained Global Optimization H. Edwin Romeijn & Robert L.Smith (1994) Presented by Ariel Schwartz Objective

More information

THE QUEEN S UNIVERSITY OF BELFAST

THE QUEEN S UNIVERSITY OF BELFAST THE QUEEN S UNIVERSITY OF BELFAST 0SOR20 Level 2 Examination Statistics and Operational Research 20 Probability and Distribution Theory Wednesday 4 August 2002 2.30 pm 5.30 pm Examiners { Professor R M

More information

Statistical Methods in Particle Physics

Statistical Methods in Particle Physics Statistical Methods in Particle Physics Lecture 3 October 29, 2012 Silvia Masciocchi, GSI Darmstadt s.masciocchi@gsi.de Winter Semester 2012 / 13 Outline Reminder: Probability density function Cumulative

More information

Queueing Theory and Simulation. Introduction

Queueing Theory and Simulation. Introduction Queueing Theory and Simulation Based on the slides of Dr. Dharma P. Agrawal, University of Cincinnati and Dr. Hiroyuki Ohsaki Graduate School of Information Science & Technology, Osaka University, Japan

More information

Class 8 Review Problems 18.05, Spring 2014

Class 8 Review Problems 18.05, Spring 2014 1 Counting and Probability Class 8 Review Problems 18.05, Spring 2014 1. (a) How many ways can you arrange the letters in the word STATISTICS? (e.g. SSSTTTIIAC counts as one arrangement.) (b) If all arrangements

More information

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Note 15. Random Variables: Distributions, Independence, and Expectations

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Note 15. Random Variables: Distributions, Independence, and Expectations EECS 70 Discrete Mathematics and Probability Theory Fall 204 Anant Sahai Note 5 Random Variables: Distributions, Independence, and Expectations In the last note, we saw how useful it is to have a way of

More information

Discrete Distributions

Discrete Distributions A simplest example of random experiment is a coin-tossing, formally called Bernoulli trial. It happens to be the case that many useful distributions are built upon this simplest form of experiment, whose

More information

1 Review of Probability

1 Review of Probability 1 Review of Probability Random variables are denoted by X, Y, Z, etc. The cumulative distribution function (c.d.f.) of a random variable X is denoted by F (x) = P (X x), < x

More information

Discrete Structures for Computer Science

Discrete Structures for Computer Science Discrete Structures for Computer Science William Garrison bill@cs.pitt.edu 6311 Sennott Square Lecture #24: Probability Theory Based on materials developed by Dr. Adam Lee Not all events are equally likely

More information

Lecture Notes 1 Probability and Random Variables. Conditional Probability and Independence. Functions of a Random Variable

Lecture Notes 1 Probability and Random Variables. Conditional Probability and Independence. Functions of a Random Variable Lecture Notes 1 Probability and Random Variables Probability Spaces Conditional Probability and Independence Random Variables Functions of a Random Variable Generation of a Random Variable Jointly Distributed

More information

1 Probability theory. 2 Random variables and probability theory.

1 Probability theory. 2 Random variables and probability theory. Probability theory Here we summarize some of the probability theory we need. If this is totally unfamiliar to you, you should look at one of the sources given in the readings. In essence, for the major

More information

14 Random Variables and Simulation

14 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 information

Lecture Notes 2 Random Variables. Discrete Random Variables: Probability mass function (pmf)

Lecture Notes 2 Random Variables. Discrete Random Variables: Probability mass function (pmf) Lecture Notes 2 Random Variables Definition Discrete Random Variables: Probability mass function (pmf) Continuous Random Variables: Probability density function (pdf) Mean and Variance Cumulative Distribution

More information

1 Presessional Probability

1 Presessional Probability 1 Presessional Probability Probability theory is essential for the development of mathematical models in finance, because of the randomness nature of price fluctuations in the markets. This presessional

More information

STAT 516 Midterm Exam 2 Friday, March 7, 2008

STAT 516 Midterm Exam 2 Friday, March 7, 2008 STAT 516 Midterm Exam 2 Friday, March 7, 2008 Name Purdue student ID (10 digits) 1. The testing booklet contains 8 questions. 2. Permitted Texas Instruments calculators: BA-35 BA II Plus BA II Plus Professional

More information

FINAL EXAM: Monday 8-10am

FINAL EXAM: Monday 8-10am ECE 30: Probabilistic Methods in Electrical and Computer Engineering Fall 016 Instructor: Prof. A. R. Reibman FINAL EXAM: Monday 8-10am Fall 016, TTh 3-4:15pm (December 1, 016) This is a closed book exam.

More information

DRAFT. Mathematical Methods 2017 Sample paper. Question Booklet 1

DRAFT. Mathematical Methods 2017 Sample paper. Question Booklet 1 1 South Australian Certificate of Education Mathematical Methods 017 Sample paper Question Booklet 1 Part 1 Questions 1 to 10 Answer all questions in Part 1 Write your answers in this question booklet

More information

Sampling Random Variables

Sampling Random Variables Sampling Random Variables Introduction Sampling a random variable X means generating a domain value x X in such a way that the probability of generating x is in accordance with p(x) (respectively, f(x)),

More information

ISE/OR 762 Stochastic Simulation Techniques

ISE/OR 762 Stochastic Simulation Techniques ISE/OR 762 Stochastic Simulation Techniques Topic 0: Introduction to Discrete Event Simulation Yunan Liu Department of Industrial and Systems Engineering NC State University January 9, 2018 Yunan Liu (NC

More information

Chapter 2 Queueing Theory and Simulation

Chapter 2 Queueing Theory and Simulation Chapter 2 Queueing Theory and Simulation Based on the slides of Dr. Dharma P. Agrawal, University of Cincinnati and Dr. Hiroyuki Ohsaki Graduate School of Information Science & Technology, Osaka University,

More information

Preliminary statistics

Preliminary statistics 1 Preliminary statistics The solution of a geophysical inverse problem can be obtained by a combination of information from observed data, the theoretical relation between data and earth parameters (models),

More information

functions Poisson distribution Normal distribution Arbitrary functions

functions Poisson distribution Normal distribution Arbitrary functions Physics 433: Computational Physics Lecture 6 Random number distributions Generation of random numbers of various distribuition functions Normal distribution Poisson distribution Arbitrary functions Random

More information

M378K In-Class Assignment #1

M378K In-Class Assignment #1 The following problems are a review of M6K. M7K In-Class Assignment # Problem.. Complete the definition of mutual exclusivity of events below: Events A, B Ω are said to be mutually exclusive if A B =.

More information

Example continued. Math 425 Intro to Probability Lecture 37. Example continued. Example

Example continued. Math 425 Intro to Probability Lecture 37. Example continued. Example continued : Coin tossing Math 425 Intro to Probability Lecture 37 Kenneth Harris kaharri@umich.edu Department of Mathematics University of Michigan April 8, 2009 Consider a Bernoulli trials process with

More information

Probability Models. 4. What is the definition of the expectation of a discrete random variable?

Probability Models. 4. What is the definition of the expectation of a discrete random variable? 1 Probability Models The list of questions below is provided in order to help you to prepare for the test and exam. It reflects only the theoretical part of the course. You should expect the questions

More information

Simulation. Where real stuff starts

Simulation. 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 information

Generating Random Variables

Generating 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 information

CS 361: Probability & Statistics

CS 361: Probability & Statistics February 19, 2018 CS 361: Probability & Statistics Random variables Markov s inequality This theorem says that for any random variable X and any value a, we have A random variable is unlikely to have an

More information