ISE/OR 762 Stochastic Simulation Techniques

Similar documents
Queueing Theory and Simulation. Introduction

On the Partitioning of Servers in Queueing Systems during Rush Hour

Probability and Statistics Concepts

The Monte Carlo method what and how?

Stochastic Simulation of Communication i Networks

The University of British Columbia Computer Science 405 Practice Midterm Solutions

Simulation. Where real stuff starts

Chapter 2 SIMULATION BASICS. 1. Chapter Overview. 2. Introduction

Computer Science, Informatik 4 Communication and Distributed Systems. Simulation. Discrete-Event System Simulation. Dr.

1.225J J (ESD 205) Transportation Flow Systems

Chapter 2 Queueing Theory and Simulation

Queueing Theory I Summary! Little s Law! Queueing System Notation! Stationary Analysis of Elementary Queueing Systems " M/M/1 " M/M/m " M/M/1/K "

Stochastic Simulation of Communication Networks and their Protocols

MULTIPLE CHOICE QUESTIONS DECISION SCIENCE

Simulation & Modeling Event-Oriented Simulations

Simulation. Where real stuff starts

THE HEAVY-TRAFFIC BOTTLENECK PHENOMENON IN OPEN QUEUEING NETWORKS. S. Suresh and W. Whitt AT&T Bell Laboratories Murray Hill, New Jersey 07974

Monte Carlo Methods for Computation and Optimization (048715)

Session-Based Queueing Systems

Recap. Probability, stochastic processes, Markov chains. ELEC-C7210 Modeling and analysis of communication networks

Chapter 6 Queueing Models. Banks, Carson, Nelson & Nicol Discrete-Event System Simulation

PBW 654 Applied Statistics - I Urban Operations Research

The exponential distribution and the Poisson process

NANYANG TECHNOLOGICAL UNIVERSITY SEMESTER I EXAMINATION MH4702/MAS446/MTH437 Probabilistic Methods in OR

Ways to study a system System

Dynamic Call Center Routing Policies Using Call Waiting and Agent Idle Times Online Supplement

Chapter 4: Monte Carlo Methods. Paisan Nakmahachalasint

2905 Queueing Theory and Simulation PART IV: SIMULATION

Discrete-event simulations

Systems Simulation Chapter 6: Queuing Models

Making Delay Announcements

Chapter 1 (Basic Probability)

Slides 9: Queuing Models

GI/M/1 and GI/M/m queuing systems

Random variables. DS GA 1002 Probability and Statistics for Data Science.

CS 798: Homework Assignment 3 (Queueing Theory)

IEOR 6711: Stochastic Models I, Fall 2003, Professor Whitt. Solutions to Final Exam: Thursday, December 18.

Non Markovian Queues (contd.)

Sampling exactly from the normal distribution

Design of discrete-event simulations

Modeling Fundamentals: Concepts of Models and Systems Concepts of Modeling Classifications of Models

Other properties of M M 1

Stochastic Models in Computer Science A Tutorial

BIRTH DEATH PROCESSES AND QUEUEING SYSTEMS

EE 368. Weeks 3 (Notes)

Sandwich shop : a queuing net work with finite disposable resources queue and infinite resources queue

Link Models for Circuit Switching

Continuous Time Processes

Introduction to Queueing Theory with Applications to Air Transportation Systems

The problems that follow illustrate the methods covered in class. They are typical of the types of problems that will be on the tests.

Chapter 10 Verification and Validation of Simulation Models. Banks, Carson, Nelson & Nicol Discrete-Event System Simulation

Class 11 Non-Parametric Models of a Service System; GI/GI/1, GI/GI/n: Exact & Approximate Analysis.

7 Variance Reduction Techniques

Online Supplement to Delay-Based Service Differentiation with Many Servers and Time-Varying Arrival Rates

M/G/1 and M/G/1/K systems

Solution: The process is a compound Poisson Process with E[N (t)] = λt/p by Wald's equation.

Queueing Review. Christos Alexopoulos and Dave Goldsman 10/6/16. (mostly from BCNN) Georgia Institute of Technology, Atlanta, GA, USA

Introduction to Modelling and Simulation

Introduction to queuing theory

Section 1.2: A Single Server Queue

Dynamic Call Center Routing Policies Using Call Waiting and Agent Idle Times Online Supplement

Queueing Theory. VK Room: M Last updated: October 17, 2013.

Computer Networks More general queuing systems

Advanced Computer Networks Lecture 3. Models of Queuing

The Performance Impact of Delay Announcements

Little s result. T = average sojourn time (time spent) in the system N = average number of customers in the system. Little s result says that

System Simulation Part II: Mathematical and Statistical Models Chapter 5: Statistical Models

CDA5530: Performance Models of Computers and Networks. Chapter 4: Elementary Queuing Theory

Exercises Stochastic Performance Modelling. Hamilton Institute, Summer 2010

Performance Evaluation of Queuing Systems

Computer Applications for Engineers ET 601

Introduction to queuing theory

6.262: Discrete Stochastic Processes 2/2/11. Lecture 1: Introduction and Probability review

On the Partitioning of Servers in Queueing Systems during Rush Hour

Q = (c) Assuming that Ricoh has been working continuously for 7 days, what is the probability that it will remain working at least 8 more days?

Analysis of a Two-Phase Queueing System with Impatient Customers and Multiple Vacations

CS 1538: Introduction to Simulation Homework 1

ECE 3511: Communications Networks Theory and Analysis. Fall Quarter Instructor: Prof. A. Bruce McDonald. Lecture Topic

Tutorial: Optimal Control of Queueing Networks

0utline. 1. Tools from Operations Research. 2. Applications

IEOR 6711, HMWK 5, Professor Sigman

NATCOR: Stochastic Modelling

1 Modelling and Simulation

Stochastic Models of Manufacturing Systems

Queueing Review. Christos Alexopoulos and Dave Goldsman 10/25/17. (mostly from BCNN) Georgia Institute of Technology, Atlanta, GA, USA

ec1 e-companion to Liu and Whitt: Stabilizing Performance

Wait-Time Predictors for Customer Service Systems with Time-Varying Demand and Capacity

Bayesian Inference. Chapter 2: Conjugate models

4.5 Applications of Congruences

(b) What is the variance of the time until the second customer arrives, starting empty, assuming that we measure time in minutes?

Wait-Time Predictors for Customer Service Systems With Time-Varying Demand and Capacity

ISyE 6644 Fall 2016 Test #1 Solutions

CS418 Operating Systems

Classical Queueing Models.

MARKOV PROCESSES. Valerio Di Valerio

System Simulation Part II: Mathematical and Statistical Models Chapter 5: Statistical Models

Hand Simulations. Christos Alexopoulos and Dave Goldsman 9/2/14. Georgia Institute of Technology, Atlanta, GA, USA 1 / 26

Verification and Validation. CS1538: Introduction to Simulations

Computer Science, Informatik 4 Communication and Distributed Systems. Simulation. Discrete-Event System Simulation. Dr.

CDA6530: Performance Models of Computers and Networks. Chapter 8: Discrete Event Simulation (DES)

Transcription:

ISE/OR 762 Stochastic Simulation Techniques Topic 0: Introduction to Discrete Event Simulation Yunan Liu Department of Industrial and Systems Engineering NC State University January 9, 2018 Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 1 / 20

Why Simulation? Simulation is used to simulate the operations of various kinds of real-world systems or processes with the aid of a computer. We make assumptions about how a system works; these assumptions constitute a model. Models are used to gain some understanding of how a system behaves. Analysis approach based on system complexity: Simple models: use analytical (mathematical) methods to obtain exact information on questions of interest. Complex models: use simulation to evaluate the model numerically. Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 2 / 20

System Analysis System: a collection of entities, e.g. people or machines, that act and interact together toward the accomplishment of some logical end. State: collection of variables necessary to describe a system at a particular time, relative to the objectives of a study. A system can be discrete or continuous depending on how the state variables change with respect to time. Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 3 / 20

Application of Simulation Designing and analyzing manufacturing and inventory systems Determining hardware requirements or protocols for communication networks Determining hardware and software requirements for computer systems Designing and operating transportation systems such as airports, freeways, sports and subways Evaluating designs for service organizations such as call centers, fast-food restaurants, hospitals and post offices Analyzing financial or economic systems; pricing complex financial instruments Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 4 / 20

Different Kinds of Simulation Static v.s. dynamic Does time have a role in the model? Continuous-change v.s. discrete-change Can state change continuously, or only a discrete points in time? Deterministic v.s. stochastic Is everything for sure or is there uncertainty? By hand v.s. by computer Is the model complicated so we need a computer? Most operational models: Dynamic, discrete-change, stochastic, computer-based Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 5 / 20

Discrete Event Simulation Objective: Model a system as it evolves over time by a representation in which the state variables change instantaneously at separate points in time, e.g. a queue. Characteristics: Keep track of the simulated (random) time as simulation proceeds. Advance simulated time via a simulation clock. Simulation clock can be advanced either when an event occurs or at a fixed increment of time. Sample system states as time evolves to prepare for output estimators. Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 6 / 20

Example: A Single-Server Queue Random elements: Ai = time of arrival of the i th customer; ti = A i A i 1 = interarrival time (t 0 = 0); Vi = processing (service) time of i th customer; Wi = waiting time of i th customer (excluding service); Di = A i + W i + V i = departure time of i th customer. Possible events: arrivals and departures. Advance simulation clock when an event occurs ei = time of the i th event. V i s and t i s distributed according to a known distribution. Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 7 / 20

Estimating Useful Performance Metrics Estimate the average waiting time of customers N(t) = number of customers that have arrived in [0, t] Ŵ (T ) = 1 N(T ) N(T ) i=1 Estimate the average number of customers in the system W i Q(t) = total number of customers in the system at time t Q(T ) = 1 T T 0 Q(t)dt. Estimate the average utilization ρ(t ) = 1 T T 0 B(t)dt, B(t) = 1 {Q(t)>0}. Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 8 / 20

An Example with Numbers Set T = 10 Initialize system so that there are no customers at time 0 Generate arrivals and service times according to their distributions Arrival times: 1.5, 2.4, 3, 3.6, 6, 7.7, 9.2, 11 Processing times: 1, 1.5, 1, 2, 0.5, 3.5, 1.5, 1 Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 9 / 20

Simulation Outputs Compute desired performance functions: N(T ) = 7 Ŵ (T ) = 0+0.1+1+1.4+1+2 7 = 0.7857 Q(T ) = 1 (.9+.5+1+.5+1.5)+2 (.1+.6+1+1+.8)+3.4 ρ(t ) = 1 10 10 = 1.26 [10 1.5.2] = 0.83 Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 10 / 20

Monte Carlo Simulation Definition: Computational algorithms that rely on repeated random sampling to obtain numerical results. (A simulation estimator based on strong law of large numbers.) Named after the gambling hot spot in Monaco: chance and random outcomes are central to the modeling technique, much as they are to games like roulette, dice and slot machines. First developed by Stanislaw Ulam and John Von Neumann. Applications: Evaluate complicated integrals (multiple dimensions), pricing complex financial instruments (options) Example: Estimate the value of I b a g(x)dx. Generate X Unif(a, b), set Y = (b a)g(x ). Then 1 n n Y i E[Y ] = (b a)e[g(x )] = (b a) i=1 b a g(x) 1 b a dx = b a g(x)dx. Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 11 / 20

Buffon s Needle Problem: Precomputer Simulation in 1777 Buffon is remembered in the history of probability theory for his famous needle problem - the first example of a simulation experiment Buffon s Needle Problem: If a floor has equally spaced parallel lines a distance d apart and if a needle of length l is tossed at random on the floor where l d, then what is the probability that the needle will intersect a line? Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 12 / 20

Buffon s Needle Problem: Precomputer Simulation in 1777 The distance from the head of a needle to a line is X Unif(0, d). Conditioning on Θ: P (Needle intersects a line Θ = θ) = P (X [0, l sin θ]) = Unconditioning on Θ yields: P (Needle intersects a line) = = π 2 0 π 2 0 l sin θ 0 1 d P (Needle intersects a line Θ = θ) sin θ l d When l = d, P (Needle intersects a line) = 2 π = 0.637. 2 2l dθ = π πd = 0.637. sin θ l dx =. d 1 π/2 dθ Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 13 / 20

Buffon s Needle Problem: Precomputer Simulation in 1777 Toss a needle for a large number N times. Define independent r.v. s: { 1, if i X i = 1 {i th needle crosses a line} = th needle crosses a line; 0, otherwise. According to the strong law of large number (SLLN): 1 lim N N N X i = 2 π i=1 so that π 2 1 N N i=1 X i for N large. Remarks: Buffon s needle-tossing experiment can be conducted by hand. It is the earliest example of using independent replications of a simulation to approximate an important physical constant. Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 14 / 20

Simulations in TV Shows British Sci-Fi TV drama on Netflix: Black Mirror Season 4, Episode 4: Hang the DJ An algorithm simulating the dating outcomes of 1000 independent digital copies of the consciousness of Frank and Amy. The app promises a 99.8% percent perfect match. Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 15 / 20

Issues Arising in Monte Carlo Simulation How to generate needed input random objects? How many computer experiments do we need? How to compute expectations associated with limit stationary distributions? How to exploit problem structure to speed up the computation? How to efficiently compute probabilities of rare events? How to estimate sensitivity of a stochastic model to changes in a parameter? How to use simulation to optimize our choice of decision parameters? Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 16 / 20

Advantages and Disadvantages of Simulation Advantages: Simulation allows to estimate the performance of complex, real-world, systems that cannot be evaluated analytically. Allows us to study long time frames in compressed time. Provides better control of experimental conditions. Disadvantages: Lacking of insights. Expensive and time-consuming to develop. Produces only estimates (not exact) of a model s true characteristics. Implementation errors; Sampling errors; Machine errors; Statistical errors. Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 17 / 20

Pitfalls of Simulation Lack of well defined objectives. Failure to collect good system data. Failure to account correctly for sources of randomness. Use of arbitrary distributions. Assume independence when it is not present. Not running enough simulations. Treating simulation results as true answers. Replacing random variables by their means. Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 18 / 20

Danger of Replacing Random Variables by Their Means Example: Consider a manufacturing system consisting of a single machine. Raw parts arrive according to a Poisson process with rate λ = 1 per min. Processing times are exponentially distributed with mean 1/µ = 0.99 min. This is an M/M/1 queue with traffic intensity ρ = 0.99 (ISE760) The long-run average number of customers in the system 1 E[Q( )] = lim t t The long-run average waiting time 1 E[W ] = lim n n t 0 Q(u)du = ρ 1 ρ = 99. n W i = 1 ρ = 98.01 minutes. µ 1 ρ i=1 However, if we replace both distributions by their corresponding means, then The average number of customers in system 1; No part is ever delayed in the queue! Conclusion: Ignoring randomness may result in extremely inaccurate estimates. Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 19 / 20

Rest of the Class... Review of probability theory (Topic 1). How to generate the random elements (variable, process, permutation, etc.) following various distributions (Topics 2 3). How to use Monte Carlo simulation to price path-dependent financial instruments (Topic 4). How to use the generated random elements to characterize the dynamics of a realistic system (Topic 5). Given a realization of a system, how to design effective procedures to estimate desired performance measures (Topic 6). When many sample paths (realizations) are needed, how to design efficient method to reduce number of samples (shortening the total computation time, Topic 7). How to select appropriate probability distributions (and their parameters) for the simulation algorithms (Topic 8). Yunan Liu (NC State University) Stochastic Simulations January 9, 2018 20 / 20