← 返回题库
中级

二项分布

未完成
中级参考 代码结构已给出,请填写 ____ 处
def solve():
    import numpy as np
    import matplotlib.pyplot as plt
    np.random.seed(____)
    n_trials = ____
    n_flips = ____
    results = np.random.binomial(____)
    plt.figure(figsize=(____, ____))
    plt.hist(results, bins=range(____), edgecolor='____', alpha=____, density=True)
    plt.xlabel(____)
    plt.ylabel(____)
    plt.title(____)
    plt.grid(____)
    plt.show()

示例

输入
solve()
期望输出
奇异值分解:
U:
[[-0.70710678 -0.70710678]
 [-0.70710678  0.70710678]]
奇异值: [5.4649857  0.36596619]
Vt:
[[-0.40455358 -0.9145143 ]
 [-0.9145143   0.40455358]]
Python 代码 🔒 登录后使用
🔒

登录后即可练习

注册免费账号,在浏览器中直接运行 Python 代码