#coding:utf-8
from scipy.stats import binom  
import matplotlib.pyplot as plt  
import numpy as np  

#样本数目
n = 200
#发生的概率
p = 0.01
#发生的次数
k = np.arange(0,15)
binomial = binom.pmf(k, n, p)  
  
plt.plot(k, binomial, 'o-')  
plt.title('Binomial: n = %i, p=%0.3f' % (n, p),fontsize = 15)
plt.xlabel('Number of hit')
plt.ylabel('Probability of hit', fontsize = 15)
plt.show()  

伯努利分布

 

相关文章:

  • 2021-08-18
  • 2021-09-07
  • 2021-06-02
  • 2021-04-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
相关资源
相似解决方案