• + 0 comments

    Answer:

    # Enter your code here. Read input from STDIN. Print output to STDOUT
    import math
    def get_function(x):
        mu = 70
        sig = 10
        gaussian_func = (1 / (sig * math.sqrt(2 * math.pi))) * math.exp(-((x - mu) ** 2) / (2 * sig ** 2))
        return gaussian_func
    
    start_value = 20
    end_value = 120
    step = 0.0001
    
    x = [start_value + i * step for i in range(int((end_value - start_value) / step) + 1)]
    y0 = 0
    y1 = 0
    y2 = 0
    y3 = 0
    
    for i in range(len(x)):
        y0 += get_function(x[i]) * step
        if x[i] > 80:
            y1 += get_function(x[i]) * step
    
        if x[i] >= 60:
            y2 += get_function(x[i]) * step
    
        if x[i] < 60:
            y3 += get_function(x[i]) * step
    
    y1 = y1 * 100 / y0
    y2 = y2 * 100 / y0
    y3 = y3 * 100 / y0
    
    result1 = round(y1, 2)
    result2 = round(y2, 2)
    result3 = round(y3, 2)
    
    print(str(result1))
    print(str(result2))
    print(str(result3))