Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rom matplotlib import pyplot as plt
- from math import factorial
- p = .2 # add your code here: what is the probability of drawing up a contract?
- n = 30 # add your code here: how many companies will we negotiate with?
- distr = [] # add your code here: create a variable for the distribution value
- for k in range(0, n+1):
- c = factorial(n)/(factorial(k) * factorial(n-k))
- prob = c * p**k * (1-p)**(n-k)
- distr.append(prob)
- plt.bar(
- range(0, n+1),
- distr
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement