Simulation. Version 1.1 c 2010, 2009, 2001 José Fernando Oliveira Maria Antónia Carravilla FEUP

Size: px
Start display at page:

Download "Simulation. Version 1.1 c 2010, 2009, 2001 José Fernando Oliveira Maria Antónia Carravilla FEUP"

Transcription

1 Simulation Version 1.1 c 2010, 2009, 2001 José Fernando Oliveira Maria Antónia Carravilla FEUP

2 Systems - why simulate? System any object or entity on which a particular study is run. Model representation of the object or entity on which the study will be actually performed. Experiments on the system itself, stimulating and recording the observed changes in the parameters that define its state more reliable results. Systems too large, not directly accessible or ethically experiential experimentation on a model: simulation. The best thing you can do, after watch the real system in operation, is to make a simulation of that system.

3 Model types Scale models the system is replaced by a scaled version of the system itself. Conceptual models the system is replaced by a conceptual version of its operation: a certain set of mathematical equations or cause-effect relationships. Modelos de escala Sistema Modelos conceptuais Contínuos Estatísticos Discretos

4 Conceptual models Better than scale modelos because: more transportable; much more versatile, allowing for easier changes in its structure; implementable with a computer! Types of conceptual models: Deterministic: Continuous the system states vary continuously with the independent variable. Discrete the system can only be at a finite number of states, changing instantly from one state to another. Statistical the system state does not depend deterministically on the input variables but its response is random and characterized by a set of probability distributions.

5 Simulation with continuous models (continuous simulation) In a continuous simulation model the state Y of a system depends continuously on the independent variable x, being this relationship governed by equations (possibly differential equations) knowledge of Y = E(x). Example: simulation of the speed of a bus, since it starts until it stops again. System bus Vel System state velocity fm(t) Independent variable time 0, t 0 < t < t 1 fa(t) MOVIMENTO fa(t), t 1 t < t 2 E(t) = PARADO fm(t), t 2 t < t 3 fp(t), t 3 t < t t0 t1 t2 t3 t4 4 fp(t) PARADO t

6 Simulation with statistical models (Statistical simulation or Stochastic simulation or Monte Carlo simulation) We don t deal with a model describing the system complex relationships. Instead, we deal with a set of probability functions that characterize the system behavior. Example: System = Dice Deterministic simulation writing the equations governing the movement of a solid, having as parameters the initial velocity, the angle with which it is thrown, the friction offered by the table, etc.. Statistical simulation sampling the probability function that gives the probability of, at any trial, the result being a given face.

7 Monte Carlo simulation Physicists at Los Alamos Scientific Laboratory were investigating radiation shielding and the distance that neutrons would likely travel through various materials. Despite having most of the necessary data, such as the average distance a neutron would travel in a substance before it collided with an atomic nucleus or how much energy the neutron was likely to give off following a collision, the problem could not be solved with theoretical calculations. John von Neumann and Stanislaw Ulam suggested that the problem be solved by modeling the experiment on a computer using chance. Being secret, their work required a code name. Von Neumann chose the name Monte Carlo. The name is a reference to the Monte Carlo Casino in Monaco where Ulam s uncle would borrow money to gamble. in http: // en. wikipedia. org/ wiki/ Monte_ Carlo_ method

8 Estimation of the area of a circle Estimate the area of the circle given by the following equation: (x 1) 2 + (y 2) 2 = 25 i.e, a circle with radius 5 e and center (x, y) = (1, 2). Procedure: fit the circle in a square of side equal to the diameter of the circle; build a generator of random points of the square, which should occur with equal probability; then, if in a random sample of n points, m are inside the circle: Area of the circle m n Area of the square = m n (10 10)

9 Estimation of the area of a circle We can get points inside the square with equal probability by representing the coordinates x and y of any point of the square by the following distributions: f(x) = 1 10, 4 x 6 g(y) = 1 10, 3 y 7 Let R 1 and R 2 be two random numbers between 0 and 1. Then, a point (x, y) inside the square will be given by: x = 4 + [6 ( 4)]R 1 = R 1 y = 3 + [7 ( 3)]R 2 = R 2 Finally, a random point (x, y ) is inside the circle if: (x 1) 2 + (y 2) 2 25

10 Random numbers A number is said to be random if its occurrence in a sequence of numbers is unpredictable from any past occurrences and if it has the same probability of occurring over a predefined range of values. Truly random phenomena: radioactive noise, background noise in electronic components, etc.. (all physical systems). With computers we can only generate pseudo-random sequences: Use of an iterative process, performed on a mathematical expression, that based on the previous number computes the following one n i+1 = f(n i ) so that the relationship between the two is as unpredictable as possible within a large range of values.

11 Pseudo-random numbers n i+1 = f(n i ) Disadvantage Once one of the numbers is repeated all the sequence repeats itself. Advantage It is possible to exactly duplicate and replicate a sequence of random numbers: important for the detection and correction of mistakes and bugs, and the validation and verification of a simulation model. Different functions f(n i ) Different methods to generate the pseudo-random numbers.

12 Pseudo-random numbers generation Most common method: Multiplicative congruential method n i+1 = (b n i + c)mod(m) em que: mod stands for the remainder of the integer division; m the largest number that can be generated (exclusive); b e c formula parameters; the first value used in the sequence, n 0, is called the seed of the generator. Concrete values for the generation of 16-bits and 32-bits integers, respectively: f(n i ) = (3993n i + 1)mod(32767) f(n i ) = (16807n i + 0)mod( ) To generate a value between 0 e 1 it is enough to divide n i+1 by m: R i+1 = n i+1 m

13 Why is this a statistical simulation model? Monte-Carlo simulation model Inputs Circle radius and center Random points (x0,y0) Computation In/Out Outcome Outputs Estimate of the circle area For the same input we may (will) have different outputs. And if the random points have to follow a non-uniform probability function? histograms (discrete) Probability functions sampling distributions (continuous)

14 Construction of histograms from experimental data Observed variable: number of cars that enter in a minute on a given street. 11 samples were taken: 17, 20, 12, 17, 17, 10, 17, 20, 11, 12, 17 Data classification: N. of cars Total Percentage Cumulative (per min) cars H(x) percentage F (x) = = = = = H(x) F(x) 0,5 1,0 0,4 0,8 0,3 0,6 0,2 0,4 0,1 0,2 0, ,

15 Histogram sampling From a random number u i, belonging to the interval [0, 1], get one of the x values, according to the probabilities induced by the histogram. F(x) 1,0 u i 0,8 0,6 0,4 0,2 0, Assumption: the sequence of (pseudo-)random numbers reflects a constant probability distribution.

16 Production line maintenance A factory has a production line that works 24 hours a day, 360 days a year. This production line generates an added value of 500 euros per hour. Sometimes the line has faults needing repair. Detailed historical data showed that the number of operating hours between failures has the following probability distribution: N. of hours Probability N. of hours Probability The average operating time (between failures) is therefore of hours.

17 Production line maintenance After a breakdown the time required for repair is also variable. If the repair time exceeds 3 days, then a replacement unit can be obtained under the guarantee contract, to restore the factory in operation. As this takes one day, in the worst case the repair time will be 4 days. The probability distribution for repair time is given by the following table: Repair time (hours) Probability The average repair time is 60 hours. We are assuming a repair time multiple of 24 hours.

18 Production line maintenance histogram sampling Cumulative probability histograms Operating time between failures F(x) Repair time F(x) 1,0 0,9 0,8 0,7 0,6 0,5 0,4 0,3 0,2 0,1 0, Nº de horas ,0 0,9 0,8 0,7 0,6 0,5 0,4 0,3 0,2 0,1 0, Tempo de reparação

19 Production line maintenance results from a simulation run of size 10 Trial Operating Repair Total % of wasted Failures Total cost ( ) time time time time (TP) 8640h TT ( ( ) (hours) (TR) (TT) TR TT % TP) % % % % % % % % % % Médias %

20 Inverse transform sampling When the probability distribution is given in an analytical form P (x) and x varies continuously in the given range. P (x) origin: fitness to experimental values or a priori knowledge of the stochastic parameters of the model e.g. they follow a normal distribution, or a negative exponential distribution, etc. Fitting a continuous distribution to the experimental distribution of the number of cars: Probability function (approximated) P(x) Cumulative probability function F(x) 0,5 0,5 0,4 0,4 0,3 0,3 0,2 0,2 0,1 0,1 0, Nº de carros 1,0 0,9 0,8 0,7 0,6 0,5 0,4 0,3 0,2 0,1 0, Nº de carros Being known the analytic expression of F (x), we can find a value of x for a given u i [0, 1] by using F (x) inverse: x = F 1 (u i ).

21 Typical distributions sampling 1. Uniform distribution 1/(b-a) P(x) F (x) = = x 1 a b a dx 1 (x a) b a F 1 (x) = (b a)x + a a b x P (x) = 1 b a, a x b x = (b a)u i + a (with u i uniformly distributed over the interval [0,1])

22 Typical distributions sampling 2. Negative exponential distribution P(x) P (x) = λe λx, x > 0 x F (x) = x 0 λe λx dx = 1 e λx F 1 ln(1 x) (x) = λ x = ln(1 u i) λ (with u i uniformly distributed over the interval [0,1])

23 Typical distributions sampling 3. Normal distribution F (x) = 1 2π x e (x µ)2 2σ 2 dx 1 2 P(x) P (x) = 1 (x µ) 2 2π e 2σ 2 x there is no analytical way of computing this integral computing the integral, and necessarily F 1 (x), using numeric methods Box and Muller method x = 2 ln u i cos(2πv i ) (with u i and v i uniformly distributed over the interval [0,1] and x N(0, 1)) To generate a variable z N(µ, σ 2 ): z = µ + σx

24 Distribution sampling convolution method Idea: express the desired sample as a statistical sum (convolution) of samples from other distributions that are easier to sample.

25 Poisson distribution X Number of occurrences per time unit or period t. P (X = k) = e λ t (λ t) k k! com k = 0, 1,..., n Discrete distribution that describes the occurrence of random phenomena along time. t has to fulfill a few conditions (check Probability Theory bibliography). λ is the average number of occurrences per time unit t.

26 Sampling a Poisson distribution It is known that the time t between successive occurrences of a Poisson process with parameter λ (number of occurrences per unit time) follows a negative exponential distribution, also with parameter λ. From the negative exponential distribution we generate a sequence t i and count how many occurrences fit in successive intervals t: t t t t 1 t 2 t 3 t 4 t 5 t 6 t 7 t 8 t 9 t 10 t 11 X=3 X=2 X=5 t

27 Getting results with a simulation model the circle area estimation case How many times should I repeat the random sampling to have a good estimate of the circle area? For sample sizes 78 varying between Área n = 100 and n = 10000, the experience was replicated 10 times 70 for each n, in each replicate being used a different sequence Tamanho da amostra (n) of random numbers. Área exacta Réplica 1 Réplica 2 Média (10 réplicas) Desvio-padrão (10 réplicas) Results of 2 replicas and mean and standard deviation of the 10 replicates.

28 The circle area estimation case conclusions The estimate of the circle area improves as the sample size increases. The average of the 10 replicates for each sample size n gives a better estimate than each of the individual replicas. The precision of the average value of the 10 replicas increases with the sample size n, as is clearly shown by the decrease of the standard deviation.

29 Getting results with a simulation model the production line maintenance case Results for different simulations (average values): Simulation size % of wasted time N. of breakdowns per year Annual cost % % What confidence can I have on the results of a simulation? How large must my sample be (number of attempts and/or replicas) so that the simulation results are reliable? As simulation runs deliver results with random variations, it is essential to express them as confidence intervals.

30 Confidence intervals Parameter estimation Point estimator a function of sample values that gives an approximate value for a parameter of the population distribution. Different samples will lead to different estimates, even using the same estimator. So which of these values match the value of the parameter being estimated? Probably none! Interval estimation Confidence interval = point estimator + interval + probability of having a hit

31 Confidence on the interval We denote by α the percentage of times that, on average, the range does not include (not hits ) the value of the parameter that we want to estimate. To build a confidence interval is then necessary: - An estimator for the parameter under analysis - A particular value of this estimator - The distribution of the estimator

32 Example Confidence intervals for the expected value of a population The most natural estimator for the expected value of a population is the sample mean. In the case of a large sample of a population, regardless of the probability distribution, with expected value µ and standard-deviation σ, the sample mean X follows a normal distribution, which can be converted into a reduced normal distribution: X N(µ, σ2 n ) Z = X µ σ N(0, 1) n

33 In general σ is unknown but it can be replaced with negligible error (because the sample is large), by the value given by the estimator sample standard-deviation : s = 1 n (X i X) n 1 2 Thus, assuming that σ s: i=1 Z = X µ s X µ σ N(0, 1) n n This distribution allows us to calculate the confidence interval for µ at (1 α) 100%, ie, an interval around the sample mean X that, with a probability of (1 α) 100%, contains the true expected value of the population µ.

34 Let z( α ) be a value so that P [Z > 2 z( α )] = α and let z( α ) be the symmetric value for which P [Z < z( α 2 )] = α 2 : Then: P [ z( α 2 ) < Z < z( α 2 )] = 1 α P [ z( α ) < X µ 2 σ < z( α )] = 1 α 2 n P [X z( α 2 ) σ n < µ < X + z( α 2 ) σ n ] = 1 α i.e, the interval [X z( α2 ) σ n, X + z( α2 ) σ n ] is the confidence interval we were looking for. Considering that s approximates well σ: [ X z( α 2 ) s, X + z( α n 2 ) s ] n

35 Sizing samples Associated with a confidence interval there are always two parameters, which depend on sample size: the extent of the confidence interval, which, for the same degree of confidence, will be smaller, the larger the sample; the degree of confidence of the interval that, for the same amplitude, will be greater, the larger the sample. In simulation applications the most frequent situation is that we want to size the sample in order to get a confidence interval with a previously set degree of confidence and an interval amplitude not greater than a given value.

36 Let us take, for example, a confidence interval for the expected value of the population: [ X z( α 2 ) s, X + z( α n 2 ) s ] n Let us suppose that we want a confidence interval at 95%. In this case α/2 = and we would get from a reduced normal distribution table the following value of z: z(0.025) = Problem: we want a value for n, to know how many simulation trials or replicas we should run (the sample size), but to calculate it we need the value of X and s (i.e. the sample results). Solution: run the simulation model with a first small sample, compute the parameters X and s and use them to calculate the size of the sample for the final experiments.

37 Example: from a first sample we got X = 1.70 and s = The confidence interval is then the following: [ , ] n n Finally, imposing a maximum amplitude of, let us say, 0.04, we would be able to compute the sample size that is necessary to fulfill those requirements: n n n 0.04 n 25

38 Bibliography Hillier and Lierberman (2001). Introduction to Operations Research. Mc Graw-Hill. Joseph G. Ecker and Michael Kupferschmid (1988). Introduction to Operations Research. Wiley. Handy A. Taha (1987). Operations Research: an introduction. Prentice Hall. Ravindram, Philips and Solberg (1987). Operations Research: principles and practice. Wiley.

New approaches to uncertainty evaluation:

New approaches to uncertainty evaluation: New approaches to uncertainty evaluation: Propagation of uncertainty, numerical methods and Monte Carlo simulation Wolfram Bremser BAM Federal Institute for Materials Research and Testing Unter den Eichen

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

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

CIVL Continuous Distributions

CIVL Continuous Distributions CIVL 3103 Continuous Distributions Learning Objectives - Continuous Distributions Define continuous distributions, and identify common distributions applicable to engineering problems. Identify the appropriate

More information

Department of Electrical- and Information Technology. ETS061 Lecture 3, Verification, Validation and Input

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

Chapter 4: Monte Carlo Methods. Paisan Nakmahachalasint

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

Algorithms and Networking for Computer Games

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

ISyE 3044 Fall 2017 Test #1a Solutions

ISyE 3044 Fall 2017 Test #1a Solutions 1 NAME ISyE 344 Fall 217 Test #1a Solutions This test is 75 minutes. You re allowed one cheat sheet. Good luck! 1. Suppose X has p.d.f. f(x) = 4x 3, < x < 1. Find E[ 2 X 2 3]. Solution: By LOTUS, we have

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 1: Revie of Calculus and Probability

Chapter 1: Revie of Calculus and Probability Chapter 1: Revie of Calculus and Probability Refer to Text Book: Operations Research: Applications and Algorithms By Wayne L. Winston,Ch. 12 Operations Research: An Introduction By Hamdi Taha, Ch. 12 OR441-Dr.Khalid

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

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

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

Exam 3, Math Fall 2016 October 19, 2016

Exam 3, Math Fall 2016 October 19, 2016 Exam 3, Math 500- Fall 06 October 9, 06 This is a 50-minute exam. You may use your textbook, as well as a calculator, but your work must be completely yours. The exam is made of 5 questions in 5 pages,

More information

The University of British Columbia Computer Science 405 Practice Midterm Solutions

The University of British Columbia Computer Science 405 Practice Midterm Solutions The University of British Columbia Computer Science 405 Practice Midterm Solutions Instructor: Kees van den Doel Time: 45 mins Total marks: 100 The solutions provided here are much more verbose than what

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

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

Generating pseudo- random numbers

Generating pseudo- random numbers Generating pseudo- random numbers What are pseudo-random numbers? Numbers exhibiting statistical randomness while being generated by a deterministic process. Easier to generate than true random numbers?

More information

Expectations. Definition Let X be a discrete rv with set of possible values D and pmf p(x). The expected value or mean value of X, denoted by E(X ) or

Expectations. Definition Let X be a discrete rv with set of possible values D and pmf p(x). The expected value or mean value of X, denoted by E(X ) or Expectations Expectations Definition Let X be a discrete rv with set of possible values D and pmf p(x). The expected value or mean value of X, denoted by E(X ) or µ X, is E(X ) = µ X = x D x p(x) Expectations

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

Today: Fundamentals of Monte Carlo

Today: Fundamentals of Monte Carlo Today: Fundamentals of Monte Carlo What is Monte Carlo? Named at Los Alamos in 1940 s after the casino. Any method which uses (pseudo)random numbers as an essential part of the algorithm. Stochastic -

More information

Applied Statistics. Monte Carlo Simulations. Troels C. Petersen (NBI) Statistics is merely a quantisation of common sense

Applied Statistics. Monte Carlo Simulations. Troels C. Petersen (NBI) Statistics is merely a quantisation of common sense Applied Statistics Monte Carlo Simulations Troels C. Petersen (NBI) Statistics is merely a quantisation of common sense 1 Random numbers Any one who considers arithmetical methods of producing random digits

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

Continuous random variables

Continuous random variables Continuous random variables CE 311S What was the difference between discrete and continuous random variables? The possible outcomes of a discrete random variable (finite or infinite) can be listed out;

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

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

Lecture notes on Regression: Markov Chain Monte Carlo (MCMC)

Lecture notes on Regression: Markov Chain Monte Carlo (MCMC) Lecture notes on Regression: Markov Chain Monte Carlo (MCMC) Dr. Veselina Kalinova, Max Planck Institute for Radioastronomy, Bonn Machine Learning course: the elegant way to extract information from data,

More information

Random number generators and random processes. Statistics and probability intro. Peg board example. Peg board example. Notes. Eugeniy E.

Random number generators and random processes. Statistics and probability intro. Peg board example. Peg board example. Notes. Eugeniy E. Random number generators and random processes Eugeniy E. Mikhailov The College of William & Mary Lecture 11 Eugeniy Mikhailov (W&M) Practical Computing Lecture 11 1 / 11 Statistics and probability intro

More information

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

Physics 403 Monte Carlo Techniques

Physics 403 Monte Carlo Techniques Physics 403 Monte Carlo Techniques Segev BenZvi Department of Physics and Astronomy University of Rochester Table of Contents 1 Simulation and Random Number Generation Simulation of Physical Systems Creating

More information

CS 361: Probability & Statistics

CS 361: Probability & Statistics February 26, 2018 CS 361: Probability & Statistics Random variables The discrete uniform distribution If every value of a discrete random variable has the same probability, then its distribution is called

More information

From Random Numbers to Monte Carlo. Random Numbers, Random Walks, Diffusion, Monte Carlo integration, and all that

From Random Numbers to Monte Carlo. Random Numbers, Random Walks, Diffusion, Monte Carlo integration, and all that From Random Numbers to Monte Carlo Random Numbers, Random Walks, Diffusion, Monte Carlo integration, and all that Random Walk Through Life Random Walk Through Life If you flip the coin 5 times you will

More information

If we want to analyze experimental or simulated data we might encounter the following tasks:

If we want to analyze experimental or simulated data we might encounter the following tasks: Chapter 1 Introduction If we want to analyze experimental or simulated data we might encounter the following tasks: Characterization of the source of the signal and diagnosis Studying dependencies Prediction

More information

1 Probability and Random Variables

1 Probability and Random Variables 1 Probability and Random Variables The models that you have seen thus far are deterministic models. For any time t, there is a unique solution X(t). On the other hand, stochastic models will result in

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

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

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

Math Stochastic Processes & Simulation. Davar Khoshnevisan University of Utah

Math Stochastic Processes & Simulation. Davar Khoshnevisan University of Utah Math 5040 1 Stochastic Processes & Simulation Davar Khoshnevisan University of Utah Module 1 Generation of Discrete Random Variables Just about every programming language and environment has a randomnumber

More information

Chapter 4 Continuous Random Variables and Probability Distributions

Chapter 4 Continuous Random Variables and Probability Distributions Chapter 4 Continuous Random Variables and Probability Distributions Part 3: The Exponential Distribution and the Poisson process Section 4.8 The Exponential Distribution 1 / 21 Exponential Distribution

More information

Introduction. Microscopic Theories of Nuclear Structure, Dynamics and Electroweak Currents June 12-30, 2017, ECT*, Trento, Italy

Introduction. Microscopic Theories of Nuclear Structure, Dynamics and Electroweak Currents June 12-30, 2017, ECT*, Trento, Italy Introduction Stefano Gandolfi Los Alamos National Laboratory (LANL) Microscopic Theories of Nuclear Structure, Dynamics and Electroweak Currents June 12-30, 2017, ECT*, Trento, Italy Stefano Gandolfi (LANL)

More information

Brief Introduction to: Transport Theory/Monte Carlo Techniques/MCNP

Brief Introduction to: Transport Theory/Monte Carlo Techniques/MCNP 22:54 Neutron Interactions and Applications Brief Introduction to: Transport Theory/Monte Carlo Techniques/MCNP The behavior of individual neutrons and nuclei cannot be predicted. However, the average

More information

Monte Carlo Simulation

Monte Carlo Simulation Monte Carlo Simulation 198 Introduction Reliability indices of an actual physical system could be estimated by collecting data on the occurrence of failures and durations of repair. The Monte Carlo method

More information

Today: Fundamentals of Monte Carlo

Today: Fundamentals of Monte Carlo Today: Fundamentals of Monte Carlo What is Monte Carlo? Named at Los Alamos in 940 s after the casino. Any method which uses (pseudo)random numbers as an essential part of the algorithm. Stochastic - not

More information

Sources of randomness

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

MAS1302 Computational Probability and Statistics

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

Statistics for Economists. Lectures 3 & 4

Statistics for Economists. Lectures 3 & 4 Statistics for Economists Lectures 3 & 4 Asrat Temesgen Stockholm University 1 CHAPTER 2- Discrete Distributions 2.1. Random variables of the Discrete Type Definition 2.1.1: Given a random experiment with

More information

2905 Queueing Theory and Simulation PART IV: SIMULATION

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

Monte Carlo Simulations

Monte Carlo Simulations Monte Carlo Simulations What are Monte Carlo Simulations and why ones them? Pseudo Random Number generators Creating a realization of a general PDF The Bootstrap approach A real life example: LOFAR simulations

More information

Introduction to Machine Learning CMU-10701

Introduction to Machine Learning CMU-10701 Introduction to Machine Learning CMU-10701 Markov Chain Monte Carlo Methods Barnabás Póczos Contents Markov Chain Monte Carlo Methods Sampling Rejection Importance Hastings-Metropolis Gibbs Markov Chains

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

Nonlife Actuarial Models. Chapter 14 Basic Monte Carlo Methods

Nonlife Actuarial Models. Chapter 14 Basic Monte Carlo Methods Nonlife Actuarial Models Chapter 14 Basic Monte Carlo Methods Learning Objectives 1. Generation of uniform random numbers, mixed congruential method 2. Low discrepancy sequence 3. Inversion transformation

More information

Monte Carlo programs

Monte Carlo programs Monte Carlo programs Alexander Khanov PHYS6260: Experimental Methods is HEP Oklahoma State University November 13, 2017 Monte Carlo methods: the idea In classical physics, if we need to measure something

More information

Today: Fundamentals of Monte Carlo

Today: Fundamentals of Monte Carlo Today: Fundamentals of Monte Carlo What is Monte Carlo? Named at Los Alamos in 1940 s after the casino. Any method which uses (pseudo)random numbers as an essential part of the algorithm. Stochastic -

More information

Topic 3 - Discrete distributions

Topic 3 - Discrete distributions Topic 3 - Discrete distributions Basics of discrete distributions Mean and variance of a discrete distribution Binomial distribution Poisson distribution and process 1 A random variable is a function which

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

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

Monte Carlo Methods. Part I: Introduction

Monte Carlo Methods. Part I: Introduction Monte Carlo Methods Part I: Introduction Spring Semester 2013/14 Department of Applied Mathematics, University of Crete Instructor: Harmandaris Vagelis, email: vagelis@tem.uoc.gr Course web page: http://www.tem.uoc.gr/~vagelis/courses/em385/

More information

Continuous Probability Distributions. Uniform Distribution

Continuous Probability Distributions. Uniform Distribution Continuous Probability Distributions Uniform Distribution Important Terms & Concepts Learned Probability Mass Function (PMF) Cumulative Distribution Function (CDF) Complementary Cumulative Distribution

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

Chapter 3 sections. SKIP: 3.10 Markov Chains. SKIP: pages Chapter 3 - continued

Chapter 3 sections. SKIP: 3.10 Markov Chains. SKIP: pages Chapter 3 - continued Chapter 3 sections Chapter 3 - continued 3.1 Random Variables and Discrete Distributions 3.2 Continuous Distributions 3.3 The Cumulative Distribution Function 3.4 Bivariate Distributions 3.5 Marginal Distributions

More information

Software Reliability & Testing

Software Reliability & Testing Repairable systems Repairable system A reparable system is obtained by glueing individual non-repairable systems each around a single failure To describe this gluing process we need to review the concept

More information

S n = x + X 1 + X X n.

S n = x + X 1 + X X n. 0 Lecture 0 0. Gambler Ruin Problem Let X be a payoff if a coin toss game such that P(X = ) = P(X = ) = /2. Suppose you start with x dollars and play the game n times. Let X,X 2,...,X n be payoffs in each

More information

Lecture 2 : CS6205 Advanced Modeling and Simulation

Lecture 2 : CS6205 Advanced Modeling and Simulation Lecture 2 : CS6205 Advanced Modeling and Simulation Lee Hwee Kuan 21 Aug. 2013 For the purpose of learning stochastic simulations for the first time. We shall only consider probabilities on finite discrete

More information

Guidelines for Solving Probability Problems

Guidelines for Solving Probability Problems Guidelines for Solving Probability Problems CS 1538: Introduction to Simulation 1 Steps for Problem Solving Suggested steps for approaching a problem: 1. Identify the distribution What distribution does

More information

Department of Mathematics

Department of Mathematics Department of Mathematics Ma 3/103 KC Border Introduction to Probability and Statistics Winter 2017 Supplement 2: Review Your Distributions Relevant textbook passages: Pitman [10]: pages 476 487. Larsen

More information

Let X be a continuous random variable, < X < f(x) is the so called probability density function (pdf) if

Let X be a continuous random variable, < X < f(x) is the so called probability density function (pdf) if University of California, Los Angeles Department of Statistics Statistics 1A Instructor: Nicolas Christou Continuous probability distributions Let X be a continuous random variable, < X < f(x) is the so

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

02 Background Minimum background on probability. Random process

02 Background Minimum background on probability. Random process 0 Background 0.03 Minimum background on probability Random processes Probability Conditional probability Bayes theorem Random variables Sampling and estimation Variance, covariance and correlation Probability

More information

Chapter 2 Random Processes

Chapter 2 Random Processes Chapter 2 Random Processes 21 Introduction We saw in Section 111 on page 10 that many systems are best studied using the concept of random variables where the outcome of a random experiment was associated

More information

CS115 Computer Simulation Project list

CS115 Computer Simulation Project list CS115 Computer Simulation Project list The final project for this class is worth 40% of your grade. Below are your choices. You only need to do one of them. Project MC: Monte Carlo vs. Deterministic Volume

More information

IE 581 Introduction to Stochastic Simulation

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

Random number generators

Random number generators s generators Comp Sci 1570 Introduction to Outline s 1 2 s generator s The of a sequence of s or symbols that cannot be reasonably predicted better than by a random chance, usually through a random- generator

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

Department of Mathematics

Department of Mathematics Department of Mathematics Ma 3/103 KC Border Introduction to Probability and Statistics Winter 2018 Supplement 2: Review Your Distributions Relevant textbook passages: Pitman [10]: pages 476 487. Larsen

More information

Monte Carlo Methods in Engineering

Monte Carlo Methods in Engineering Monte Carlo Methods in Engineering Mikael Amelin Draft version KTH Royal Institute of Technology Electric Power Systems Stockholm 2013 PREFACE This compendium describes how Monte Carlo methods can be

More information

ECE 302: Probabilistic Methods in Electrical Engineering

ECE 302: Probabilistic Methods in Electrical Engineering ECE 302: Probabilistic Methods in Electrical Engineering Test I : Chapters 1 3 3/22/04, 7:30 PM Print Name: Read every question carefully and solve each problem in a legible and ordered manner. Make sure

More information

Random number generation

Random number generation CE 391F April 4, 2013 ANNOUNCEMENTS Homework 3 due today Homework 4 coming... Announcements Webinar announcement Femke van Wageningen-Kessels from TU Delft will be giving a webinar titled Traffic Flow

More information

Physics 403. Segev BenZvi. Monte Carlo Techniques. Department of Physics and Astronomy University of Rochester

Physics 403. Segev BenZvi. Monte Carlo Techniques. Department of Physics and Astronomy University of Rochester Physics 403 Monte Carlo Techniques Segev BenZvi Department of Physics and Astronomy University of Rochester Table of Contents 1 Simulation and Random Number Generation Simulation of Physical Systems Creating

More information

Tutorial 1 : Probabilities

Tutorial 1 : Probabilities Lund University ETSN01 Advanced Telecommunication Tutorial 1 : Probabilities Author: Antonio Franco Emma Fitzgerald Tutor: Farnaz Moradi January 11, 2016 Contents I Before you start 3 II Exercises 3 1

More information

Name of the Student: Problems on Discrete & Continuous R.Vs

Name of the Student: Problems on Discrete & Continuous R.Vs Engineering Mathematics 08 SUBJECT NAME : Probability & Random Processes SUBJECT CODE : MA645 MATERIAL NAME : University Questions REGULATION : R03 UPDATED ON : November 07 (Upto N/D 07 Q.P) (Scan the

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

Solutions For Stochastic Process Final Exam

Solutions For Stochastic Process Final Exam Solutions For Stochastic Process Final Exam (a) λ BMW = 20 0% = 2 X BMW Poisson(2) Let N t be the number of BMWs which have passes during [0, t] Then the probability in question is P (N ) = P (N = 0) =

More information

Random Bit Generation

Random Bit Generation .. Random Bit Generation Theory and Practice Joshua E. Hill Department of Mathematics, University of California, Irvine Math 235B January 11, 2013 http://bit.ly/xwdbtv v. 1 / 47 Talk Outline 1 Introduction

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

General Principles in Random Variates Generation

General Principles in Random Variates Generation General Principles in Random Variates Generation E. Moulines and G. Fort Telecom ParisTech June 2015 Bibliography : Luc Devroye, Non-Uniform Random Variate Generator, Springer-Verlag (1986) available on

More information

6. MC data analysis. Doing experiments or complex simulations can be quite time-consuming, expensive, or both.

6. MC data analysis. Doing experiments or complex simulations can be quite time-consuming, expensive, or both. 6. MC data analysis [Numerical Recipes 15.6, own derivation] Monte Carlo simulations can be a highly useful tool in the analysis of experimental data, or data produced by other computer simulations. Doing

More information

Introduction to Statistical Data Analysis Lecture 3: Probability Distributions

Introduction to Statistical Data Analysis Lecture 3: Probability Distributions Introduction to Statistical Data Analysis Lecture 3: Probability Distributions James V. Lambers Department of Mathematics The University of Southern Mississippi James V. Lambers Statistical Data Analysis

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

6. MC data analysis. [Numerical Recipes 15.6, own derivation] Basics of Monte Carlo simulations, Kai Nordlund

6. MC data analysis. [Numerical Recipes 15.6, own derivation] Basics of Monte Carlo simulations, Kai Nordlund 6. MC data analysis [Numerical Recipes 15.6, own derivation] Monte Carlo simulations can be a highly useful tool in the analysis of experimental data, or data produced by other computer simulations. The

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

Machine Learning. Probability Basics. Marc Toussaint University of Stuttgart Summer 2014

Machine Learning. Probability Basics. Marc Toussaint University of Stuttgart Summer 2014 Machine Learning Probability Basics Basic definitions: Random variables, joint, conditional, marginal distribution, Bayes theorem & examples; Probability distributions: Binomial, Beta, Multinomial, Dirichlet,

More information

Chapter 2 SIMULATION BASICS. 1. Chapter Overview. 2. Introduction

Chapter 2 SIMULATION BASICS. 1. Chapter Overview. 2. Introduction Chapter 2 SIMULATION BASICS 1. Chapter Overview This chapter has been written to introduce the topic of discreteevent simulation. To comprehend the material presented in this chapter, some background in

More information

57:022 Principles of Design II Final Exam Solutions - Spring 1997

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

MATH 56A: STOCHASTIC PROCESSES CHAPTER 6

MATH 56A: STOCHASTIC PROCESSES CHAPTER 6 MATH 56A: STOCHASTIC PROCESSES CHAPTER 6 6. Renewal Mathematically, renewal refers to a continuous time stochastic process with states,, 2,. N t {,, 2, 3, } so that you only have jumps from x to x + and

More information

Joint Probability Distributions and Random Samples (Devore Chapter Five)

Joint Probability Distributions and Random Samples (Devore Chapter Five) Joint Probability Distributions and Random Samples (Devore Chapter Five) 1016-345-01: Probability and Statistics for Engineers Spring 2013 Contents 1 Joint Probability Distributions 2 1.1 Two Discrete

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

Homework 10 (due December 2, 2009)

Homework 10 (due December 2, 2009) Homework (due December, 9) Problem. Let X and Y be independent binomial random variables with parameters (n, p) and (n, p) respectively. Prove that X + Y is a binomial random variable with parameters (n

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