0 points

Plot a Binomial distribution for a list of numbers


PHOTO EMBED

Wed Feb 03 2021 14:58:45 GMT+0000 (UTC)

Saved by @fre_apples #python

import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt

def bin_dist():
    test_list = [10, 100, 1000, 10000]
    for i in test_list:
        x = np.random.binomial(n=i, p=0.5, size=i)
        print('--',i,'--')
        sns.distplot(x)
        plt.show()
        
bin_dist()
content_copyCOPY

Try to plot a Binomial distribution for each n in [10, 100, 1000, 10000] and a constant p = 0.5.