Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- from fractions import gcd
- wins = 0
- times = 0
- for i in range(10000):
- times += 1
- x = random.randint(0, 1000)
- win = True
- for i in range(1000):
- if random.randint(0, 1000) == x:
- win = False
- break
- if win:
- wins += 1
- print wins / gcd(wins, times), "/", times / gcd(wins, times)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement