Skip to content

Instantly share code, notes, and snippets.

@angeris
Last active August 31, 2016 17:04
Show Gist options
  • Save angeris/531426c9723773c4e731 to your computer and use it in GitHub Desktop.
Save angeris/531426c9723773c4e731 to your computer and use it in GitHub Desktop.
Runs different, crappy ways of estimating Pi
from numpy import *
N, L = 1e8, 10
print("Here's your crappy estimation of pi: {}".format((sum(exp(-(random.rand(N)*2*L-L)**2))*2*L/N)**2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment