Uploaded by Kenneth Skelton

Homework 3 problem 1-2

advertisement
All the code I used is in the submitted files
3.1
a) x and y are both uniformly distributed between [0,1] so the process to generate them
is simply x = np.random.rand() and y = np.random. rand()
Z can then be derived using a function like this:
b) a result of my simulation found a 95% confidence interval to be [3.118, 3.314]
c) a result of my simulation found a 95% confidence interval with antithetic variables to be
[3.113, 3.235]
3.2
a) numpy lets you create uniform and triangular distributions with a function and some
parameters:
L/D is uniform between 15 and 18 so it can be generated like this
Wi/Wf is ramp_up with lower bound 1.3, upper bound 1.3, and mode 1.5 which really means it
is triangular with lower bound 1.3, upper bound 1.3, and mode 1.5
It can also be calculated differently, the CDF of a ramp up is y = ((x-a)/(b-a))^2
Inverting this function gives x = (sqrt(y) * (b-a)) + a so the function can also be implemented like
this
b) the variable R can be computed like this, with function calls to the other random variables
c) i.
ii,iii,iv
3.3
Random Variable D for demand has pdf:
a)
the x axis is X and the y axis is f(x), the points where the function meet the x axis are (40,0) and
(90,0). The maximum is (70, 1/25)
b) The design variable is how many cases of cookie boxes Sven should buy, I will use C for cases
to represent it
c) Sven seeks to maximize his profit which I will call P
the function can be represented with:
From Problem:
sellPrice = 12
discountPrice = 3
buyPrice = 10
#BoxesInCase = 10
P=
{
(C * #BoxesInCase * sellPrice) – (C * #BoxesInCase * buyPrice)
| D >= C*#BoxesInCase
((D*sellPrice) + (C * #BoxesInCase – D) * discountPrice)) - (C * #BoxesInCase * buyPrice)
| D < C*#BoxesInCase
}
d, e)
Cases is the design variable and will be passed to the function as a parameter
f) Based on my simulation the best number of cases to buy is either 5 or 6. According to my
data 6 cases slightly outperforms 5 cases, by ~10 dollars (6: ~$105, 5: ~$95) but 6 also has a
much higher standard deviation of ~$30 compared to 5’s ~$10. This means that 6 may
drastically outperform 5 in some scenarios but can also underperform whereas 5 is relatively
more consistent. Personally I would err on the side of caution with 5 cases and that would be
my personal recommendation to Sven, however an argument can be made for both. Charts on
the next page:
Download