You are on page 1of 16

ISyE 3232C

YL. Chang

Stochastic Manufacturing and Service Systems

Fall 2015

Newsvendor
Single period decision making for perishable products
Dealing with the demand uncertainty
Let
D: the demand of each period (Random, the distribution is known)
y: ordering quantity
Cv : buying price of one item from the supplier (variable cost)
Cp : selling price of one item to the customer.
Cs : the salvage value of each leftover item. Salvage value can be positive or negative.
We assume Cs < Cv and Cp > Cv .
Suppose the Demand follows the following distribution:
d

10

15

20

25

30

P[D = d]

1/8

1/8

1/8

1/8

1/4

1/4

Although we know the distribution, we dont know what the demand is exactly on each day. This is the
uncertainty we have to face.
Assume Cv = $0.25, Cp = $1.00, Cs = $0.00.
What is our objective? What is an optimal decision?
We first focus on maximize long-run average profit per day. Later on, we will also want to minimize long-run
average cost per day.
Lets explore the option that we order y = 25 copies flat every day.
Day
D
Product cost
# of sold item
Dy
# of unsold item
(y D)+
lost sale
(D y)+
Sale Rev.
Cp (D y)
Salvage Rev.
Cs (y D)+
Profit

1
10
25*0.25 = 6.25

2
25
25*0.25 = 6.25

3
15
25*0.25 = 6.25

4
5
25*0.25 = 6.25

5
30
25*0.25 = 6.25

10

25

15

25

15

10

20

10

25

15

25

10+0-6.25
=3.75

25+0-6.25
=18.75

15+0-6.25
=8.75

5+0-6.25
=-1.25

25+0-6.25
=18.75

Important Quantities:
# of sold item: D y;
# of unsold item: (y D)+ , y (D y);
lost sale: (D y)+ ;
Show that y = (D y) + (y D)+ .
Proof:
If D y, then (D y) + (y D)+ = y + 0 = y.
If D < y, (D y) + (y D)+ = D + y D = y.
Profit = Revenue - Cost
= (Sale Rev. ) + (Salvage Rev. ) - (Product Cost)
Profit(D, y) = Cp (D y) + Cs (y D)+ Cv y
= (Cp Cv )(y D) (Cv Cs )(y D)+
= money I earn - money i lose
Cp Cv : profit margin of each sold item
Cv Cs : loss of each leftover item
You can see on some day, you can make profit; on some other days, you lose money by using this policy.
The average profit over 100 days would be
1
(3.75 + 18.75 + 8.75 + (1.25) + 18.75 + ...)
100
Let Pn be the profit of day n and
Pn (D, y) =

1
(P1 + P2 + P3 + ... + Pn )
n

where Pn (D, y) be the average profit over n days, given the demand D and ordering quantity y.
Theorem 1 (Strong law of large numbers): Assume that demand of a day is independent and identically
distributed (i.i.d.) and the order is constant. Then the long-run average profit converges to the expected profit
for a single period with probability 1.
1
(P1 + P2 ... + Pn ) = E[P1 ]} = 1.
n n

P { lim
Hence, we want to maximize

max g(y) = E[P (D, y)] = (Cp Cv )E[y D] (Cv Cs )E[(y D)+ ]
y

= Cp E[y D] + Cs E[(y D)+ ] Cv y


Remark:
(1) Expected profit is relevant only when the system is managed repeatedly over many period.
(2) If you manage the system for only one or a few periods, maximizing the expected profit may not make
sense.
(3) In this setting, the optimal order quantity y that maximizes g(y) should be used for every period.

Finding out the optimal order quantity y :


Let F (x) be the cumulative distribution function of demand D:
F (x) = P (D x)
For the following derivation, let us assume demand D is a continuous random variable with pdf f (x). Then,
Rx
(1) F (x) = 0 f (y)dy ;
R
Ry
R
Ry
Ry
(2) E[y D] = 0 (y x)f (x)dx = 0 xf (x)dx + y yf (x)dx = 0 xf (x)dx + y(1 0 f (x)dx)
R
Ry
R
Ry
(3) E[(y D)+ ] = 0 f (x)(y x)+ dx = 0 f (x)(y x)dx + y f (x) 0dx = 0 f (x)(y x)dx
Hence, the profit function is:
g(y) = (Cp Cv )E[y D] (Cv Cs )E[(y D)+ ]
Z y
Z y
Z y
f (x)(y x)dx
f (x)dx)] (Cv Cs )
xf (x)dx + y(1
= (Cp Cv )[
0
0
Z 0y
Z y
Z y
Z y
= (Cp Cv )
xf (x)dx + (Cp Cv )y (Cp Cv )y
f (x)dx (Cv Cs )y
f (x)dx + (Cv Cs )
xf (x)dx
0
0
0
Z 0y
Z y
= (Cp Cs )
xf (x)dx (Cp Cs )y
f (x)dx + (Cp Cv )y
0
0

Set g (y) = 0 to find y using a theorem from calculus.


Theorem 2 (Fundamental Theorem of Calculus): For a function, H(y) =
h(y), where c is a constant.

Ry
c

h(x)dx, we have H 0 (y) =

Then
Z

g (y) = (Cp Cs )yf (y) (Cp Cs )yf (y) (Cp Cs )

f (x)dx + (Cp Cv )
0

= (Cp Cs )F (y) + Cp Cv
Setting g 0 (y ) = 0, we get
Cp Cv
.
Cp Cs

F (y ) =

To verify g(y ) is indeed maximum, take the second derivative.


g 00 (y) = (Cp Cs )f (y) < 0
implying that g(y) is concave. Hence, g(y ) must be the maximum.
If D is a discrete random variable in {d0 , d1 , d2 , ...} with pmf P [D = di ] = pi
d
P (D = d)

d0
p0

d1
p1

d2
p2

...
...

P
Then F (x) = P (D x) = i pi . Following the same procedure, for discrete D, an optimal order quantity
y is the smallest y such that
Cp Cv
F (y)
Cp Cs
Remark: Because D can only take values in d0 , d1 , d2 , ..., the above y must be one of di s.

Summary of solution to the Newsvendor profit problem:


(1) If D is continuous r.v., choose y such that
F (y ) =

Cp Cv
,
Cp Cs

(2) If D is discrete r.v., choose y to be the smallest y such that


F (y )

where

Cp Cv
Cp Cs

Cp Cv
.
Cp Cs

is called critical ratio.

Examples:
(1) Discrete Demand D:

20

25

30

35

P [D = d]

0.1

0.2

0.4

0.3

F (d)

0.1

0.3

0.7

Cp = 1, Cv = 0.25, Cs = 0.
F (y )

Cp Cv
1 0.25
= 0.75.
=
Cp Cs
10

Hence, y = 35.
(2) Discrete Demand D :

10

P [D = d]

0.5

0.5

Cp = 2, Cv = 1, Cs = 0.
F (y )

Cp Cv
21
=
= 0.5.
Cp Cs
20

Hence, y = 0.

(3) Continuous demand:


Assume you are selling milk D U (20, 40) gallons.
retail price: $2/gallon
purchase cost: $1/gallon
salvage cost: $0.5/gallon
(a) What is the optimal order quantity?
F (y ) =
Hence,

2
3

y 20

4020 , y

Cp Cv
21
=
= 2/3.
Cp Cs
2 0.5

= 100/3.

(b) What is the optimal expected profit?


E[P rof it] =g(y )
= (Cp Cv )E[y D] (Cv Cs )E[(y D)+ ]
= E[Rev.] E[Cost]
= E[Sale Rev.] + E[Salvage Rev.] E[Material cost]
= Cp E[# of sold] + Cs E[# of unsold] Cv E[total # of items]
100
100
100
] + 0.5E[(
D)+ ] 1
= 2E[D
3
3
3
Z 40
Z 100/3
Z 40
100
1
100 1
100
E[D
]=
) dx =
[
dx]
(x
xdx +
3
3
20
20
20
20
100/3 3
Z 40
Z 100/3
Z 40
Z 100/3
100
1
1
100
100
100
1
E[(
D)+ ] =
(
x)+ dx =
[
(
x)dx +
(
x)dx
0dx] =
100
3
3
20
20
3
20
3
20
20
20
3

(4) The selling price of lettuce salad is $6, the buying price of one unit of lettuce is $1. Leftover lettuce of
a day cannot be used for future sale, and you have to pay 50 cents per unit of lettuce for disposal.
(a) What is the optimal order quantity?
Note, Cs = 0.5, negative salvage value.
F (y ) =

Cp Cv
Cp Cs

(b) What is the optimal expected profit?


E[P rof it] = E[Sale Rev.] + E[Salvage Rev.] - E[Material Cost] = 6E[y D]0.5E[(y D)+ ]1y
Salvage Rev. becomes a cost.

Cost Problem
Profit Problem

Cost Problem

D demand
Cp selling price

Cu understock cost

Cs salvage value

Co overstock cost (e.g. holding cost)

Cv purchasing price from supplier

production cost for each item

Recall, our profit function


Profit(D, y) = Cp (D y) + Cs (y D)+ Cv y
Now assume ideally, all demand D is met, so Cp D is the potential revenue. but you are penalized with some
cost. Observe
D = (D y) + (D y)+
Then
Profit(D, y) = Cp (D (D y)+ ) + Cs (y D)+ Cv y
= Cp D [Cv y + Cp (D y)+ Cs (y D)+ ]
= Cp D [Cv y + Cu (D y)+ + Co (y D)+ ]
where Co = Cs .
The cost function is
Cost(D, y) = Cv y + Cu (D y)+ + Co (y D)+
= Manufacturing cost + Understock cost + Overstock cost
Objective: Decide the optimal order quantity y such that expected total cost is minimized. Newsvendor
cost solution is aiming at balancing Understock cost and Overstock cost.
Note, if y optimizes cost function, then y optimizes profit function. Similarly, if y optimize profit function,
then y optimize cost function. Since
arg max E[P rof it(D, y)] = arg max[E(Cp D) E[Cost(D, y)]]
y

= arg max[E(Cost(D, y))] = arg min E[Cost(D, y)]


y

Hence, the profit problem and cost problem are equivalent.


Summary of solution to the Newsvendor cost problem :
(1) If D is continuous r.v., choose y such that
F (y ) =

Cu Cv
,
Cu + Co

(1)

(2) If D is discrete r.v., choose y to be the smallest y such that


F (y )

Cu Cv
.
Cu + Co

(2)

Cost problem with nonzero initial inventory (x) and nonzero fixed cost (Cf )
D demand
Cu understock cost
Co overstock cost
Cv unit production cost
Cf fixed operation cost
Cost function = Manufacturing cost + understock cost + overstock cost
Cost(D, y) = Cf + Cv y + Cu (D y)+ + Co (y D)+
Since fixed cost Cf is constant, it does NOT affect the optimal production quantity. Hence, the optimal
production quantity is still:
(1) If D is continuous r.v., choose y such that
F (y ) =

Cu Cv
,
Cu + Co

(2) If D is discrete r.v., choose y to be the smallest y such that


F (y )

Cu Cv
.
Cu + Co

Remark:
(1) If Cu = Cv , order nothing
(2) If Cu >> Cv , order as many as you can.
Fixed cost Cf : We implicitly assume that we should order when Cf = 0 when we first look at the cost
problem. However, if Cf > 0, especially when it is very expensive to place an order (e.g. setting up a new
production line), we may not want to order.
Existing Inventory x: We implicitly assume that we should order when we have no inventory when placing
order (e.g. x = 0) before.
Now suppose y = 500:
(1) You have 499 units in your warehouse, then you should order 1 unit(s) if Cf = 0.
(2) You have 600 units in your warehouse, then you should order 0 unit(s) if Cf = 0.
(3) You have x units in your warehouse, then you should order (y x)+ unit(s) if Cf = 0.
Hence, we say y in previous section is in fact the optimal order-up-to/production-up-to quantity. It
means if you want to order, then you should order up to y .
Moreover, assume y = 500 and you have 499 units in your inventory, and the fixed order cost is very large.
Then you may want to stay with your current inventory and accept the understock cost.
Hence, we have two options when nonzero inventory (x) and nonzero fixed cost (Cf ).
(1) order up to y
(2) order nothing.
8

We must compare the cost for each option, and select the option with the smaller cost.
Summary of solution to the Newsvendor cost problem with nonzero initial inventory (x) and
nonzero fixed cost (Cf ):
(1) Calculate y using solution to standard Newsvendor cost problem (1)-(2).
(2) If x y , order nothing. Otherwise, calculate
expected cost (C1 ) w.r.t order quantity y x;
expected cost (C2 ) when order nothing.
If C1 < C2 , order y x; Otherwise, order nothing.
Examples:
1. Cu = $10, Cv = $4, Co = $2, Cf = $10. Initial inventory x = 13. D has a discrete uniform distribution
on {11, 12, 13, ..., 19, 20}. Should you make order? If so, what is the order quantity to minimize the
expected total cost? The optimal order-up-to quantity y is the smallest y such that
F (y)

Cu Cv
10 4
= 1/2
=
Cu + Co
10 + 2

Hence, y = 15. For x = 13, if you do order, order 2 items to bring order-up-to quantity to 15. In
order to decide whether we should order or not, we evaluate the total cost for two options: order 2
items, or not to order.
(i) If you do not order, the expected cost is
expected cost = Cu E[(D x)+ ] + Co E[(x D)+ ]
1
1
1
28
14
E[(D 13)+ ] = 1 + 2 + ... + 7
=
=
10
10
10
10
5
1
1
3
+
E[(13 D) ] = 2 + 1
=
10
10
10
3
14
= 28 + 0.6 = 28.6
expected cost = 10 + 2
5
10
(ii) If you do make an order, the expected cost is
expected cost = Cf + Cv (y x) + Cu E[(D y )+ ] + Co E[(y D)+ ]
= 10 + 4(15 13) + 10E[(D 15)+ ] + 2E[(15 D)+ ]
= 18 + 2(1) + 10(1.5) = 35
4+3+2+1
E[(15 D)+ ] =
=1
10
1+2+3+4+5
E[(D 15)+ ] =
= 1.5
10
Since 28.6 < 35, you should no order.

2. D U (10, 20), Cu = $10, Cv = $4, Co = $2, Cf = $30. Initial inventory x = 10. Should you make
order? If so, what is the order quantity to minimize the expected total cost?
(i) The optimal order-up-to quantity y satisfies
Cu Cv
10 4
=
= 1/2
Cu + Co
10 + 2

F (y ) =

By uniform random variable, it means that probability density is constant over the range of (10, 20).
The pdf of demand is
(
1
if 10 < x < 20
f (x) = 10
0
otherwise
And CDF:

0
F (x) = 1

x10

2010 ,

Hence,

if x 10
if x 20
if 10 < x < 20

1
y 10
=
20 10
2

y = 15.
(ii) If x = 10, evaluate the costs for two options:
(a) Order nothing:
expected cost = Cu E[(D x)+ ] + Co E[(x D)+ ]
= 10E[(D x)+ ] + 2E[(x D)+ ]
= 10E[D x] + 0 (since D x)
= 10(E[D] x) = 10(15 10) = 50
(b) Order y x = 15 10 = 5 gallons.
expected cost = Cf + Cv (y x) + Cu E[(D y )+ ] + Co E[(y D)+ ]
= 30 + 4(15 10) + 10E[(D 15)+ ] + 2E[(15 D)+ ]
= 50 + 10(1.25) + 2(1.25) = 65
Z 15
1
+
(15 x)dx = 1.25
E[(15 D) ] =
10 10
Z 20
1
E[(D 15)+ ] =
(x 15)dx = 1.25
10 15

Since 65 > 50, we dont want to place the order.

10

We observe:
We should make an order when inventory level is low despite of fixed cost.
We tend not to order when inventory level is high.
There is a break even point where you should order up to y if inventory level is below the break even
point, and order nothing otherwise.
At the break even point, the two options should result in same total expected cost.
(s, S) policy
Definition 1 (s, S) policy is the inventory policy when you make an order up to S if and only if your
inventory level is below s.
(s, S) policy provide quick, consistent and exhaustive instructions to your assistant on ordering items. (s, S)
policy is used when
fixed ordering cost Cf > 0
initial inventory
s is the break even point of initial inventory level where the two options result in same total expected
cost. It is the threshold on your initial inventory level below which you wont make an order.
In other words, if your initial inventory level is s, then the cost for making an order and the cost for
ordering nothing are same.
S is the order up to quantity, hence, S = y .
Hence, assume the initial inventory level is x, then
(
no order
order S x

if x s
if x < s.

Example: How to interpret policy (s = 4, S = 10)?


(
no order
order 10 x

if x 4
if x < 4.

For example, x = 2, then order 10 2 = 8; if x = 6, then order nothing.


Solving procedure for (s, S) policy:
(i) Calculate y using equation (1)-(2), let S = y .
(ii) For any inventory level x < y , Calculate
expected cost C1 (x) w.r.t. ordering quantity y x
expected cost C2 (x) when order nothing
(iii) Find the s such that C1 (s) = C2 (s), where s < S = y .
(iv) Then the (s, S) policy is
(

no order
order S x

11

if x s
if x < s.

Examples:
1. D U (10, 20), Cu = 10, Cv = 4, Co = 2, Cf = 30. Assume your initial inventory x = 10. Should you
make order? If so, what is the order quantity to minimize the expected total cost? What is (s, S)
policy? What is your decisions if your initial inventory level is x = 13? How about x = 3, 20?
The first part of the question has been solved on Page 10. When x = 10, we should not place the
order, hence, we know that 0 < s < 10.
In order to solve (s, S) policy, we note that the cost for ordering nothing equals the cost for ordering
(S s) when the initial inventory level is s.
(a) Order nothing:
E[total cost] = 10E[(D s)+ ] + 2E[(s D)+ ]
= 10(E(D s)) since (s < 10 < D)
= 10(15 s) = 150 10s
I want to emphasize that E[(D s)+ ] 6= E[D] s unless you can show D s.
(b) Order S s:
E[total cost] = Cf + Cv (S s) + Cu E[(D S)+ ] + Co E[(S D)+ ]
= 30 + 4(15 s) + 10E[(D 15)+ ] + 2E[(15 D)+ ]
= 4(10 s) + 65
Solving s
4(10 s) + 65 = 10(15 s)
s = 7.5
Hence, (s, S) = (7.5, 15).
x = 13 > s = 7.5, hence, order nothing.
x = 3 < s = 7.5, hence, order S x = 15 3 = 12.
x = 20 > s = 7.5, hence, order nothing. It is even greater than S = 15.

12

2. Next months production at a manufacturing company will use a certain solvent for part of its production process. You need to prepare solvent in prior and the demand of solvent is random. Assume that
there is an ordering cost of $1,500 incurred whenever an order for solvent is placed and the solvent
costs $50 per liter. Due to short product life cycle, unused solvent cannot be used in following months.
There will be a $15 disposal charge for each liter of solvent left over at the end of the month. If there
is a shortage of solvent, the production process is seriously disrupted at a cost of $100 per liter short.
Assume that the initial inventory level is x, where x = 0, 500, 700, and 800 liters.
(1) Assume D U (300, 900), what is the optimal ordering quantity for each case?

Cf = $1500
Cv = $50
Co = $15
Cu = $100

The optimal order-up-to quantity y satisfies


F (y ) ==
Hence,
Hence,

y 300
900300

100 50
Cu Cv
= 50/115
=
Cu + Co
100 + 15

= 50/115, y 560. By part (2) of this problem, we know (s, S) = (437, 560).

x = 0 < s = 437, order S x = 560 0 = 560.


x = 500 > s = 437, no order.
x = 700 > s = 437, no order.
x = 800 > s = 437, no order.

13

(2) What is the (s, S) policy?


Lets first consider the optimal decision at x = 300.
E[Cost of Ordering nothing]
= 100E[(D 300)+ ] + 15E[(300 D)+ ]
= 100(E[D] 300) since (D 300)
= 100(600 300) = 30000
E[Cost of Ordering S s = 560 300 = 260]
= 1500 + 50(560 300) + 100E[(D 560)+ ] + 15E[(560 D)+ ]
= 14500 + 100 96 + 15 56 = 24940 < 30000
Hence, we know when x = 300, we should place the order and 300 < s < S = 560.
At breakeven point s, the cost for ordering nothing equals to the cost for ordering S s.

E[Cost of Ordering nothing]


= 100E[(D s)+ ] + 15E[(s D)+ ]
Z
Z 900
100 900
15
=
(x s)+ dx +
(s x)+ dx
600 300
600 300
Z
Z s
1 900
1
=
(x s)dx +
(s x)dx
6 s
40 300
1
[100(s 900)2 + 15(s 300)2 ]
=
1200
E[Cost of Ordering S s]
= 1500 + 50(560 s) + 100E[(D 560)+ ] + 15E[(560 D)+ ]
= 1500 + 50(560) 50s + 100 96 + 15 56 = 39940 50s
100(s 900)2 + 15(s 300)2 = 1200(39940 50s)
115s2 129000s + 34422000 = 0

b b2 4ac
129000 1290002 4 115 34422000
s=
=
2a
2 115
s 684 or 437
Since s < S = 560, (s, S) = (437, 560).

14

(3) Assume optimal quantity will be ordered. What is the total expected cost when the initial inventory x = 0? What is the total expected cost when the initial inventory x = 700?
x = 0, order 560.
E[Cost of Ordering 560] = 1500 + 50(560) + 100E[(D 560)+ ] + 15E[(560 D)+ ]
= 1500 + 50(560) + 100 96 + 15 56 = 39940
x = 700, order nothing.
E[Cost] = 100E[(D 700)+ ] + 15E[(700 D)+ ]
Z
Z 900
15
100 900
+
(x 700) dx +
(700 x)+ dx
=
600 300
600 300
Z
Z 700
1 900
1
=
(x 700)dx +
(700 x)dx
6 700
40 300
1
=
[100(700 900)2 + 15(700 300)2 ]
1200
5333

15

Review: Main Concepts in Newsvendor Problem


You should understand the importance of strong law of large numbers and why it is applicable in Newsvendor
problem.
(1) Profit Problem
Identify selling price, salvage value, purchasing price from supplier
Being able to calculate expected # of lost sale, # of unsold item and # of sold item
Understand the structure of profit function
Being able to solve optimal ordering quantity
Being able to calculate profit for any given ordering quantity
(2) Cost problem
Identify understock cost, overstock cost, unit production/purchasing cost and fixed operation cost
Understand the structure of cost function
Being able to solve optimal production-up-to quantity
Being able to calculate cost for any given ordering quantity
Being able to calculate cost and optimal ordering quantity for any given initial inventory level x
Understand the importance of (s,S) policy and why it is useful
Being able to solve (s,S) policy
Know how to use (s,S) policy

16

You might also like