Skip to content

Instantly share code, notes, and snippets.

@ashiato45
Created January 15, 2017 09:56
Show Gist options
  • Save ashiato45/2d962da6fff98b9ce32001cb81a629ed to your computer and use it in GitHub Desktop.
Save ashiato45/2d962da6fff98b9ce32001cb81a629ed to your computer and use it in GitHub Desktop.
a=[0]
c=0
n=200000
import numpy
for i in range(2*n):
b=numpy.random.rand(1,2)
a.append(b)
for j in range(i,n):
d=a[j]**2+a[2*j]**2
if d <= 1:
c+=1
pai=4*c/n
print(a[3])
print(a[3][0,1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment