Presentation is loading. Please wait.

Presentation is loading. Please wait.

Monte Carlo Methods A Monte Carlo simulation creates samples from a known distribution For example, if you know that a coin is weighted so that heads will.

Similar presentations


Presentation on theme: "Monte Carlo Methods A Monte Carlo simulation creates samples from a known distribution For example, if you know that a coin is weighted so that heads will."— Presentation transcript:

1 Monte Carlo Methods A Monte Carlo simulation creates samples from a known distribution For example, if you know that a coin is weighted so that heads will occur 90% of the time, then you might assign the following values: X01 fX(x)fX(x)0.100.90

2 Monte Carlo Methods If you tossed the coin, the expected value would be 0.9 However, a sample simulation might yield the results 1, 1, 1, 0, 1, 1, 0, 1, 0, 1 The average of the sample is 0.7 (close, but not the same as the expected average)

3 Monte Carlo Methods Another type of simulation can be run using the RAND function RAND chooses a random number between 0 and 1 Entered as RAND( ) Used for continuous random variable simulations

4 Monte Carlo Methods The outputs will include as many decimal places as Excel can keep This is used to model situations where you have a continuous random variable There would be an infinite number of possible outcomes

5 Monte Carlo Methods The IF function in Excel determines a value based upon a logical TRUE/FALSE scenario If math formula is true, then one outcome happens If math formula is false, then another outcome happens

6 Monte Carlo Methods Ex. The situation where heads occurs 90% of the time can be simulated by using RAND and IF functions. =IF(RAND()<=0.90,1,0) We can use COUNTIF to count the number of times an outcome occurs

7 Monte Carlo Methods If we have a variable with a known distribution, we may construct the c.d.f. function Once we have this, a simulation can be run from the inverse of the c.d.f.

8 Monte Carlo Methods For example, if we have an exponential function with a known value The inverse function is Here x would be replaced by RAND( )

9 Monte Carlo Methods Focus on the Project: Enter mean time between arrivals for variable A in cell B31 of the sheet 1 ATM for the Excel file Queue Focus.xls.

10 Monte Carlo Methods Focus on the Project: The formula in cell G35 of the sheet 1 ATM for the Excel file Queue Focus.xls needs to be changed Original: =IF(ISNUMBER(F35),VLOOKUP(RANDBETWEEN(1, 7634 ), Data!$G$45:Data!$H$ 7678,2),"")

11 Monte Carlo Methods Focus on the Project: Change the numbers indicated to match your data Copy your new formula into cells G36:G194

12 Monte Carlo Methods Focus on the Project: Note that my simulation (from my posted SampleData.xls) must accommodate 170 customers Drag the information in cells B195:C195 down until the last value in column B is one more than the number of customers (for me, 171)

13 Monte Carlo Methods Focus on the Project: Drag the information in cells E195:F195 down until the last values are at the same row as the values in columns B and C. Drag the information in cells G194:L195 down until the last values are one row above the values in columns E and F.

14 Monte Carlo Methods Focus on the Project: The finished columns E through L should look like: Note: columns E and F have one extra cell

15 Monte Carlo Methods Focus on the Project: The formula in column L should be written in the following way: In cell L36 write: =IF(ISNUMBER(F36),COUNTIF($I$35:I35,">"&F36 ),"") This formula can then be filled down column L without any additional editing.

16 Monte Carlo Methods Focus on the Project: Finally, we need to modify the formulas in cells N35:S35 N35 contains (# of customers plus 1) =IF(MAX(E35:E 195 )= 161,"Overflow",MAX(E35:E 195 )) (new ending cell in column E)

17 Monte Carlo Methods Focus on the Project: O35 contains =SUM(J35:J 194 ) (new ending cell in column J) P35 contains =MAX(J35:J 194 ) (new ending cell in column J)

18 Monte Carlo Methods Focus on the Project: Q35 contains =COUNTIF(K35:K 194,”yes”) (new ending cell in column K) R35 contains =SUM(L35:L 194 ) (new ending cell in column L)

19 Monte Carlo Methods Focus on the Project: S35 contains =SUM(L35:L 194 ) (new ending cell in column L) Finally, run the Macro One_ATM Save the results in a folder (do not change the name of the Excel file Queue Focus.xls)

20 Monte Carlo Methods Focus on the Project: A summary of possible answers to five of the six claims appears in cells: P39 (Max waiting time) S39 (Max number in queue) U39 (Mean waiting time) V39 (Percent delayed) W39 (Mean number in queue)

21 Monte Carlo Methods Focus on the Project: The final claim (percent irritated) must be answered and will be addressed later. Save this document in one folder (do not change the name from Queue Focus.xls)

22 Monte Carlo Methods Focus on the Project: Summary (9 am) Mean Wait Time Max Wait Time Percent Delayed Mean # in Queue Max # in Queue Percent Irritated 1 ATM43.73135.6093.4%37.6112TBD 2 ATMs7.9547.9460.7%7.167TBD 3 ATMs0.9115.051.6%1.029TBD 3 ATMs Serp 0.8012.151.0%2.331TBD Claims1.29.53.9%8.5303.0%

23 Monte Carlo Methods Focus on the Project: Once you have saved the file in a folder, create a new folder for your 9 pm data Save the Queue Focus.xls file in your new folder

24 Monte Carlo Methods Focus on the Project: Modify the Queue Focus.xls file for your 9 pm data This only requires a change of the cell B31 (mean arrival) in the worksheet 1 ATM.

25 Monte Carlo Methods Focus on the Project: Summary (9 pm) Mean Wait Time Max Wait Time Percent Delayed Mean # in Queue Max # in Queue Percent Irritated 1 ATM0.7912.031.5%0.910TBD 2 ATMs0.085.980.0%0.56TBD 3 ATMs0.017.600.0%0.06TBD 3 ATMs Serp 0.011.910.0%0.06TBD Claims1.29.53.9%8.5303.0%

26 Monte Carlo Methods Focus on the Project: Now that there are two folders (9am and 9pm) that contain a Queue Focus.xls file, we will create two more folders One folder should contain the Queue Focus.xls file using 9am data and one should have the Queue Focus.xls file using the 9pm data (we can call these folders “9am irritated” and “9pm irritated”

27 Monte Carlo Methods Focus on the Project: For the 9am irritated claim, we will open the third copy of Queue Focus.xls (in 9am irritated folder) We will find the percent irritated value for each of the four ATM models

28 Monte Carlo Methods Focus on the Project: In the sheet 1 ATM, column K contains Delayed information This will be changed to find Irritated information

29 Monte Carlo Methods Focus on the Project: Cell K35 contains the following formula: =IF(ISNUMBER(F35),IF( J35 >$D$31,"yes","no"),"") Change J35 to L35 and copy the formula to the end of the table

30 Monte Carlo Methods Focus on the Project: In addition, the value in cell D31 must be changed from 5 to 3 Recall, a customer is irritated if there are more than 3 customers waiting to use an ATM

31 Monte Carlo Methods Focus on the Project: Run the macro One_ATM The solution will appear in cell V39 (Percent Delayed label)

32 Monte Carlo Methods Focus on the Project: A summary of the findings appears below: Claim is that at most 3.0% will be irritated (3 ATMs) Percent Irritated 1 ATM95.1% 2 ATMs75.4% 3 ATMs2.7% 3 ATMs Serp2.5%

33 Monte Carlo Methods Focus on the Project: Summary (9 am) Mean Wait Time Max Wait Time Percent Delayed Mean # in Queue Max # in Queue Percent Irritated 1 ATM43.73135.6093.4%37.611295.1% 2 ATMs7.9547.9460.7%7.16775.4% 3 ATMs0.9115.051.6%1.0292.7% 3 ATMs Serp 0.8012.151.0%2.3312.5% Claims1.29.53.9%8.5303.0%

34 Monte Carlo Methods Focus on the Project: Save the new Queue Focus.xls file in your 9am irritated folder Do all of the same calculations for 9pm irritated

35 Monte Carlo Methods Focus on the Project: Summary (9 pm) Mean Wait Time Max Wait Time Percent Delayed Mean # in Queue Max # in Queue Percent Irritated 1 ATM0.7912.031.5%0.9103.2% 2 ATMs0.085.980.0%0.560.0% 3 ATMs0.017.600.0%0.060.0% 3 ATMs Serp 0.011.910.0%0.060.0% Claims1.29.53.9%8.5303.0%

36 Monte Carlo Methods Focus on the Project: Final steps are to determine the cost of the gift certificate program as is and to determine the cost if 70% of customers who are eligible use the gift certificates

37 Monte Carlo Methods Focus on the Project: During the 9 am hour, the mean time between arrivals was 0.48 (for my data) This gives customers per hour

38 Monte Carlo Methods Focus on the Project: It is estimated (from simulation) that 1.0% of customers will be delayed using 3 ATMs Serpentine This gives us delayed customers per hour

39 Monte Carlo Methods Focus on the Project: According to my sample data, the gift certificates are worth $35 Each hour would cost in gift certificates The maintenance cost is $21 per hour

40 Monte Carlo Methods Focus on the Project: The total cost would be $43.75 + $21 = $64.75 This is the cost if all customers who are eligible for gift certificates actually use them

41 Monte Carlo Methods Focus on the Project: However, some customers will not use the gift certificate program If 70% of those eligible to use the gift certificates actually use them, then the hourly cost of gift certificates changes from $43.75 to $43.75(0.70) = $30.63

42 Monte Carlo Methods Focus on the Project: The overall cost would be $30.63 + $21 = $51.63 This is the cost if 70% of eligible customers used their gift certificate


Download ppt "Monte Carlo Methods A Monte Carlo simulation creates samples from a known distribution For example, if you know that a coin is weighted so that heads will."

Similar presentations


Ads by Google