Created
April 3, 2014 19:17
-
-
Save phikal/9960938 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 python3 | |
from random import randint | |
from sys import argv | |
# Dictionary for occ. | |
res = {} | |
for rv1 in range(int(argv[1])): | |
# Generate RG String | |
s = "" | |
for rv2 in range(3): | |
if randint(1,10) <= 6: | |
s += 'R' | |
else: | |
s += 'G' | |
# Add to Dictionary | |
res[s] = res.get(s,0)+1 | |
#Show results | |
for i in sorted(res.keys()): | |
print(i," # ",res[i],"\t> ",(res[i]/int(argv[1]))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment