Lecture 1 Introduction to Simulation
2 The Opportunity Game Cost to Play: $1000 Payoff ($): (A Spinner) x (B Spinner) – (C Spinner) Return ($): Payoff – Cost-to-Play Cost to Play: $1000 Payoff ($): (A Spinner) x (B Spinner) – (C Spinner) Return ($): Payoff – Cost-to-Play Spinner ASpinner BSpinner C
3Problems If available time (for playing the game) is no problem, and if there is no constraint on available working capital, would a prudent person choose to play this game (repeatedly)? (In other words, what is the expected (that is, the long-run average) Return? If available time (for playing the game) is no problem, and if there is no constraint on available working capital, would a prudent person choose to play this game (repeatedly)? (In other words, what is the expected (that is, the long-run average) Return?
4 Alternative Solution Approaches Solve the problem mathematically Perform experiments with real system Perform experiments with a model (representation) of the real system Solve the problem mathematically Perform experiments with real system Perform experiments with a model (representation) of the real system
5 Mathematical Model Expected results of individual Spinners (long-run individual spinner results) Expected results of individual Spinners (long-run individual spinner results) Expected – A-Spinner Result OutcomeProbabilityOutcome x Probability 11 / / / / / Sum (Expected Outcome) : 3.0 Expected – C-Spinner Result OutcomeProbabilityOutcome x Probability 2002 / / / / 1050 Sum (Expected Outcome) : 340 Expected – B-Spinner Result OutcomeProbabilityOutcome x Probability 4002 / / / / 1070 Sum (Expected Outcome) : 530
6 Mathematical Model (cont’) What is the Expected Return in the Opportunity Game? Payoff = (A-Spinner) x (B-Spinner) – (C-Spinner) Return = Payoff – (Cost-to-Play) substitute expected spinner results to get expected Payoff and Return Expected Payoff = (3.0) x (530) – (340) = $1,250 Expected Return = $1,250 - $1,000 = $250 What is the Expected Return in the Opportunity Game? Payoff = (A-Spinner) x (B-Spinner) – (C-Spinner) Return = Payoff – (Cost-to-Play) substitute expected spinner results to get expected Payoff and Return Expected Payoff = (3.0) x (530) – (340) = $1,250 Expected Return = $1,250 - $1,000 = $250
7 Complicated Question What are the chances that a person will lose money in a single play of the game? The answer to this question can be developed mathematically, but doing so requires: computing the relative frequency with which each of the possible returns occurs, then using these relative frequencies to determine the cumulative frequencies for the returns ordered from lowest to highest, and finally looking up the cumulative frequency for negative returns What are the chances that a person will lose money in a single play of the game? The answer to this question can be developed mathematically, but doing so requires: computing the relative frequency with which each of the possible returns occurs, then using these relative frequencies to determine the cumulative frequencies for the returns ordered from lowest to highest, and finally looking up the cumulative frequency for negative returns
8 Complicated Question (cont’) This is done by enumerating all of the various possible spinner combinations and using the law of multiplication to compute the probability associated with each combination (and then using the law of addition to add probabilities for identical outcomes to determine the overall probability of that outcome) This is done by enumerating all of the various possible spinner combinations and using the law of multiplication to compute the probability associated with each combination (and then using the law of addition to add probabilities for identical outcomes to determine the overall probability of that outcome)
9 Solution by Enumeration Spinner A Spinner B Spinner C Probability StartReturn $300 $200 $100 $0 4 / 10 2 / 10 3 / 10 4 / 10 1 / 10 and so on, for all other combinations of Spinner A, Spinner B and Spinner C and so on, for all other combinations of Spinner A, Spinner B and Spinner C
10 Opportunity Game Outcomes ReturnRelative FrequencyCumulative Frequency -$ $ $ $ ……… -$ $ $ $ $ ……… $ $ $ distinct returns, ranging from -$1100 to $2300
11 Opportunity Game Histogram A histogram showing relative frequencies of various “Return” ranges in the Opportunity Game % 31% 27.2% 13.2% 15% 6.8% 0.2% 1.4%
12 More Complicated Questions If a person had $2000 in working capital, and enough time to play the game up to 25 times, what are chances that the person would: go bankrupt? lose money, but not go bankrupt? break even? make money? exceed the expected gain of $6250? ($6250 = 25 x $250) If a person had $2000 in working capital, and enough time to play the game up to 25 times, what are chances that the person would: go bankrupt? lose money, but not go bankrupt? break even? make money? exceed the expected gain of $6250? ($6250 = 25 x $250)
13 More Complicated Questions (cont’) A mathematical approach can also be taken to answer each of these questions, but the calculations, although straightforward, are quite tedious!
14 Alternative Solution Approaches Solve the problem mathematically Perform experiments with real system Perform experiments with a model (representation) of the real system Solve the problem mathematically Perform experiments with real system Perform experiments with a model (representation) of the real system
15 Real System It would be easy to construct the “opportunity game” spinners and play the game repeatedly (without dollar consequences), say 1,000 times, then use the average result as an estimate of the expected result More generally, experimentation on “the real system” can be done in concept, but often cannot be done in practice Experimenting on the real system requires of course that the system exists, and it might not (the goal might in fact be to design a system) It would be easy to construct the “opportunity game” spinners and play the game repeatedly (without dollar consequences), say 1,000 times, then use the average result as an estimate of the expected result More generally, experimentation on “the real system” can be done in concept, but often cannot be done in practice Experimenting on the real system requires of course that the system exists, and it might not (the goal might in fact be to design a system)
16 Real System (cont’) If the system does exists, it might not be feasible to experiment with it, for reasons such as these: Economic reasons (it might be prohibitively expensive to interrupt the ongoing use of the real system) Political reasons (it might be difficult to get permission from the system’s “owners” to experiment with the system) Real-system experiments might take too long (days, weeks, or months of experimentation might be required, and so the findings might not be available in time to do any good) If the system does exists, it might not be feasible to experiment with it, for reasons such as these: Economic reasons (it might be prohibitively expensive to interrupt the ongoing use of the real system) Political reasons (it might be difficult to get permission from the system’s “owners” to experiment with the system) Real-system experiments might take too long (days, weeks, or months of experimentation might be required, and so the findings might not be available in time to do any good)
17 Alternative Solution Approaches Solve the problem mathematically Perform experiments with real system Perform experiments with a model (representation) of the real system Solve the problem mathematically Perform experiments with real system Perform experiments with a model (representation) of the real system
18 Model of the Real System For our purposes, simulation is a numerical technique for conducting experiments with a model that describes or mimics the behaviour of a system A model is a representation of a system that behaves like the system itself behaves (the model may not behave like the system in all respects, but the model must behave like the system at least in those respects that are important for the purpose at hand) For our purposes, simulation is a numerical technique for conducting experiments with a model that describes or mimics the behaviour of a system A model is a representation of a system that behaves like the system itself behaves (the model may not behave like the system in all respects, but the model must behave like the system at least in those respects that are important for the purpose at hand)
19 Model of the Real System (cont’) In general, models sometimes are physical, e.g., blueprints of a house a three dimensional model of a shopping mall a mock-up of the control panels in a jetliner Models sometimes are logical abstractions based on the rules that govern the operation of a system, for example, a computer program that plays the “opportunity game” by determining spinner results at random and combining the results to determine the payoff and return. In general, models sometimes are physical, e.g., blueprints of a house a three dimensional model of a shopping mall a mock-up of the control panels in a jetliner Models sometimes are logical abstractions based on the rules that govern the operation of a system, for example, a computer program that plays the “opportunity game” by determining spinner results at random and combining the results to determine the payoff and return.
20 Spreadsheet Output