Sort by

recency

|

9 Discussions

|

  • + 0 comments

    This question is more about normal distrinution property , rather than CLT property .

  • + 0 comments

    74+11(47-X)<20 X>51.91 Then apply P(X>51.91) on a normal distribution of N(50,10/sqrt(11)), and you'll get 0.2632

  • + 0 comments

    If we start with 74,000 gallons and need to have at least 20,000 gallons after 11 weeks, then we cannot afford to lose more than (74,000 - 20,000)/11 each week.

    We also know that if we sell on average 50,000 gallons each week and add a constant 47,000 gallons each week, then on average we can expect to lose 3,000 gallons each week.

    Now knowing that on average we will lose 3,000 gallons each week, what is the probability we will lose more than (74,000-20,000)/11 each week?

  • + 0 comments
    import math
    def cdf(x, mu, sigma):
        return 0.5 + math.erf((x-mu)/(sigma*2**0.5))*0.5
    
    mu = 50000
    sigma = 10000
    
    weeks=11
    start = 74000
    weekly = 47000
    end = start + weekly*weeks
    lower_bound = end - 20000
    
    sum_mu = weeks*mu
    sum_sigma = weeks**0.5*sigma
    
    print('{:0.4f}'.format(1-cdf(lower_bound, sum_mu, sum_sigma)))
    
  • + 0 comments

    The distribution of the remaining supply is really not normal anymore and is only positive since you clearly cant have a negative balance. My approach is to explicitly simulate the weekly remainder but having a check for less than 0 remainder, in which case, I force it to take the weekly delivered amount as the left over amount for that week.

    remainder = 0
    num_exp=100000
    delivery = 47
    res = []
    for exp in range(1,num_exp):
        start = 74
        remainder = start
        for week in range(1,12):
            remainder = remainder - np.random.normal(50, 10)
            if (remainder <=0):
                remainder = delivery
            else:
                remainder += delivery
        res.append(remainder)