Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


monte carlo integration

hh278hh278 Member Posts: 1
Define a function mc_integral(N, a, b) which implements Monte Carlo algorithm of approximating value of the integral (1) for a given number of sample points N and the integral limits a and b. This function should return a single double value.
Run your Monte Carlo simulation by calling the function mc_integral(N, a,b) with a = 0, b = 6 and different N. Use N = 100, N = 100; 000 and
N = 100,000,000. Measure the running times for every value of N.

equation (1)...
limits for the integral are 0 to 6pi

n is the number of samples generated could be 1000 or 1000000 etc
depands on user input


Sign In or Register to comment.