<< Chapter < Page | Chapter >> Page > |
We use the same joint distribution as for Example 10 from "Mathematical Expectation: Simple Random Variables" and let . To set up for calculations, we use jcalc.
jdemo1 % Call for data
jcalc % Set upEnter JOINT PROBABILITIES (as on the plane) P
Enter row matrix of VALUES of X XEnter row matrix of VALUES of Y Y
Use array operations on matrices X, Y, PX, PY, t, u, and PG = t.^2 + 2*t.*u - 3*u; % Calculation of matrix of [g(t_i, u_j)]
EG = total(G.*P) % Direct calculation of E[g(X,Y)]EG = 3.2529
VG = total(G.^2.*P) - EG^2 % Direct calculation of Var[g(X,Y)]VG = 80.2133
[Z,PZ]= csort(G,P); % Determination of distribution for Z
EZ = Z*PZ' % E[Z]from distribution
EZ = 3.2529VZ = (Z.^2)*PZ' - EZ^2 % Var[Z] from distributionVZ = 80.2133
Suppose exponential (0.3). Let
Determine and .
ANALYTIC SOLUTION
APPROXIMATION
To obtain a simple aproximation, we must approximate by a bounded random variable. Since we may safely truncate X at 50.
tappr
Enter matrix [a b]of x-range endpoints [0 50]
Enter number of x approximation points 1000Enter density as a function of t 0.3*exp(-0.3*t)
Use row matrices X and PX as in the simple caseM = X<= 4;
G = M.*X.^2 + 16*(1 - M); % g(X)EG = G*PX' % E[g(X)]
EG = 7.4972VG = (G.^2)*PX' - EG^2 % Var[g(X)]
VG = 43.8472 % Theoretical = 43.8486[Z,PZ] = csort(G,PX); % Distribution for Z = g(X)EZ = Z*PZ' % E[Z] from distributionEZ = 7.4972
VZ = (Z.^2)*PZ' - EZ^2 % Var[Z]VZ = 43.8472
The manager of a department store is planning for the holiday season. A certain item costs c dollars per unit and sells for p dollars per unit. If the demand exceeds the amount m ordered, additional units can be special ordered for s dollars per unit ( ). If demand is less than the amount ordered, the remaining stock can be returned (or otherwise disposed of) at r dollars per unit ( ). Demand D for the season is assumed to be a random variable with Poisson distribution. Suppose . What amount m should the manager order to maximize the expected profit?
PROBLEM FORMULATION
Suppose D is the demand and X is the profit. Then
It is convenient to write the expression for X in terms of I M , where . Thus
Then
We use the discrete approximation.
APPROXIMATION
>>mu = 50;>>n = 100;>>t = 0:n;>>pD = ipoisson(mu,t); % Approximate distribution for D>>c = 30;>>p = 50;>>s = 40;>>r = 20;>>m = 45:55;>>for i = 1:length(m) % Step by step calculation for various m
M = t<=m(i);
G(i,:) = (p-s)*t + m(i)*(s-c) + (s-r)*M.*(t - m(i));end>>EG = G*pD';>>VG = (G.^2)*pD' - EG.^2;>>SG =sqrt(VG);>>disp([EG';VG';SG']')1.0e+04 *
0.0931 1.1561 0.01080.0936 1.3117 0.0115
0.0939 1.4869 0.01220.0942 1.6799 0.0130
0.0943 1.8880 0.01370.0944 2.1075 0.0145
0.0943 2.3343 0.01530.0941 2.5637 0.0160
0.0938 2.7908 0.01670.0934 3.0112 0.0174
0.0929 3.2206 0.0179
Notification Switch
Would you like to follow the 'Applied probability' conversation and receive update notifications?