*From emp library, only deterministic part
$Title Simple newsboy problem, discrete (NBSIMPLE,SEQ=85)

$ontext

Simple newsboy problem
Random paramters D is discrete

$offtext


Scalar 
	c  	/30/
	p 	/5/
	h	/10/
	v	/60/
	d	/44.5/;
	
Variable
	Z	profit;
	
Positive variables
	X	units bought
	I	inventory
	L	lost sales
	S	units sold;
	
Equations
	Row1	demand def
	Row2	inventory def
	Profit	objective;
	
Row1..
	d =e= S+L;
	
Row2..
	I =e= X-S;
	
Profit..
	Z =e= v*s - c*X - h*I - p*L;
	
Model nb /all/;

solve nb max Z use lp;								