Write a script which consumes a number that specifies the


Write a matlab code to solve this

It seems that the Math department at a rival university has once again dropped the ball, and forgotten the value of n.

You are to write a script which consumes a number that specifies the required accuracy and then and approximates the value of n to that accuracy.

You are going to use the following algorithm based on geometric probability:

Think about a quarter circle inside of a unit square (the quarter circle has area pi/4). You pick a random point inside the square.

If it is in the quarter circle, you get a "hit" and if not, you get a "miss".

The approximate area of the quarter circle will be given by the number of hits divided by the number of points you chose.

Your script should repeat the process of counting hits and misses until at least 10,000 tries have been made, and the successive estimates of n are within the prescribed accuracy.

It should produce the estimated value of pi.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a script which consumes a number that specifies the
Reference No:- TGS02922436

Expected delivery within 24 Hours