25 Finding the mean and standard deviation of a binomial random variable#

%%html
<iframe width="700" height="400" src="https://www.youtube.com/embed/gro5b3PZ-Bw/" frameborder="0" allowfullscreen></iframe>
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats, special

khanacademy

Finding the mean and standard deviation of a binomial random variable fig 1

stats.binom.mean(500, 0.02)
10.0
stats.binom.var(500, 0.02)
9.8
stats.binom.std(500, 0.02)
3.1304951684997055
np.sqrt(stats.binom.var(500, 0.02))
3.1304951684997055