Created
July 29, 2018 15:49
-
-
Save vinaykudari/af573efdde49e30825780083e1d2004a to your computer and use it in GitHub Desktop.
coin_stimulation
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
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