Question: Using R Studio [ R programming language], Estimate the value of 7 (pi) using Monte Carlo simulations. The statistical idea is as follows: suppose a

Using R Studio [ R programming language],

Using R Studio [ R programming language], Estimate the value of 7

(pi) using Monte Carlo simulations. The statistical idea is as follows: suppose

Estimate the value of 7 (pi) using Monte Carlo simulations. The statistical idea is as follows: suppose a circle of radius 1 is inscribed inside a square with sides of length 2 (see picture). Then from basic geometry, we know that the area of the circle is T. (by the formula Area = ir- ) and the area of the square is 4 (by the formula area = side). So the ratio of the area of the circle to the area of the square will be t/4. In other words, = 4 area of the circle area of the square Using this fact, if we can estimate the ratio of the areas, we can simply estimate T to be four times that ratio. Now: how can we estimate the ratio of the areas? If you randomly choose a point inside the square, the probability of that point being inside the circle is given by the ratio of the areas! So, if we randomly choose N points inside the square, and M of these points fall inside the circle, then the proportion M/N is therefore a reasonable estimate of the ratio of areas, and using the above equation we can estimate tas 4M/N. Using R, compute estimate of it and plot the estimated values for N = 1, 2, ..., 10000. Report R code and output Hint 1: watch this video for more https://www.youtube.com/watch?v=VJTFflqO4TU Hint 2: to generate a random number between 0 and 1, use runif(n=1, min=0, max=1)

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!