Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- stats = [0,0,0,0,0,0,0]
- n=100000
- for i in range(n):
- hits = 0
- for j in range(4):
- if(random.random()>0.4):
- hits+=1
- for j in range(2):
- if(random.random()>0.3):
- hits+=1
- stats[hits]+=1
- print [float(elem)/n for elem in stats]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement