mat 4830 mathematical modeling 04 monte carlo integrations
DESCRIPTION
Example 0 Suppose we want to estimate the value of the integralTRANSCRIPT
![Page 1: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/1.jpg)
MAT 4830Mathematical Modeling
04Monte Carlo Integrations
http://myhome.spu.edu/lauw
![Page 2: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/2.jpg)
Preview 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
![Page 3: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/3.jpg)
Example 0Suppose we want to estimate the value of the integral 3
1
0
xe dx
![Page 4: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/4.jpg)
Example 0Since the function is non-negative over the interval [0,1], the value of the integral is the same as the area under the graph
31
0
xe dx
![Page 5: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/5.jpg)
Example 0We are going to estimate the area by random numbers.
31
0
xe dx
failure
success
![Page 6: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/6.jpg)
Example 03
1
0
xe dx
failure
number of success Area of the boxnumber of trails
Area
success
![Page 7: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/7.jpg)
Example 0In general, the no. of trials needs to be large.
31
0
xe dx
failure
number of success Area of the boxnumber of trails
Area
success
![Page 8: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/8.jpg)
Example 03
1
0
xe dx
success
failure
![Page 9: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/9.jpg)
Maple Commands
Activate random number generator for various probability distributions.
Can be used before the program (as shown) or within the program.
![Page 10: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/10.jpg)
Maple Commands
Generate random numbers for uniform distributions.
![Page 11: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/11.jpg)
Example 0What are the disadvantages?
![Page 12: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/12.jpg)
Example 0What are the disadvantages? 1.2.3.4.
![Page 13: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/13.jpg)
Monte Carlo Methods Statistical simulation methods Method that utilizes sequences of
random numbers to perform the simulations
![Page 14: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/14.jpg)
Classwork 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!
![Page 15: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/15.jpg)
ClassworkWrite a program to estimate the value of the integral
31
0
xe dx
![Page 16: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/16.jpg)
Hint:3
1
0
xe dx
failure
success
Input n
![Page 17: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/17.jpg)
Hint:3
1
0
xe dx
failure
success
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.
![Page 18: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/18.jpg)
Hint:3
1
0
xe dx
failure
success
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.
![Page 19: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/19.jpg)
HW Problem 1Write a program to estimate the value of the integral
2
0
5sin xdx
![Page 20: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/20.jpg)
HW Problem 2Write a program to estimate the value of the integral
1 1
0 0
xye dxdy
![Page 21: MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations](https://reader036.vdocuments.net/reader036/viewer/2022062401/5a4d1b597f8b9ab0599aa6c0/html5/thumbnails/21.jpg)
HW Problem 3Design an experiment using Monte Carlo Integration to estimate the value of