Suggested solutons for the exam n SF2863 Systems Engneerng. June 12, 2012 14.00 19.00 Examner: Per Enqvst, phone: 790 62 98 1. We can thnk of the farm as a Jackson network. The strawberry feld s modelled as a M M queue wth arrval ntensty λ S and servce ntensty µ S = 60/40 = 1.5, followed by a M M 1 queue wth the same arrval ntensty λ S and wth servce ntensty µ 1 S = 100. The apple garden s modelled as a M M queue wth arrval ntensty λ A and servce ntensty µ A = 60/20 = 3, followed by a M M 1 queue wth the same arrval ntensty λ A and wth servce ntensty µ 1 A = 120. (a) Let λ 0 = 100 be the arrval ntensty from the outsde. The traffc balance equatons are pλ 0 + 0.2λ A = λ S, (1 p)λ 0 + 0.5λ S = λ R, whch yelds, λ S = (80p + 20)/0.9, and λ A = 100 + 10/0.9 (100 40/0.9)p. We can now check that the low traffc requrements are satsfed,.e., that λ S < µ 1 S = 100 and λ A < µ 1 A = 120. The frst equaton tells us that p < 7/8 must hold n order to obtan steady state. (b) Wth p = 0.2 we get λ A = 100 and λ S = 40. The probablty of no customers n the payment offces s (1 ρ S )(1 ρ A ) = (1 40/100)(1 100/120) = 0.1 so t s 10%. (c) The average number of strawberry pckers s L S = λ S /µ S average number of apple pckers s L A = λ A /µ A = 100/3. = 40/1.5 and the (d) We have to add the average number of people n the two payment offces, whch are L 1 S = ρ S/(1 ρ S ) = 0.4/0.6 = 2/3 and L 1 A = ρ A/(1 ρ A ) = (5/6)/(1/6) = 5. So the total number s 80/3 + 100/3 + 2/3 + 5 = 197/3. (e) Let V R, V F and V H be the average tme t takes from a call arrves to one of the servce statons untl t leaves t,.e., V R = L R /λ R = 2ρ R /(1 ρ 2 R )/λ R = 24/7/24 = 1/7, V F = L F /λ F = ρ F /(1 ρ F )/λ F = 4/8 = 1/2, and V H = L H /λ H = ρ H /(1 ρ H )/λ H = 3/12 = 1/4. Lettng W S be the average tme from a customer arrves to the strawberry felds untl t exts the system, W A be the average tme from a call arrves to the apple gardens untl t exts the system, then W S = V S + V 1 S + 1/2W A W A = V A + V 1 A + 1/5W S where V S = L S /λ S, V 1 S = L1 S /λ S, V A = L A /λ A, V 1 A = L1 A /λ A are the average tmes for passng once through the system. Then W A = 178/135 and W S = 145/108. The average tme n the system for a random arrvng customer s then 0.2W s + 0.8W A = 397/300. 1
Page 2 of 5 Solutons Exam 2012-06-12 SF2863 2. Ths s a determnstc perodc-revew nventory model. Let n = the number of consdered weeks r = the demand at week Here n = 4 and r 1 = r 2 = r 3 = r 4 = 100. The total cost conssts of three parts: The orderng costs for orders, the holdng costs and the fertlzer cost. The latter s 1000 (r 1 + r 2 + r 3 + r 4 ) = 400000 for all feasble order plans, so ths unavodable cost may be gnored when searchng for an optmal order plan. Let C (j) = the mnmal remanng (orderng + holdng) costs from week, gven that the nventory s empty at the end of week 1 and then flled n such a way that the next tme t wll be empty s by the end of week j Then C (j) = K + h(r +1 + 2r +2 + + (j )r j ) + C j+1. Further, let C = the mnmal remanng (orderng+holdng) cost from week, gven that the nventory s empty at the end of week 1. Then C = mn{c (), C (+1),, C (n) }. (a) Here, K = 700 and h = 3. We then get that C 4 = 4 = 700 3 = 700 + 300 = 1000 3 = 700 + C 4 = 1400 C 3 = mn{ 3, C(4) 3 } = 1000 2 = 700 + 300 + 600 = 1600 2 = 700 + 300 + C 4 = 1700 2 = 700 + C 3 = 1700 C 2 = mn{ 2, C(3) 2, C(4) 2 } = 1600 1 = 700 + 300 + 600 + 900 = 2500 1 = 700 + 300 + 600 + C 4 = 2300 1 = 700 + 300 + C 3 = 2000 C (1) 1 = 700 + C 2 = 2300 C 1 = mn{c (1) 1, C(2) 1, C(3) 1, C(4) 1 } = 2000 The optmal plan s to order 200 klo before the frst week and 200 klo before the thrd week. (b) Assume that the cost s now 3 + c. C 4 = 4 = 700 3 = 700 + 300 + 100c = 1000 + 100c 3 = 700 + C 4 = 1400 C 3 = mn{ 3, C(4) 3 } = 1000 + 100c as long as c 4.
SF2863 Solutons Exam 2012-06-12 Page 3 of 5 2 = 700 + 300 + 600 + 300c = 1600 + 300c 2 = 700 + 300 + 100c + C 4 = 1700 + 100c 2 = 700 + C 3 = 1700 + 100c C 2 = mn{ 2, C(3) 2, C(4) 2 } = 1600 + 300c as long as c 1/2. 1 = 700 + 300 + 600 + 900 + 600c = 2500 + 600c 1 = 700 + 300 + 600 + 300c + C 4 = 2300 + 300c 1 = 700 + 300 + +100c + C 3 = 2000 + 200c C (1) 1 = 700 + C 2 = 2300 + 300c C 1 = mn{c (1) 1, C(2) 1, C(3) 1, C(4) 1 } = 2000 as long as c 1.5 and c 1/2. If c < 1.5 then, the optmal plan s to order 400 klo before the frst week. If c > 1/2, then the optmal plan would change f we ended up wth zero nventory at the begnnng of the second week, but ths s not the case here. If c > 4, then the optmal plan s to order 100 klo every week. (for c = 4 the cost of storng 100 klo one week s the same as that of orderng) 3. (a) P (n ) = the probablty that there s no problem of type f Frasse has appled n extra measures of type Then f(n 1,, n N ) = P (n 1 )P (n 2 )... P (n N ) descrbed the probablty that there are no problems of any category. The optmzaton problem s then max n 1,,n N f(n 1,, n N ) s.t. N =1 C (n ) = N I=1 c n S n {0, 1, 2, 3, 4, 5} for = 1,, N. (b) Introduce the stage l as the reduced problem when Frasse has only measures of type l,, N to choose from. Introduce the state, s l = how many dollars Frasse has at stage l, whch we assume s non-negatve. Let x l be the number of measures of type l that Frasse decdes to take. Then s l+1 = s l c l x l. Let fl (s l) be the optmal value of the reduced problem when the budget s s l. The DynP recurson can be wrtten as f l (s l) = max x l =0,,[s l /c l ] { Pl (x l )f l+1 (s l x l c l ) }, where [ ] denotes the nteger part of ts argument, and the boundary condton s that f N+1 = 1, or f N (s N) = P N ([s N /c N ]). Assume N = 2, k 1 = 1/10, k 2 = 1/20, p 1 = 0.1, p 2 = 0.2, c 1 = 3, c 2 = 2 and S = 5. Let f 3 = 1. Then f 2 (s 2) = P 2 ([s 2 /c 2 ]) = P 2 ([s 2 /2]) = p 2 e k 2[s 2 /2] Then f 1 (s 1) = max x1 =0,,[s 1 /c 1 ] {P 1 (x 1 )f 2 (s 1 x 1 c 1 )}, and n partcular for s 1 = 5 f 1 (5) = max x 1 =0,1 {P 1(x 1 )f 2 (5 3x 1 )} = p 1 p 2 max {exp k 1 0 + k 2 2, exp k 1 1 + k 2 1},
Page 4 of 5 Solutons Exam 2012-06-12 SF2863 so f 1 (5) = p 1p 2 e 3/20 snce k 1 + k 2 = 3/20 > 2k 2 = 2/20. (c) Rewrte as the mnmzaton problem mn n 1,,n N log f(n 1,, n N ) s.t. N =1 C (n ) = N I=1 c n S n {0, 1, 2, 3, 4, 5} for = 1,, N. Let g(n) = N I=1 c n whch s a seperable ncreasng nteger-convex functon. Then N N N F (n) = log f(n) = log P (n ) = log P (n ) = log p + k n =1 s a seperable decreasng nteger-convex functon. Note that F (x) = k and g (x) = c, so the quotents F (x)/ g (x) = k /c does not depend on x. Here k 1 /c 1 = 0.1/3 > k 2 /c 2 = 0.05/2 so the margnal effect s always larger for the measure of type 1. The effcent allocatons are therefore, (n 1 = 0, n 2 = 0), (n 1 = 1, n 2 = 0), (n 1 = 2, n 2 = 0), (n 1 = 3, n 2 = 0) correspondng to the total costs 0, 3, 6, 9 USD. =1 =1 4. (a) We need to keep track of the qualty of the crop, defne the state Defne the decsons x k = s k = { 1 f the crop s good year k 0 f the crop s bad year k { 1 f Frasse uses pestcdes year k 2 f Frasse uses manure yeark The transton probabltes are p j (k) = the probablty of jumpng from state to j f we make decson k. Here p 11 (1) = 0.8, p 10 (1) = 0.2, p 01 (1) = 0.6, p 00 (1) = 0.4, p 11 (2) = 0.6, p 10 (2) = 0.4, p 01 (2) = 0.4, p 00 (2) = 0.6. In the costs we nclude the revenue wth negatve sgn. Then the costs of makng decson x k = 1 s C 11 = 600 0.8 1200 0.2 600 = 480 f s k = 1 and C 01 = 600 0.6 1200 0.4 600 = 360 f s k = 0, the cost of makng decson x k = 2 s C 12 = 100 0.6 2000 0.4 800 = 1420 f s k = 1 and C 02 = 100 0.4 2000 0.6 800 = 1180 f s k = 0. Startng polcy: Always make decson x k = 1. Use the polcy teraton algorthm. Let v 0 = 0, then the value determnaton equatons g + v 1 = 480 + 0.8v 1 + 0.2v 0 gves g = 450, v 1 = 150. g + v 0 = 360 + 0.6v 1 + 0.4v 0
SF2863 Solutons Exam 2012-06-12 Page 5 of 5 To fnd out f t s optmal we do one step of the polcy teraton. For = 1 (The crop s good) mn {C 1k + (p 11 (k)v 1 + p 10 (k)v 0 )} = k=1,2 = mn{c 11 + (p 11 (1)v 1 + p 10 (1)v 0 ), C 12 + (p 11 (2)v 1 + p 10 (2)v 0 ), } = mn{ 480 + (0.8v 1 + 0.2v 0 ), 1420 + (0.6v 1 + 0.4v 0 ), } = 1510( g+v 1 ) for k = 2. }{{}}{{} 600 1510 For = 0 (The crop s bad) mn {C 0k + (p 00 (k)v 0 + p 01 (k)v 1 )} = k=1,2 = mn{c 01 + (p 01 (1)v 1 + p 00 (1)v 0 ), C 02 + (p 01 (2)v 1 + p 00 (2)v 0 ), } = mn{ 360 + (0.6v 1 + 0.4v 0 ), 1180 + (0.4v 1 + 0.6v 0 ), } = 1240( g+v 2 ) for k = 2. }{{}}{{} 480 12400 So the polcy to always use manure s better. Solvng the value determnaton equaton agan for the new polcy Let v 0 = 0, then the value determnaton equatons g + v 1 = 1420 + 0.6v 1 + 0.4v 0 g + v 0 = 1180 + 0.4v 1 + 0.6v 0 gves g = 1300. The average gan s 850 USD per year. (b) We need to keep track of the qualty of the crop, and the number of consecutve years of ecologcal farmng. Defne the state S k = (s k, σ k ) where s k s as before and σ k = the number of consecutve years of ecologcal farmng. Note that σ k can take any (non-negatve) nteger value. Defne the decsons as before. The transton probabltes are p mjn (k) = the probablty of jumpng from state (, m) to (j, n) f we make decson k. Here p 1m1n (1) = 0.8, p 1m0n (1) = 0.2, p 0m1n (1) = 0.6, p 0m0n (1) = 0.4, f n = 0, and otherwse t s zero, and p 1m1n (2) = 0.6, p 1m0n (2) = 0.4, p 0m1n (2) = 0.4, p 0m0n (2) = 0.6. f n = m + 1, and otherwse t s zero. Let C jk = the cost when n state s =, σ = k makng decson x = j. Then C jk = C j 100k f j = 2 and C jk = C j f j = 1. For the Markov decson Process algorthm to work, the system has to tend to a statonary condton, but for ths problem the extra state s not fnte and no state wll actually be recurrent for the optmal strategy.