FORTRAN

Monte Carlo Approximation of Pi

posted | on August 1, 2015 09:55:00 CDT

CODE:   monte_pi.f95

RESULTS

Example of the random number generation for 20,000 samples

Approximation of Pi vs Number of Samples

 

Error in Approximation vs Number of Samples

The 1/sqrt(N) line shows that the error in the Monte Carlo simulation decreases as the power law N^(-1/2).