Last active
August 29, 2015 14:18
-
-
Save tkensiski/6c8e7d113d5a0b4ee101 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env python | |
def generateRandomBinaryVector(p,n): | |
outcomes = np.zeros((n,1)) | |
for index in range(0,n): | |
outcomes[index] = generateRandomCoinFlip(p) | |
return outcomes | |
p = 10 | |
n = 5 | |
print generateRandomBinaryVector(p, n) | |
# this should print something like this: | |
''' | |
array([[ 0.], | |
[ 0.]]) | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment