# Thread: Maximization question involving normal distribution.

1. ## Maximization question involving normal distribution.

The cost of keeping a unit of inventory is a.
The cost of being short a unit is b.
b>a
The expected demand is normally distributed with mean m and std. dev. c.

I'm trying to find a formula for the optimum amount of inventory.

I'm currently plugging in values for q in the following formula:
aq+b*Integral of(normal distribution*(x-q)) from q to infinite

q is the inventory in excess of the expected demand.

Is this correct? If so, what would the derivative of this formula be so I can find the maximum.

2. Originally Posted by bob000
The cost of keeping a unit of inventory is a.
The cost of being short a unit is b.
b>a
The expected demand is normally distributed with mean m and std. dev. c.

I'm trying to find a formula for the optimum amount of inventory.

I'm currently plugging in values for q in the following formula:
aq+b*Integral of(normal distribution*(x-q)) from q to infinite

q is the inventory in excess of the expected demand.

Is this correct? If so, what would the derivative of this formula be so I can find the maximum.
Let the stock holding he $q$ and the demand $u$. The the cost is:

$c(q)=aq+b\, p(u>q)$

or:

$\displaystyle c(q)=aq+b\, \left(1-\dfrac{1}{\sqrt{2\pi} c}\int_{-\infty}^q e^{-\frac{(u-m)^2}{2c^2}}\;du\right)$

so:

$c'(q)=a-\dfrac{b}{\sqrt{2\pi}c}e^{-\frac{(q-m)^2}{2c^2}}$

CB

3. I don't think this is correct:

The cost of shortage is b for EACH unit you are short.

4. Originally Posted by CaptainBlack
Let the stock holding he $q$ and the demand $u$. The the cost is:

$c(q)=aq+b\, p(u>q)$

or:

$\displaystyle c(q)=aq+b\, \left(1-\dfrac{1}{\sqrt{2\pi} c}\int_{-\infty}^q e^{-\frac{(u-m)^2}{2c^2}}\;du\right)$

so:

$c'(q)=a-\dfrac{b}{\sqrt{2\pi}c}e^{-\frac{(q-m)^2}{2c^2}}$

CB
Originally Posted by bob000
I don't think this is correct:

The cost of shortage is b for EACH unit you are short.
OK so that changes $c(q)$ to:

$\displaystyle c(q)=aq+b \int_{u=q}^{\infty}(u-q)p(u)\;du$

........ $\displaystyle =aq+b \int_{u=q}^{\infty}u\, p(u)\;du-b\,q \int_{u=q}^{\infty}p(u)\;du$

So (if I have done the derivative correctly):

$\displaystyle c'(q)=a-b \int_{u=q}^{\infty}p(u)\;du$

and so the stationary point (maximum presumably) is:

$q=P^{-1}_{m,c}(1-\frac{a}{b})$

where $P_{m,c}(.)$ is the cumulative normal distribution function of a normal RV $\sim N(m,c^2)$.

Then in terms of the standard normal cumulative distribution function:

$q=m+cP^{-1}_{0,1}(1-a/b)$

(Check that to make sure it is correct. for $a/b$ close to zero it will still give a negative $q$, but that is because with a normal distribution there is always a finite probability of negative sales)

The above may still have errors you will have to check it, but the key idea is the use of the fundamental theorem of calculus:

$\displaystyle \dfrac{d}{dx} \left( \int_a^x f(\xi)\; d\xi \right)=f(x)$

and/or:

$\displaystyle \dfrac{d}{dx} \left( \int_x^a f(\xi)\; d\xi \right)=-f(x)$

CB

5. If a>.5b then the value inside of is less than .5 and the value of q is less than 0. But if the cost of inventory is less than the cost of shortage (a<b), we know that optimal inventory I=m+q must be at least the expected demand m. Am I misunderstanding something?

Thank you for the time you've spent so far btw.

6. Originally Posted by bob000
If a>.5b then the value inside of is less than .5 and the value of q is less than 0. But if the cost of inventory is less than the cost of shortage (a<b), we know that optimal inventory I=m+q must be at least the expected demand m. Am I misunderstanding something?

Thank you for the time you've spent so far btw.
Did you read the caveats about checking as there may still be errors in the algebra?

Think $P(.)$ is the cumulative normal distribution function for a RV $\sim N(m,c^2)$

or see the modified earlier post.

CB