Week03-Lecture (20100907) - Simulation Modeling and...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Simulation Modeling and Analysis (ORIE 4580/5580/5581) Week 3: Simulation in Excel and Analysis of Capacity Allocation Game (09/07/10 - 09/02/10) 1 Announcement and Agenda • HW 1 is due this Thursday (9/9) at 11am in the HW dropbox • • • IMPORTANT: Please write down the name of your TA and your recitation section in front of your homework. This is the recitation where you can pick up your graded homework. REMINDER: Cornell Career Fair on 9/14 and 9/15 Simulation Analysis of Capacity Allocation Game • • • • • • Problem formulation and mathematical modeling Assumptions and simplification Simulation Optimization Technique Implementation in Excel Computing Confidence Interval Use of @Risk Software 2 Review of Capacity Allocation (CA) Game • • • Have 8 boxes of chocolate to sell to 30 customers. Each customer sequentially draws a single bill from a bag. The bag has the following distribution of bills: Denomination # of Bills $1 46 $10 8 • The amount drawn by each customer represents the amount that he/she would be willing to spend on one box of chocolate. • Given the bill drawn by each customer, the seller need to decide whether or not to sell the chocolate to the customer • Tradeoffs: Earning $1 now vs. Saving the capacity for high-paying customers GOAL: Use SIMULATION to 1) determine the optimal strategy, 2) compute the corresponding maximum expected revenue, and 3) understand the risk associated with optimal strategy 3 Complexity Associated with the CA Game • • Large Strategy Set: The set of possible strategies is very large! • Even if we know the expected revenue associated with each strategy, it is difficult to find the “optimal” strategy. Sampling Without Replacement: For each strategy, compute the expected revenue is very difficult because the bills are drawn without replacement! • • • Once we make a sale, the probability of drawing a $1/$10 bill changes! Very difficult to model Sequential Nature: The game proceeds sequentially, one customer at time. • We need to consider 30 different decisions, one corresponding to each customer. Can we come up with a “mathematical model” of this game that leads to a tractable analysis? 4 What is a mathematical model? • • A representation of the underlying reality/physical problem. Every model is just an approximation! • • • • Contains assumptions and some simplifications There is NO one single right model! IMPORTANT: An approximation can still be very USEFUL! Tradeoffs inherent in every model formulation • • • Rich and complex model that captures lots of details of the underlying system. Simple enough to allow for tractable analysis Will present a simple model of the CA game that allows for tractable analysis • Despite the model’s simplicity, it is currently being used by airlines, hotels, and many other revenue management companies. 5 A Simplified Math Model of the CA Game • • Random Variables: • • DL = # of “low-paying” customers (those who draw $1 bills from the bag) DH = # of “high-paying” customers (those who draw $10 bills) Assumption 1: DL and DH are independent random variables. • • • • • When a chocolate box is sold to the customer, the corresponding bill is removed from the bag without replacement. So, in our CA game, the random variables DL and DH are actually correlated because the likelihood of drawing a $1 bill will depend on how many boxes of chocolate have been sold at $10. This assumption corresponds to “sampling with replacement”. It is a good approximation when # of bills in the bag is large! This is also a reasonable assumption in many applications. DL ~ Binomial (30, 46/54) and DH ~ Binomial 6 • Consequence of Assumption1: (30, 8/54) • A Math Model of CA Game (cont.) Assumption 2: All low-paying customers (those who draw $1 bills) arrive BEFORE high-paying customers (those who draw $10 bills) • • • This is a “conservative” scenario because if all of the high-paying customers arrive first, we would sell to all of them! This assumption is very common in revenue management. The resulting policy from our model can still be applied to actual settings! 8 boxes of chocolate a random number of lowpaying customers arriving first ..... followed by a random number of high-paying customers • Decision: How much chocolate to reserve for “high-paying” customers? • • • Notation: y = # of chocolate boxes reserved for high-paying customers Range of y: 0, 1, 2, 3, 4, 5, 6, 7, 8 We now only have 9 decisions to choose from! 7 • • • Revenue Function Let C = # of chocolate boxes available (in our case, C = 8) Price paid by each customer type: pL = $1 and pH = $10 Let R(y, dL, dH) = total revenue obtained when we reserve y boxes of chocolate for high-paying customer, and the number of low-paying and highpaying customers are dL and dH, respectively. R(y, dL , dH ) = pL min{dL , C − y } + pH min{dH , C − min{dL , C − y }} # of chocolate boxes available to low-paying customers remaining capacity available for high-paying customers R(y, dL , dH ) = pL min{dL , C − y } + pH min{dH , max{C − dL , y }} ExpectedRev(y ) := E [R(y, DL , DH )] the expectation is taken with respect to the random variables DL and DH Objective: y =0,1,...,8 max ExpectedRev(y ) 8 Simulation Optimization Technique • • • • • For each y, computing ExpectedRev(y) can be difficult Use simulation to “approximate” ExpectedRev(0), ExpectedRev(1), ....., and ExpectedRev(8) simultaneously. Then, find the value of y* that gives us the maximum (estimated) expected revenue! Strategy: Generate N i.i.d. samples of the low-paying and high-paying demands • Denote the samples by: (DL,1 , DH,1 ) , (DL,2 , DH,2 ) , . . . , (DL,N , DH,N ) By Law of Large Number: As N →∞, we have that N ￿ 1 R(y, DL,i , DH,i ) → E [R(y, DL , DH )] = ExpectedRev(y ) N i=1 N ￿ 1 R(y, DL,i , DH,i ) For each value of y, we compute the average revenue N i=1 and choose the y* that give us the maximum! 9 Generating Binomial Random Variables in Excel • • If X ~ Binomial (n,α), then for k = 0, 1, 2,..., n ￿￿ n! n k n−k α (1 − α) = p(k ) = αk (1 − α)n−k k (n − k )!k ! F (k ) = A (hard) way to generate a sample of X ~ Binomial(n, p) in Excel: k ￿ s=0 p(s) • U Generate a random U ~ Uniform[0,1] using RAND() function and do the following transformation: X 0 1 2 … n-1 n [0, F(0)) [F(0), F(1)) [F(1), F(2)) … [F(n-2), F(n-1)) [F(n-1), 1) if 0 ≤ U < F (0), 0, 1, if F (0) ≤ U < F (1), 2, if F (1) ≤ U < F (2), X= . . . . . . n − 1, if F (n − 2) ≤ U < F (n − 1), n, if F (n − 1) ≤ U < F (n) = 1, • X = min {k : U < F (k )} An easier way to do this: Use Excel Built-in Function CRITBINOM(n, α, U) 10 Overview of the Spreadsheet =CRITBINOM (30, 46/54, RAND()) =CRITBINOM (30, 8/54, RAND()) =($1 * min{$B3, 8-H$2}) + ($10 * min{$C3, max{8-$B3, H$2}}) Review Excel spreadsheet in class 11 • • • The optimal decision y* = 7 Observations • • In Week 13-14, we will provide a more detailed statistical test, which shows that y* = 7 is the best decision N ￿ 1 = R(7, DL,i , DH,i ) N i=1 ¯ Average Revenue: XN IMPORTANT: When you run this again, you will be a slightly different answers due to randomness. It’s OK! How do we construct 95% confidence around our average revenue? • • Sample size N = 10,000 Sample Standard Deviation: sN ￿ ￿ s s ¯ N − 1.96 √N , XN + 1.96 √N ¯ X 95% confidence interval: N N ￿ ￿ s s ¯ N − zα/2 √N , XN + zα/2 √N ¯ X 100(1-α)% confidence interval: N N ￿ ￿ ￿ =￿ ￿2 1 ￿￿ ¯ R(7, DL,i , DH,i ) − XN N − 1 i=1 N 12 Using @Risk • Instead of using native commands in Excel to run your simulation, you can @Risk software. • • • Has functions for generating different types of random variables Provide graphical functionalities Review the @Risk Excel file for the capacity allocation game 13 Selecting Sample Size • • So far, we specify the sample size (or number of replications) N in advance. • • • This approach allows us to control the computational effort We cannot control, in advance, the width of the confidence interval • • • Question: Suppose we want the half-width of the 100(1-α)% confidence interval to be at most W, how many sample size do we need? σ The half-width of the confidence interval = zα/2 √ N ￿ z σ ￿2 σ α/2 zα/2 √ ≤ W ⇔ N ≥ W N Usually, the standard deviation σ is NOT known Do some “trial runs”, say K replications (with K between 20 to 30). Use the these trial runs to compute the sample standard deviation sK. Use the estimated standard deviation in the above formula (in place of σ) to determine the number of “actual” runs that would be needed. 14 Shrinking the Width of the Confidence Interval • • Note that the half-width of the confidence is of the order 1/√N To reduce the width by half, we need to increase the sample size by 4 15 ...
View Full Document

This note was uploaded on 10/26/2010 for the course OR&IE 5580 at Cornell University (Engineering School).

Ask a homework question - tutors are online