11 Three-pointer vs free-throw probability#

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

khanacademy

Three-pointer vs free-throw probability fig 1

ft = np.arange(1, 101, 1)
def P(cond, total_lst):
    cond_lst = list(filter(cond, total_lst))
    return len(cond_lst) / len(total_lst), cond_lst
def P_in_a_row(p, n):
    return p**n
p_ft, _ = P(lambda x: x <= 75, ft)
P_in_a_row(p_ft, 3)
0.421875