#mean of a list
x = [3, 5, 7, 9, 11]
np.mean(x)
#standard deviation of list
np.std(x)
#Binomial distribution with n = 20, p = 0.5
b = stats.binom(20, 0.5)
#mean
b.mean()
#plot
plt.bar(range(21), b.pmf(range(21)))
#another example
#Binomial n = 50, p = 0.3
ex2 = stats.binom(50, 0.3)
ex3 = stats.binom(20, 0.3)
#mean
ex2.mean()
ex3.mean()
ex3.std()
#deviation
ex2.std()
#plot
plt.bar(range(51), ex2.pmf(range(51)))
plt.bar(range(21), ex3.pmf(range(21)))