<< Chapter < Page Chapter >> Page >

Z = g ( X , Y ) ( Example 10 From "mathematical expectation: simple random variables")

We use the same joint distribution as for Example 10 from "Mathematical Expectation: Simple Random Variables" and let g ( t , u ) = t 2 + 2 t u - 3 u . 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
Got questions? Get instant answers now!

A function with compound definition ( Example 12 From "mathematical expectation; general random variables")

Suppose X exponential (0.3). Let

Z = X 2 for X 4 16 for X > 4 = I [ 0 , 4 ] ( X ) X 2 + I ( 4 , ] ( X ) 16

Determine E [ Z ] and Var [ Z ] .

ANALYTIC SOLUTION

E [ g ( X ) ] = g ( t ) f X ( t ) d t = 0 I [ 0 , 4 ] ( t ) t 2 0 . 3 e - 0 . 3 t d t + 16 E [ I ( 4 , ] ( X ) ]
= 0 4 t 2 0 . 3 e - 0 . 3 t d t + 16 P ( X > 4 ) 7 . 4972 (by Maple)
Z 2 = I [ 0 , 4 ] ( X ) X 4 + I ( 4 , ] ( X ) 256
E [ Z 2 ] = 0 I [ 0 , 4 ] ( t ) t 4 0 . 3 e - 0 . 3 t d t + 256 E [ I ( 4 , ] ( X ) ] = 0 4 t 4 0 . 3 e - 0 . 3 t d t + 256 e - 1 . 2 100 . 0562
Var [ Z ] = E [ Z 2 ] - E 2 [ Z ] 43 . 8486 (by Maple)

APPROXIMATION

To obtain a simple aproximation, we must approximate by a bounded random variable. Since P ( X > 50 ) = e - 15 3 · 10 - 7 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
Got questions? Get instant answers now!

Stocking for random demand ( Example 13 From "mathematical expectation; general random variables")

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 ( s > c ). If demand is less than the amount ordered, the remaining stock can be returned (or otherwise disposed of) at r dollars per unit ( r < c ). Demand D for the season is assumed to be a random variable with Poisson ( μ ) distribution. Suppose μ = 50 , c = 30 , p = 50 , s = 40 , r = 20 . 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

  • For D m , X = D ( p - c ) - ( m - D ) ( c - r ) = D ( p - r ) + m ( r - c )
  • For D > m , X = m ( p - c ) + ( D - m ) ( p - s ) = D ( p - s ) + m ( s - c )

It is convenient to write the expression for X in terms of I M , where M = ( - , m ] . Thus

X = I M ( D ) [ D ( p - r ) + m ( r - c ) ] + [ 1 - I M ( D ) ] [ D ( p - s ) + m ( s - c ) ]
= D ( p - s ) + m ( s - c ) + I M ( D ) [ D ( p - r ) + m ( r - c ) - D ( p - s ) - m ( s - c ) ]
= D ( p - s ) + m ( s - c ) + I M ( D ) ( s - r ) [ D - m ]

Then

E [ X ] = ( p - s ) E [ D ] + m ( s - c ) + ( s - r ) E [ I M ( D ) D ] - ( s - r ) m E [ I M ( D ) ]

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
Got questions? Get instant answers now!

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Applied probability. OpenStax CNX. Aug 31, 2009 Download for free at http://cnx.org/content/col10708/1.6
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Applied probability' conversation and receive update notifications?

Ask