You are viewing a single comment's thread. Return to all comments →
import math mean = 20 std = 2 def calc_prob(lower_bound, upper_bound=None): if upper_bound is None: prob = 0.5 * (1 + math.erf((lower_bound - mean) / (std * math.sqrt(2)))) else: prob = 0.5 * (math.erf((upper_bound - mean) / (std * math.sqrt(2))) - math.erf((lower_bound - mean) / (std * math.sqrt(2)))) return prob print(round(calc_prob(19.5), 3)) print(round(calc_prob(20,22), 3))
Seems like cookies are disabled on this browser, please enable them to open this website
Day 4: Normal Distribution #2
You are viewing a single comment's thread. Return to all comments →