Skip to content

Instantly share code, notes, and snippets.

@phikal
Created April 3, 2014 19:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phikal/9960938 to your computer and use it in GitHub Desktop.
Save phikal/9960938 to your computer and use it in GitHub Desktop.
#!/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