Skip to content

Instantly share code, notes, and snippets.

@samsonq
Created April 16, 2022 16:32
Show Gist options
  • Save samsonq/c77378b47ca6e9816e3c3cfb0969ea3e to your computer and use it in GitHub Desktop.
Save samsonq/c77378b47ca6e9816e3c3cfb0969ea3e to your computer and use it in GitHub Desktop.
Estimating Pi and Area of Circle with Monte Carlo Simulation
import numpy
import math
from matplotlib import pyplot as plt
def pi_monte_carlo(num_simulations, radius=1):
return ...
if __name__ == "__main__":
simulations = 10000
print(pi_monte_carlo(10000))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment