Modeling and Simulation Monte carlo simulation 1 Arwa Ibrahim Ahmed Princess Nora University.

Slides:



Advertisements
Similar presentations
February 26, 2015Applied Discrete Mathematics Week 5: Mathematical Reasoning 1 Addition of Integers Example: Add a = (1110) 2 and b = (1011) 2. a 0 + b.
Advertisements

Generating Random Numbers
Random variables 1. Note  there is no chapter in the textbook that corresponds to this topic 2.
Chapter 4 Probability and Probability Distributions
1 Counting. 2 Situations where counting techniques are used  You toss a pair of dice in a casino game. You win if the numbers showing face up have a.
Mathematics in Today's World
Mathematics. Matrices and Determinants-1 Session.
Probabilistic (Average-Case) Analysis and Randomized Algorithms Two different approaches –Probabilistic analysis of a deterministic algorithm –Randomized.
Analysis of Algorithms CS 477/677 Randomizing Quicksort Instructor: George Bebis (Appendix C.2, Appendix C.3) (Chapter 5, Chapter 7)
Maths for Computer Graphics
Probabilistic (Average-Case) Analysis and Randomized Algorithms Two different but similar analyses –Probabilistic analysis of a deterministic algorithm.
1 Sociology 601, Class 4: September 10, 2009 Chapter 4: Distributions Probability distributions (4.1) The normal probability distribution (4.2) Sampling.
Introduction to Simulation. What is simulation? A simulation is the imitation of the operation of a real-world system over time. It involves the generation.
Chapter 14 Simulation. Monte Carlo Process Statistical Analysis of Simulation Results Verification of the Simulation Model Computer Simulation with Excel.
1 Randomized Algorithms Andreas Klappenecker [using some slides by Prof. Welch]
Experimental Evaluation
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
CE 311 K - Introduction to Computer Methods Daene C. McKinney
Lecture 11 – Stochastic Processes
Computer Simulation A Laboratory to Evaluate “What-if” Questions.
Lecture 7: Simulations.
Simulation Output Analysis
Barnett/Ziegler/Byleen Finite Mathematics 11e1 Review for Chapter 4 Important Terms, Symbols, Concepts 4.1. Systems of Linear Equations in Two Variables.
 1  Outline  stages and topics in simulation  generation of random variates.
CSCE 2100: Computing Foundations 1 Probability Theory Tamara Schneider Summer 2013.
Lecture Discrete Probability. 5.1 Probabilities Important in study of complexity of algorithms. Modeling the uncertain world: information, data.
Discrete Mathematical Structures (Counting Principles)
Basic Concepts of Discrete Probability (Theory of Sets: Continuation) 1.
Random Numbers and Simulation  Generating truly random numbers is not possible Programs have been developed to generate pseudo-random numbers Programs.
CSCI 115 Chapter 3 Counting. CSCI 115 §3.1 Permutations.
3. Counting Permutations Combinations Pigeonhole principle Elements of Probability Recurrence Relations.
LECTURE 15 THURSDAY, 15 OCTOBER STA 291 Fall
Copyright © 2014 Pearson Education, Inc. All rights reserved Chapter 5 Modeling Variation with Probability.
CSCE 411 Design and Analysis of Algorithms Set 9: Randomized Algorithms Prof. Jennifer Welch Fall 2014 CSCE 411, Fall 2014: Set 9 1.
Comp. Genomics Recitation 3 The statistics of database searching.
LECTURE 14 TUESDAY, 13 OCTOBER STA 291 Fall
Simulation is the process of studying the behavior of a real system by using a model that replicates the behavior of the system under different scenarios.
Week 21 Conditional Probability Idea – have performed a chance experiment but don’t know the outcome (ω), but have some partial information (event A) about.
M ONTE C ARLO SIMULATION Modeling and Simulation CS
Probabilistic Analysis and Randomized Algorithm. Average-Case Analysis  In practice, many algorithms perform better than their worse case  The average.
Essential Statistics Chapter 91 Introducing Probability.
CHAPTER 10 Introducing Probability BPS - 5TH ED.CHAPTER 10 1.
Chapter 10 Introducing Probability BPS - 5th Ed. Chapter 101.
Lecture 2 Molecular dynamics simulates a system by numerically following the path of all particles in phase space as a function of time the time T must.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 7.
1 Randomized Algorithms Andreas Klappenecker. 2 Randomized Algorithms A randomized algorithm is an algorithm that makes random choices during their execution.
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Relations, Functions.
Meeting 18 Matrix Operations. Matrix If A is an m x n matrix - that is, a matrix with m rows and n columns – then the scalar entry in the i th row and.
The generalization of Bayes for continuous densities is that we have some density f(y|  ) where y and  are vectors of data and parameters with  being.
Computer simulation Sep. 9, QUIZ 2 Determine whether the following experiments have discrete or continuous out comes A fair die is tossed and the.
BPS - 3rd Ed. Chapter 91 Introducing Probability.
1 1 Slide Simulation Professor Ahmadi. 2 2 Slide Simulation Chapter Outline n Computer Simulation n Simulation Modeling n Random Variables and Pseudo-Random.
ICS 353: Design and Analysis of Algorithms
Matrices Digital Lesson. Copyright © by Houghton Mifflin Company, Inc. All rights reserved. 2 A matrix is a rectangular array of real numbers. Each entry.
METHODS OF ASSIGNING PROBABILITY. The Uniform Probability Model.
1 Chapter 10 Probability. Chapter 102 Idea of Probability u Probability is the science of chance behavior u Chance behavior is unpredictable in the short.
LECTURE 16 TUESDAY, 20 OCTOBER STA 291 Fall
Table of Contents Matrices - Definition and Notation A matrix is a rectangular array of numbers. Consider the following matrix: Matrix B has 3 rows and.
Spring 2016 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University.
Theory of Computational Complexity Probability and Computing Ryosuke Sasanuma Iwama and Ito lab M1.
Section 7.3. Why we need Bayes?  How to assess the probability that a particular event occurs on the basis of partial evidence.  The probability p(F)
AP Statistics From Randomness to Probability Chapter 14.
Matrices. Matrix A matrix is an ordered rectangular array of numbers. The entry in the i th row and j th column is denoted by a ij. Ex. 4 Columns 3 Rows.
Random variables (r.v.) Random variable
Chapter 7: Counting Principles
Monte Carlo simulation
Using Simulation to Estimate Probabilities
Honors Statistics From Randomness to Probability
Essential Statistics Introducing Probability
Presentation transcript:

Modeling and Simulation Monte carlo simulation 1 Arwa Ibrahim Ahmed Princess Nora University

2 EMPIRICAL PROBABILITY AND AXIOMATIC PROBABILITY : 2 The main characterization of Monte Carlo simulation system is being stochastic (random) and deterministic (time is not a significant). With Empirical Probability, we perform an experiment many times n and count the number of occurrences n a of an event A. The relative frequency of occurrence of event A is n a /n. The frequency theory of probability asserts that the relative frequency converges as n →∞ Axiomatic Probability is a formal, set-theoretic approach, Mathematically construct the sample space and calculate the number of events A.

3 EXAMPLE: 3 Roll two dice and observe the up faces: If the two up faces are summed, an integer-valued random variable, say X, is defined with possible values 2 through 12 inclusive. Pr(X = 7) could be estimated by replicating the experiment many times and calculating the relative frequency of occurrence of 7’s.

4 RANDOM VARIATES: Definition: A random variable is a function from the sample space of an experiment to the set of real numbers R. That is, a random variable assigns a real number to each possible outcome. 44

5 RANDOM VARIATES: 55 A Random Variate is an algorithmically generated realization of a random variable. u = Random() generates a Uniform (0, 1) random variate. How can we generate a Uniform (a, b) variate? Generating a Uniform Random Variate:

6 EQUILIKELY RANDOM VARIATES: 66 Uniform (0, 1) random variates can also be used to generate an Equilikely(a, b) random variate. Specifically, x = a + [(b − a + 1) u] Generating an Equilikely Random Variate:

7 EXAMPLE: Example 1: To generate a random variate x that simulates rolling two fair dice and summing the resulting up faces, use: x = Equilikely(1, 6) + Equilikely(1, 6); Example 2: To select an element x at random from the array a[0], a[1],..., a[n − 1] use: i = Equilikely (0, n - 1); x = a[i]; 77

8 MC DRAWBACK: The drawback of Monte Carlo simulation is that it only produces an estimate  Larger n does not guarantee a more accurate estimate. 88

9 EXAMPLE : MATRICES AND DETERMINANTS: 9 Matrix: set of real or complex numbers in a rectangular array, For matrix A, a ij is the element in row i, column j, Here, A is m × n—m rows, n columns We consider just one particular quantity associated with a matrix: its determinant, a single number associated with a square (nXn) matrix A, typically denoted as |A| or det A.

10 EXAMPLE : MATRICES AND DETERMINANTS:  10

11 EXAMPLE : MATRICES AND DETERMINANTS:  11 Random Matrices: Matrix theory traditionally emphasizes matrices that consist of real or complex constants. But what if the elements of a matrix are random variables? Such matrices are referred to as \stochastic" or \random" matrices. Our Question :if the elements of a 3 X 3 matrix are independent random numbers with positive diagonal elements and negative off- diagonal elements, what is the probability that the matrix has a positive determinant?

12 EXAMPLE : MATRICES AND DETERMINANTS: Specification Model: Let event A be that the determinant is positive Generate N 3 × 3 matrices with random elements Compute the determinant for each matrix Let na = number of matrices with determinant > 0 Probability of interest: Pr(A) ≈ n a /N  12

13 EXAMPLE : MATRICES AND DETERMINANTS:  13 Computational Model:

14 EXAMPLE : MATRICES AND DETERMINANTS: Output From det Want N sufficiently large for a good point estimate. Avoid recycling random number sequences. Nine calls to Random() per 3 × 3 matrix N. m / 9 ≈ For initial seed and N = , Pr(A) ≈  14

15 EXAMPLE : MATRICES AND DETERMINANTS: Point Estimate Considerations: How many significant digits should be reported? Solution: run the simulation multiple times One option: Use different initial seeds for each run Caveat: Will the same sequences of random numbers appear? Another option: Use different a for each run Caveat: Use a that gives a good random sequence For two runs with a = and Pr(A) ≈  15

16 MONTE CARLO SIMULATION EXAMPLES: HATCHECK GIRL A hatcheck girl at a fancy restaurant collects n hats and returns them at random. What is the probability that all of the hats will be returned to the wrong owner? Let A be that all checked hats are returned to wrong owners Let the checked hats be numbered 1, 2,..., n Girl selects (equally likely) one of the remaining hats to return n ! permutations, each with probability 1/n! E.g.: When n = 3 hats, possible return orders are 1,2,3 1,3,2 2,1,3 2,3,1 3,1,2 3,2,1 Only 2,3,1 and 3,1,2 correspond to all hats returned incorrectly Pr(A) = 2/6 = 1/3  16

17 MONTE CARLO SIMULATION EXAMPLES: HATCHECK GIRL  17 Specification Model: Generates a random permutation of an array a. Check the permuted array to see if any element matches its index.

18 MONTE CARLO SIMULATION EXAMPLES: HATCHECK GIRL Computational Model: Program hat: Monte Carlo simulation of hatcheck problem Uses shuffling algorithm to generate random permutation of hats For n = 10 hats, replications, and three different seeds Pr(A) = 0.369, 0.369, and A question of interest here is the behavior of this probability as n increases. Intuition might suggest that the probability goes to one in the limit as n ∞,, but this is not the case. One way to approach this problem is to simulate for increasing values of n and fashion a guess based on the results of multiple long simulations. One problem with this approach is that you can never be sure that n is large enough. For this problem, the axiomatic approach is a better and more elegant way to determine the behavior of this probability as n ∞.  18

19 MONTE CARLO SIMULATION EXAMPLES: HATCHECK GIRL  19 Hatcheck: Axiomatic Solution: The probability Pr(A) of no hat returned correctly is For n = 10, Pr(A) ≈ Important consistency check for validating craps As n ∞, the probability of no hat returned is 1/e =