You are viewing a single comment's thread. Return to all comments →
import math mu = 20 sigma = 2 x_1 = 19.5 x_2_a = 20 x_2_b = 22 # P(X <= x) = 0.5 * (1+math.erf((x - mu)/(sigma * 2**0.5))) p_less_than_19_5 = 0.5 * (1+math.erf((x_1 - mu)/(sigma * 2**0.5))) print(round(p_less_than_19_5,3)) # (a <= X <= b) = F(b) - F(a) p_between_20_and_22 = 0.5 * (1+math.erf((x_2_b - mu)/(sigma * 2**0.5))) - 0.5 * (1+math.erf((x_2_a - mu)/(sigma * 2**0.5))) print(round(p_between_20_and_22, 3))
Seems like cookies are disabled on this browser, please enable them to open this website
Day 5: Normal Distribution I
You are viewing a single comment's thread. Return to all comments →