Problem:
A pharmacy has a uniform annual demand for 200 bottles of a certain antibiotic. It costs \$10 per year for a storage place for one bottle, and $40 to place an order. How many times during the year should the pharmacy order the antibiotic in order to minimise total cost?
$ $
Example 1: If you use 4 orders of 50 bottles each you need 50 storage places.
Cost of ordering is $4(40) = 160$
Total Cost is $4(40)+50(10)= 660$
Example 2: If you use 10 orders for 20 bottles each, you need only 20 storage places, but it costs more to order:
Cost of ordering is $10(40) = 400 > 160$
Total Cost is $10(40)+20(10) = 600$
It seems that we must minimize
$$C(x,y) = 10x+40y$$
s.t. $200=xy$
I can change it to one variable, use Lagrange or something.
My professor gave this hint:
Use \$5 per storage place instead of $10. The reasoning is that some bottles will get used right away, and some need to be stored the full time.
Something like 5 is the median of 0 and 10.
So apparently
$$C(x,y) = \color{red}{5}x+40y$$
Why?
Note: The minimisations will be different:
http://www.wolframalpha.com/input/?i=Minimise+5x%2B40(200%2Fx) http://www.wolframalpha.com/input/?i=Minimise+10x%2B40(200%2Fx)
Assuming your inventory is depleted linearly (at a constant rate), you will make an order, which will put $x$ bottles in your inventory, it will deplete down to 0, and you reorder, to fill your inventory back up to $x$ (the order is immediately filled), and the cycle repeats.
When the inventory is full, you're paying to store $x$ items, but when it starts getting low, you're only paying to store fewer items.
Since the inventory drops at a constant rate, the average number of bottles of pills in your inventory at any given time will be half of x. Think about it: for the first half of the time you're using an inventory it's above half capacity, then the second half is below half capacity (and decreasing in a straight line). So, on average, the inventory cost is actually $10\left(\frac{x}{2}\right)$, or $5x$.
Your total cost is $C(x,y) = 5x + 40y$ because you have to pay the average storage cost (\$5) for each item in the inventory and pay \$40 for each order you make. You'll make $\frac{200}{x} orders, so you just need to minimize
\begin{align} C(x) = 5x + \frac{8000}{x} \end{align}
so that
\begin{align} C'(x) = 5 - \frac{8000}{x^2} \end{align}
Then we can minimize as
\begin{align} 5 - \frac{8000}{x^2} &= 0 \\5 &= \frac{8000}{x^2} \\5x^2 &= 8000 \\x^2 &= 1600 \\x &= 40 \end{align}
so you should make 5 orders of 40 items each per year.