18 Binomial probability example#

%%html
<iframe width="700" height="400" src="https://www.youtube.com/embed/Ctytn4a6zjw/" 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

Binomial probability example fig 1

# find a way to code this too
# review combination
s = np.random.binomial(1, 0.7, 6) # don't know if that the right way, though
s
array([1, 1, 1, 0, 1, 1])
p = special.comb(6, 2) * 0.7**2 * 0.3**4
round(p * 100)
6