Answered step by step
Verified Expert Solution
Question
1 Approved Answer
USE MATLAB 3. One of the classic examples for Monte Carlo simulation is to find the value of ?. For this purpose, we are going
USE MATLAB
3. One of the classic examples for Monte Carlo simulation is to find the value of ?. For this purpose, we are going to use the ratio between the area of square and the area of circle (shown below). Since the ratio provides the perfect value of ?, we don't calculate directly. Instead, we generate two sequences of random numbers (one for x-axis, the other y- axis). They will represent the dots inside the square. Then, we find the number of points inside the circle along with the total number of points inside the square. As the number of points generally increase, the approximate value of ? becomes closer to that of ?. With the threshold for the absolute relative approximate error set at 5% (0.05), write MATLAB code that calculates the value of n, based on the ratio (shown below). The area of square-2 The area of Circle-IT area of square 4r* 4/ area of circle TI TT area of circle area of square 77 -4* # of dots inside circles total number of dots NStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started