Skip to content

Instantly share code, notes, and snippets.

@tkensiski
Last active August 29, 2015 14:18
Show Gist options
  • Save tkensiski/6c8e7d113d5a0b4ee101 to your computer and use it in GitHub Desktop.
Save tkensiski/6c8e7d113d5a0b4ee101 to your computer and use it in GitHub Desktop.
#!/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