In [1]:
def joint_probability_of_independent_events(list_of_events):
prob = 1
for x in list_of_events:
prob = prob * x
return prob
In [2]:
def flip_conditional_probabilities(base_rate, accuracy_rate):
numerator = (accuracy_rate * base_rate)
denominator = numerator + ((1-base_rate)*(1-accuracy_rate))
print(numerator)
print(denominator)
return(numerator/denominator)
flip_conditional_probabilities(.1, .95)
Out[2]:
In [3]:
def prob_drunk_given_pos(base_rate, probab_pos_drunk, prob_pos_sober):
numerator = (probab_pos_drunk * base_rate)
denominator = numerator + ((1-base_rate)*(prob_pos_sober))
print(numerator)
print(denominator)
return(numerator/denominator)
In [5]:
prob_drunk_given_pos(.1, .95, .05)
Out[5]:
In [ ]: