Created
July 8, 2019 09:43
-
-
Save orico/0389c0fecb74a9d6e7a87ac45b28b1ec 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
import numpy as np | |
rolls = 10000 | |
n = 6 | |
E = [0] * rolls | |
for i in range(0,rolls): | |
flag = False | |
ar = [] | |
while flag == False: | |
rnum = np.random.randint(low=1, high=7, size=1)[0] | |
if rnum not in ar: | |
ar.append(rnum) | |
if len(ar)==6: | |
flag =True | |
E[i] +=1 | |
# print(ar, E, len(E)) | |
value = sum(E) / len(E) | |
print(value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment