Sort by

recency

|

47 Discussions

|

  • + 0 comments
    #py
    m, std, n, z=500, 80, 100, 1.96
    me=z*(std/n**.5)
    print(round(m-me, 2), round(m+me, 2), sep='\n')
    
  • + 0 comments

    Solution:

    import math as m
    mn, std, z = 500*100, 80*m.sqrt(100), 1.96
    A, B = (mn-z*std)/100, (mn+z*std)/100
    print(f'{A:.2f}\n{B:.2f}')
    

    Check:

    def cdf(mn, std, x):
        return 1/2 * (1 + m.erf((x-mn)/(std*m.sqrt(2))))
    print(f'{cdf(mn, std, B*100) - cdf(mn, std, A*100):.2f}')
    
  • + 0 comments
    int n = 100;
    double meanN = 500;
    double stdDevN = 80;
    double z = 1.96;
    
    double stdDev = stdDevN / Math.sqrt(n);
    double delta = z * stdDev;
    
    print(meanN - delta);
    print(meanN + delta);
    
  • + 0 comments

    JS

     let arr = input.split(/[\n]/g);
         let a = parseFloat(arr[1]) - parseFloat(arr[4]) * parseFloat(arr[2]) / Math.sqrt(parseInt(arr[0]));
         let b = parseFloat(arr[1]) + parseFloat(arr[4]) * parseFloat(arr[2]) / Math.sqrt(parseInt(arr[0]));
         console.log(a.toFixed(2));
         console.log(b.toFixed(2));
    
  • + 0 comments
    import math
    
    sample_size = int(input())
    mean_pop = float(input())
    std_dev = float(input())
    dist_perc = float(input())
    z = float(input())
    
    A = mean_pop - z*std_dev/math.sqrt(sample_size)
    B = mean_pop + z*std_dev/math.sqrt(sample_size)
    
    print(round(A, 2))
    print(round(B, 2))