Probability And Statistics 6 Hackerrank Solution Page

The sum ~ Normal(mean_sum = n*μ, std_sum = sqrt(n)*σ)

import math def normal_cdf(x, mean, std): """Cumulative probability P(X <= x) for N(mean, std)""" z = (x - mean) / std return 0.5 * (1 + math.erf(z / math.sqrt(2))) mean, std = 20, 2 x1, x2 = 19.5, 22 1. P(X <= x1) p1 = normal_cdf(x1, mean, std) 2. P(X >= x2) p2 = 1 - normal_cdf(x2, mean, std) 3. P(x1 <= X <= x2) p3 = normal_cdf(x2, mean, std) - normal_cdf(x1, mean, std) probability and statistics 6 hackerrank solution

If you're working through HackerRank's 10 Days of Statistics or their Probability and Statistics challenges, Problem 6 usually introduces the Normal Distribution (Gaussian Distribution) and sometimes the Central Limit Theorem (CLT) . The sum ~ Normal(mean_sum = n*μ, std_sum =

Leave a Reply