Skip to content

Instantly share code, notes, and snippets.

@vinaykudari
Created July 29, 2018 15:49
Show Gist options
  • Save vinaykudari/af573efdde49e30825780083e1d2004a to your computer and use it in GitHub Desktop.
Save vinaykudari/af573efdde49e30825780083e1d2004a to your computer and use it in GitHub Desktop.
coin_stimulation
def generate_counts(coin_flips=1000, n=1000):
x = 2*(np.random.random((coin_flips, n)) > 0.5) - 1 #generates a 1000x1000 matrix, 1 for heads -1 for tails
s = x.sum(axis=0) #summing row wise, 1000 coin flips for 1000 times together
return s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment