Day 4: Normal Distribution #1

  • + 0 comments

    Can I use random package instead?

    import random
    
    mu = 30
    sigma = 4
    n = 1_000_000
    
    a = [random.gauss(mu, sigma)<40 for i in range(n)]
    a = round(sum(a)/n, 3)
    
    b = [random.gauss(mu, sigma)>21 for i in range(n)]
    b = round(sum(b)/n, 3)
    
    
    c = [30 < random.gauss(mu, sigma) < 35 for i in range(n)]
    c = round(sum(c)/n, 3) 
    
    print(a)
    print(b)
    print(c)