Question: MONTE CARLO APPROXIMATION: Write a function for the algorithm for approximating pi. Characterize the performance of the algorithm by plotting the value and the error

MONTE CARLO APPROXIMATION: Write a function for the algorithm for approximating pi. Characterize the performance of the algorithm by plotting the value and the error of the approximation by using the difference or fractional variation from MATLABs pi function and the time spent in the calculation against a range of N values which measures the throughput of the calculation.  MONTE CARLO APPROXIMATION: Write a function for the algorithm for approximating

For example, the value of x can be approximated using a Monte Carlo methods Draw a square then inscribe a circle within it. From plane geometry, the ratio of the area of an inscribed circle to that of the surrounding square is /4. Uniformly scatter random numbers throughout the square. Since the two areas are in the ratio /4, the numbers should fall in the areas in approximately the same ratio. Thus, counting the random numbers in the circle and dividing by the random numbers in the square will yield an approximation for /4. Multiplying the result by 4 will then yield an approximation for itself. 1. 1 2. 3. 0 4

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!