A1-MCIntegration.pdf - CX 4010 CSE 6010 Assignment 1 Monte Carlo Integral Computation Due Dates \u2022 Due 11 AM Friday \u2022 No late submissions will be

# A1-MCIntegration.pdf - CX 4010 CSE 6010 Assignment 1 Monte...

• 2

This preview shows page 1 - 2 out of 2 pages.

CX 4010 / CSE 6010 Assignment 1 Monte Carlo Integral Computation Due Dates: Due: 11 AM, Friday, August 30, 2019 No late submissions will be accepted Write a C program to compute the value of an integral for an arbitrary function ࠵?(࠵?) : ࠵? = ’ ࠵?(࠵?) ( ) You may assume f(x) is defined and f(x) ³ 0 for all x such that a £ x £ b . Define a C function to implement ࠵?(࠵?) . For this assignment assume ࠵?(࠵?) = ࠵? * but your code should be written so new functions can be implemented by simply replacing your C function with another. Use a Monte Carlo simulation approach to compute the value of the integral. The figure below shows a plot of f(x) for x Î [a, b] . The value of the integral Z is the area underneath the curve for f(x) for x Î [a, b] . Define some constant value K such that K > f(x) for all x Î [a, b] . Randomly select a point (x’, y’) in the shaded rectangle bound by the X axis, and the lines y =K, x=a , and x=b . Each point in the shaded box is equally likely to be selected. The probability that the point (x’, y’) lies

#### You've reached the end of your free preview.

• Fall '17
• Richard Fujimoto

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern