Presentation is loading. Please wait.

Presentation is loading. Please wait.

Simulation Basic Concepts. NEED FOR SIMULATION Mathematical models we have studied thus far have “closed form” solutions –Obtained from formulas -- forecasting,

Similar presentations


Presentation on theme: "Simulation Basic Concepts. NEED FOR SIMULATION Mathematical models we have studied thus far have “closed form” solutions –Obtained from formulas -- forecasting,"— Presentation transcript:

1 Simulation Basic Concepts

2 NEED FOR SIMULATION Mathematical models we have studied thus far have “closed form” solutions –Obtained from formulas -- forecasting, inventory, queuing –Obtained by algorithms -- linear programming, PERT/CPM However, each of these models had to satisfy a restrictive set of assumptions –Many “real-life” situations do not meet these conditions or are too complex. SIMULATIONSIMULATION can be used to get “good” results

3 BACKGROUND Simulation is, in fact, the most used management science technique Simulation is not an optimization procedure like the one used to solve linear programs However, if you are considering one of a set of options, simulation can indicate which of these options appears to be the best in the set.

4 BASIC IDEA Recognize the components of the system under study Develop a random number mapping that will “map” random numbers from a (computer generated) random number table into events

5 Random Number Table

6 RANDOM NUMBER MAPPINGS Suppose that the number of students that miss a statistics class have been observed to be 0, 1, 2, 3, or 4 with the following probabilities: NUMBER 0 1 2 3 4 PROB..21.35.19.15.10 RN Map 00-20 21-55 56-74 75-89 90-99

7 APPROACH Generate a set of random numbers and map them into events We will choose the first two digits from column 1 of the random number table in the book

8 Simulation of 10 Classes 1 652 2773 3612 4883 5421 6742 7110 8401 9030 10622 ClassRandom # # Absences

9 ANALYSIS BETTER RESULTS We can now analyze “simulated results” Average # absences = (2+3+2+3+1+2+0+1+0+2)/10 = 1.6 For better results we can: –Repeat this 10-class simulation many times –Run the simulation for many more than 10 classes

10 PSEUDO RANDOM NUMBERS Random numbers should be uniformly distributed: –each digit in a random number should have a probability of 1/10 of occurring after any other digit –no pattern should exist in the random numbers Random numbers generated by a computer program are done so by an algorithm and the above conditions may be slightly violated The result is that the random numbers are not truly random - they are PSEUDO RANDOM NUMBERS

11 Mid Square Random Number Generating algorithm Mid Square.There are many ways to generate “random” numbers. One of the easy algorithm is Mid Square.

12 Mid Square Method 7182First, we start with a four-digit seed value, for example, 7182. We then square it to get a number up to eight digits long. 5811 –If the number has fewer than eight digits, we pad the left with zeroes until we get eight digits. In our example, 7182^2 gives us 51581124. Now we choose the “middle” four digits of our result, which is 5811 in our example. We divide by 10,000 to get our first random number, e.g. 0.5811. We repeat this process indefinitely…

13 Mid Square Method

14 BENEFIT OF USING PSEUDO RANDOM NUMBERS The string of pseudo random numbers can be regenerated This allows us to compare policies under exactly the same conditions

15 PROBABILITIES AND RANDOM NUMBERS Typically computer generated random numbers are numbers between 0 and 1 –We can “lop off” the decimal for convenience The probabilities of possible events will be expressed as 1-digit, 2-digit, 3-digit, or …. probabilities -- the random numbers we use/assign should be of the same length

16 USING EXCEL TO GENERATE RANDOM EVENTS 1.Create a 3-column LOOKUP table Column 1 – Lower Limit of the RN Interval Column 2 – Probability in the RN interval Column 3 – The corresponding X value for the interval =RAND() 2.Create a series of random numbers by =RAND() and drag down. EDIT/PASTE SPECIAL/VALUESCopy the random numbers then go to: EDIT/PASTE SPECIAL/VALUES and paste the same set of numbers on top of themselves (otherwise they will change anytime is pressed.) VLOOKUP(A,B,C) 3.To get the corresponding simulated results enter VLOOKUP(A,B,C) and drag, where: A = cell with the random number in it B = location of the table (i.e. $A$2:$C$7) make address of table absolute C = the column that has the simulated result in the table (3)

17 RANDOM NUMBER MAPPINGS Suppose that the number of students that miss a statistics class have been observed to be 0, 1, 2, 3, or 4 with the following probabilities: NUMBER 0 1 2 3 4 PROB..21.35.19.15.10 (Table) RN Map 00-20 21-55 56-74 75-89 90-99 (Pseudo RN) RN Map.00.21.56.75.90 (Beginning Interval)

18 Create Probability Table

19 Create Lower Limits For Intervals 0 =A3+B3 Drag down

20 Generate Random Numbers =RAND() Drag down You will get different numbers Highlight cells B11:B25 – copy Leave cursor in cell B11.

21 Get Simulated Results =VLOOKUP(B11,$A$3:$C$7,3) Drag down Where the random number is Where the table is Put in $ signs Column of Lookup table that has Simulated results

22 Review Simulation can be used to approximate complex systems Use of pseudorandom numbers Random Number Mapping into Events Calculations How to Gain More Confidence Use of Lookup Tables and Excel’s RAND() and VLOOKUP functions


Download ppt "Simulation Basic Concepts. NEED FOR SIMULATION Mathematical models we have studied thus far have “closed form” solutions –Obtained from formulas -- forecasting,"

Similar presentations


Ads by Google