Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ran = range(0, M)
- def v(d):
- for x in phi:
- t = True
- for y in x:
- if y < 0:
- t = t and (not d[-y - 1])
- else:
- t = t and d[y - 1]
- if not t:
- break
- if not t:
- continue
- else:
- return True
- return False
- def g(N):
- licz = 0
- for i in range(0, N):
- d = np.random.randint(0, 1 + 1, M)
- d = d < 1
- if v(d):
- licz += 1
- return pow(2, M) * licz / N
- N = 100
- d = 100
- ran = range(0, d)
- w = [ g(N) for i in ran ]
- plt.hist(w, bins = 10)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement