Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

1. How is the newspaper help to our daily life?

Answered: 1 week ago

Question

1. Prepare a short profile of Mikhail Zoshchenko ?

Answered: 1 week ago

Question

What is psychology disorder?

Answered: 1 week ago