# Discrete Optimization Question

1. Feb 13, 2013

### gajohnson

1. The problem statement, all variables and given/known data

9. This is a simplified inventory problem.Suppose that it costs c dollars to stock an item and that the item sells for s dollars. Suppose that the number of items that will be asked for by customers is a random variable with the frequency function
p(k). Find a rule for the number of items that should be stocked in order to maximize the expected income. (Hint: Consider the difference of successive terms.)

2. Relevant equations

3. The attempt at a solution

Ok, so I've determined an income (I assume they're getting at profit here when they say income, so we'll go with that) random variable as follows:

$Y_n = s(min\left\{n, k\right\}) - cn$ where $n$ is the number of items stocked and $k$ is the number of items demanded.

So from here I understand that I need to find the expected value of Y, and then determine the first $n$ at which $E(Y_n+1)-E(Y_n) < 0$.

However, to begin, I'm not sure how to find $E(Y_n)$ in general. Namely, how do I deal what that min function? Thank you!

2. Feb 13, 2013

### Ray Vickson

I would rather call the order size something simple, like x, instead of your complicated $Y_n$: the "n" subscript has no useful purpose, and in problems of this type we usually try to stick to the convention that capital letters stand for random variables, while lower-case letters are realizations of random variables, or parameters, or decision variables.

So, if you order x items and demand is k (with probability p(k)), what is the cost, and what is the revenue from sales? Go at it piece-by-piece: if k <= x what is the revenue? If k > x, what is the revenue? Now you have a revenue expression for each k, and so you can compute the expected value of revenue.

So, you get the expected profit EP(x) = expected revenue - cost, for an order of size x; it will be an expression involving a summation over k. You need to actually write out this expression in detail. In this case the order sizes are discrete, so you need to look at the difference EP(x+1) - EP(x), to see whether or not you should increase x. That difference has some relation to the demand cumulative distribution function F(x) = Ʃ{p(k): k ≤ x}, but to see that you need two write out everything explicitly (or, at least, that is the easiest way of seeing the relationship).

3. Feb 13, 2013

### gajohnson

Ok thanks, this has helped me visualize it quite a bit better!

However, a question on one point. Isn't the revenue if k>x just 0? The intuition being that you can't sell items you haven't stocked, even if there is demand for them.

Wouldn't that make $EP(x) = \sum^{x}_{k=0}k(p(k)) - cx$ ?

4. Feb 13, 2013

### gajohnson

Correction: $EP(x) = \sum^{x}_{k=0}sk(p(k)) - cx$

5. Feb 13, 2013

### Ray Vickson

So, if they stock 100 units and demand is 150, their revenue becomes zero? What happened to the revenue they got from selling all 100 units?

6. Feb 13, 2013

### gajohnson

Sorry, that wasn't clear. I meant the revenue earned for only those k>x is 0, while of course the rest of the revenue earned for all k≤x remains.

Is there something missing from my attempt at the expected profit?

7. Feb 13, 2013

### Ray Vickson

Well, yes. Your expression gives zero for the revenue they got on the first 100 units.

8. Feb 13, 2013

### gajohnson

For some reason I'm having a hard time seeing this (please excuse my obtuseness right now). Since you can't sell more items than you've stocked, what is the issue with only summing k from 1 to x? Any amount demanded beyond x earns no extra revenue, so why should those values of k be in the expression? Thanks!

9. Feb 14, 2013

### gajohnson

Ok, I took a different tack and arrived at this:

$EP(x) = s\left(\sum_{k=1}^x kp(k) + x\sum_{k=x+1}^{+\infty} p(k) \right) - cx$

This is looking better to me, anyway. I got here taking the expected value of my original "income variable." For some reason that made more sense to me. Is this expression looking to be on the right track, at least?

10. Feb 14, 2013

### Ray Vickson

Exactly! When demand > x they sell x, so the total probability of selling x is $P(D \geq x)$.

11. Feb 15, 2013

### gajohnson

Got it, thanks for all your help!