Monte Carlo simulation uses random numbers and probability to solve problems. This method has a wide range
Question:
Monte Carlo simulation uses random numbers and probability to solve problems. This method has a wide range of applications in computational mathematics, physics, chemistry, and finance.
For this project, you are going to generate a circle with a randomly sized radius and generate 1,000,000 random (x,y) points. For each simulation, you will output the following:
Trial number
Radius of the circle
Compute the probability of a (x,y) location inside the circle
Number of hits inside the circle from the simulation
Output stating the percentage the results were within the probability
Minor Task
Write the program based on the details above. Since this is a simulation, we will not prompt the user for inputs. To determine the radius of the circle, we are going to implement the Fibonacci series. That will be used to determine what value in the Fibonacci series is used for the radius.
Once you have the radius, implement the Monte Carlo simulation with 1,000,000 random (x,y) points and display the results for 10 trials per Fibonacci numbers in the series (do from numbers 2 to 20 in the Fibonacci series). Place the results in the Project Report along with the code for this task.
Now make a new copy of the program and repeat the process for 25 trials per Fibonacci numbers in the series (do from numbers 2 to 20 in the Fibonacci series). Since this will generate a lot of output to the screen, we will reduce the amount of data displayed. For the minor part, output the following:
Trial number (make note of the example, must keep format like: 001, 025, 125)
Radius of circle
Actually number of hits
At the end, display the average number of hits per radius size
Here is a sample output:
Trial 001: Radius: 8 # hits: 788888
Trial 002: Radius: 8 # hits: 781234
Trial 003: Radius: 8 # hits: 789231