Question: I need a Python script Exercise 1 : Monte - Carlo integration The equation of the circle with unit radius centered around ( 0 ,

I need a Python script
Exercise 1: Monte-Carlo integration
The equation of the circle with unit radius centered around (0,0) is given by
x2+y2=1.
Exploiting the symmetry of the circle, one can define the area under the positive quadrant
to be
01ydx=011-x22dx=4
Using the Monte Carlo technique evaluate the integral to find the value of .
(a) Generate Nsmpl=10000 random values for x, distributed uniformly between 0 and 1.
Use these values to calculate the average function value (:y:) and estimate .
(b) Repeat the exercise (a)Nexpt=1000 times to evaluate the uncertainty due to the
limited sample size used in the estimation of .
(c) For different integration samples sizes (i.e.Nsmpl=10i;i=1,dots,6) which are repeated
Nexpt=100 times, evaluate the mean of the absolute difference between estimated est
and exact result (np.pi) i.e.=|est-|. Make a log-log plot of Vs Nsmpl
and show that the data can be fit to a straight line of slope -12.
 I need a Python script Exercise 1: Monte-Carlo integration The equation

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!