MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations

  • Slides: 21
Download presentation
MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations http: //myhome. spu. edu/lauw

MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations http: //myhome. spu. edu/lauw

Preview l l Look at how to use random numbers to evaluate some integrals

Preview l l Look at how to use random numbers to evaluate some integrals First application of Monte Carlo Methods Keep in mind that there are “better” numerical methods to evaluate integrals No programs will be provided for the example below

Example 0 Suppose we want to estimate the value of the integral

Example 0 Suppose we want to estimate the value of the integral

Example 0 Since the function is non-negative over the interval [0, 1], the value

Example 0 Since the function is non-negative over the interval [0, 1], the value of the integral is the same as the area under the graph

Example 0 We are going to estimate the area by random numbers.

Example 0 We are going to estimate the area by random numbers.

Example 0

Example 0

Example 0 In general, the no. of trials needs to be large.

Example 0 In general, the no. of trials needs to be large.

Example 0

Example 0

Maple Commands l l Activate random number generator for various probability distributions. Can be

Maple Commands l l Activate random number generator for various probability distributions. Can be used before the program (as shown) or within the program (less desirable).

Maple Commands l

Maple Commands l

Example 0 What are the disadvantages?

Example 0 What are the disadvantages?

Example 0 What are the disadvantages? 1. 2. 3. 4.

Example 0 What are the disadvantages? 1. 2. 3. 4.

Monte Carlo Methods l l Statistical simulation methods Method that utilizes sequences of random

Monte Carlo Methods l l Statistical simulation methods Method that utilizes sequences of random numbers to perform the simulations

Classwork l l l Individual* (Each of you need to think through the process)

Classwork l l l Individual* (Each of you need to think through the process) Absolutely no communications. Fact: some of you will be faster than some of the other which is normal!

Classwork Write a program to estimate the value of the integral

Classwork Write a program to estimate the value of the integral

Hint: Input n

Hint: Input n

Hint: Input n Repeat the following n times. 1. Generate a random point (x,

Hint: Input n Repeat the following n times. 1. Generate a random point (x, y) inside the box. 2. Decide if the point is under the graph. Keep track of the number of success.

Hint: Input n Repeat the following n times. 1. Generate a random point (x,

Hint: Input n Repeat the following n times. 1. Generate a random point (x, y) inside the box. 2. Decide if the point is under the graph. Keep track of the number of success. Compute the estimated area. Output the estimated area.

HW Problem 1 Write a program to estimate the value of the integral

HW Problem 1 Write a program to estimate the value of the integral

HW Problem 2 Write a program to estimate the value of the integral

HW Problem 2 Write a program to estimate the value of the integral

HW Problem 3 Design an experiment using Monte Carlo Integration to estimate the value

HW Problem 3 Design an experiment using Monte Carlo Integration to estimate the value of