Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 N

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

Step: 3

blur-text-image

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 Systems Design Implementation And Management

Authors: Carlos Coronel, Steven Morris

14th Edition

978-0357673034

More Books

Students also viewed these Databases questions