Let S be a solid square of length l = 2 and D be a solid disk of radius r = 1 both centered at the origin (0, 0). The quotient of their inscribed areas is proportional to Ï€ since
As a result, a reasonable approximation of Ï€ can be determined by computing the ratio of points that fall into D when uniformly drawing n random samples in S. In the limit n â†’ âˆž we reassemble the inscribed areas A(D) and A(S) (see Fig. 9.20). Implement the described Monte Carlo algorithm using MPI where each process draws n#processes many samples.