Don't like this style? Click here to change it! blue.css

HW 2: Monte Carlo Area Calculator

Write a function which consumes a number n and produces an approximation of the area of all four green regions in this photo:

square in circle in square

This is a square with edge length 1 containing a circle of radius 1/2 which contains a square of edge length \(\sqrt{2}/2\).

You should create a Monte Carlo simulation by putting random points into the biggest square and calculating the proportion of those points which land in the green regions. Give me as many decimal places as you can.