Created
February 16, 2015 15:03
-
-
Save cigrainger/5e69783369ee7d7fe4b3 to your computer and use it in GitHub Desktop.
mcint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from numpy import random | |
m = 1000 | |
tot_n = np.zeros(m) | |
for i in list(range(m)): | |
n = 1 | |
mcint = random.randn(n) | |
mean = str(np.mean(mcint)).split('.') | |
while mean[1][:3] != '000': | |
mcint = random.randn(n) | |
mean = str(np.mean(mcint)).split('.') | |
n += 1 | |
tot_n[i] = n | |
avg_n = np.mean(tot_n) | |
print(avg_n) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment