Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from matplotlib import pyplot as plt
- import numpy as np
- def func2(n, func):
- l = func(n)
- print(l)
- return (1 - 2 ** (-1 / l)) ** (1 / n)
- x = np.arange(1, 51)
- l = [lambda n : n ** 2, lambda n : n ** 5, lambda n : n ** 10, lambda n : 2 ** n]
- names = ["n ** 2", "n ** 5", "n ** 10", "2 ** n"]
- plt.figure(figsize=(18, 8))
- for i in range(len(l)):
- plt.plot(x, func2(x, l[i]), label='{} points'.format(names[i]))
- plt.grid(True)
- plt.legend(prop={'size': 18})
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement