Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import numpy as np
- def diceprob(k,n):
- sum = 0
- for i in range(n):
- a = random.randint(1, 6)
- b = random.randint(1, 6)
- if a != k and b != k:
- sum += 1
- return sum/n
- np.random.seed(1)
- for k in range(1,7):
- print(k, diceprob(k, 100))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement