有10位整数 我想让他➗450 求余数小于95的概率
在接着上面的 我把10位数前面3位固定后面7位随机 求概率
这程序有什么设计思路吗有的吧代码写在评论区
概率应该是收敛到95/450
的,固定的前三位自己加上
import numpy as np
import matplotlib.pyplot as plt
x = list(range(1, 5001))
y = [np.sum(np.random.randint(10**6, 10**7, i) % 450 < 95)/i for i in x]
plt.plot(x, y)
plt.show()