Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- import matplotlib
- import matplotlib.pyplot as plt
- N=10000
- x1 = []
- y1 = []
- a,b=[],[]
- n = 0
- for i in range(N):
- x = randint(0, 60)
- y = randint(0, 60)
- x1.append(x)
- y1.append(y)
- if (x + 10 > y) and (y + 12 > x):
- n += 1
- a.append(x)
- b.append(y)
- if x == y:
- n += 1
- print(n/N)
- plt.plot(a,b, linestyle="",marker="o")
- plt.title('PLOT')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment