Computer Simulation: A Foundational Approach Using Python

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Computer simulation is an effective and popular universal tool that can be applied to almost all disciplines. Requiring only basic knowledge of programming, mathematics, and probability theory, Computer Simulation: A Foundational Approach Using Python takes a hands-on approach to programming to introduce the fundamentals of computer simulation. The main target of the book is computer science and engineering students who are interested mainly in directly applying the techniques to their research problems. The book will be of great interest to senior undergraduate and starting graduate students in the fields of computer science and engineering and industrial engineering.

Author(s): Yahya Esmail Osais
Publisher: CRC Press
Year: 2017

Language: English
Pages: 313

Cover
Half Title
Title Page
Copyright Page
Dedication
Table of Contents
List of Programs
List of Figures
List of Tables
Foreword
Preface
About the Author
Abbreviations
Symbols
PART I: The Fundamentals
CHAPTER 1: Introduction
1.1 THE PILLARS OF SCIENCE AND ENGINEERING
1.2 STUDYING THE QUEUEING PHENOMENON
1.3 WHAT IS SIMULATION?
1.4 LIFECYCLE OF A SIMULATION STUDY
1.5 ADVANTAGES AND LIMITATIONS OF SIMULATION
1.6 OVERVIEW OF THE BOOK
1.7 SUMMARY
CHAPTER 2: Building Conceptual Models
2.1 WHAT IS A CONCEPTUAL MODEL?
2.2 ELEMENTS OF A CONCEPTUAL MODEL
2.2.1 Entities
2.2.2 Attributes
2.2.3 State Variables
2.2.4 Events
2.2.5 Activities
2.3 THE SINGLE-SERVER QUEUEING SYSTEM
2.4 STATE DIAGRAMS
2.5 ACTUAL TIME VERSUS SIMULATED TIME
2.6 SUMMARY
2.7 EXERCISES
CHAPTER 3: Simulating Probabilities
3.1 RANDOM EXPERIMENTS AND EVENTS
3.2 WHAT IS PROBABILITY?
3.3 COMPUTING PROBABILITIES
3.4 PROBABILITY AS A SAMPLE MEAN
3.5 SUMMARY
3.6 EXERCISES
CHAPTER 4: Simulating Random Variables and Stochastic Processes
4.1 WHAT ARE RANDOM VARIABLES?
4.1.1 Probability Mass Functions
4.1.2 Cumulative Distribution Functions
4.1.3 Probability Density Functions
4.1.4 Histograms
4.2 SOME USEFUL RANDOM VARIABLES
4.2.1 Bernoulli
4.2.2 Binomial
4.2.3 Geometric
4.2.4 Poisson
4.2.5 Uniform
4.2.6 Exponential
4.2.7 Erlang
4.2.8 Normal
4.2.9 Triangular
4.3 STOCHASTIC PROCESSES
4.4 DYNAMIC SYSTEM EVOLUTION
4.5 SIMULATING QUEUEING PROCESSES
4.5.1 Discrete-Time Markov Chains
4.5.2 Continuous-Time Markov Chains
4.6 SUMMARY
4.7 EXERCISES
CHAPTER 5: Simulating the Single-Server Queueing System
5.1 SIMULATION MODEL
5.2 COLLECTING SIMULATED DATA
5.3 PERFORMANCE LAWS
5.3.1 Throughput
5.3.2 Utilization
5.3.3 Response Time
5.3.4 E[N(t)]
5.3.5 P[N]
5.4 INDEPENDENT SIMULATION RUNS
5.5 TRANSIENT AND STEADY PHASES
5.6 SUMMARY
5.7 EXERCISES
CHAPTER 6: Statistical Analysis of Simulated Data
6.1 POPULATIONS AND SAMPLES
6.2 PROBABILITY DISTRIBUTION OF THE SAMPLE MEAN
6.3 CONFIDENCE INTERVALS
6.3.1 Interpretations
6.3.2 Why Not Always Use a 99% Confidence Interval?
6.4 COMPARING TWO SYSTEM DESIGNS
6.5 SUMMARY
6.6 EXERCISES
PART II: Managing Complexity
CHAPTER 7: Event Graphs
7.1 WHAT IS AN EVENT GRAPH?
7.2 EXAMPLES
7.2.1 The Arrival Process
7.2.2 Single-Server Queueing System
7.2.3 Multiple-Server Queueing System
7.2.4 Single-Server Queueing System with a Limited Queue Capacity
7.2.5 Single-Server Queuing System with Failure
7.2.6 Single-Server Queuing System with Reneging
7.2.7 Single-Server Queuing System with Balking
7.3 TRANSLATING EVENT GRAPHS INTO CODE
7.4 SUMMARY
7.5 EXERCISES
CHAPTER 8: Building Simulation Programs
8.1 TIME-DRIVEN SIMULATION
8.2 EVENT-DRIVEN SIMULATION
8.3 WRITING EVENT-DRIVEN SIMULATION PROGRAMS
8.4 PROGRAMMING ISSUES
8.4.1 Event Collision
8.4.2 Identifiers for Packets
8.4.3 Stopping Conditions for the Simulation Loop
8.5 SUMMARY
8.6 EXERCISES
PART III: Problem-Solving
CHAPTER 9: The Monte Carlo Method
9.1 ESTIMATING THE VALUE OF π
9.2 NUMERICAL INTEGRATION
9.3 ESTIMATING A PROBABILITY
9.3.1 Buffon's Needle Problem
9.3.2 Reliability
9.4 VARIANCE REDUCTION TECHNIQUES
9.4.1 Control Variates
9.4.2 Stratified Sampling
9.4.3 Antithetic Sampling
9.4.4 Dagger Sampling
9.4.5 Importance Sampling
9.5 SUMMARY
9.6 EXERCISES
PART IV: Sources of Randomness
CHAPTER 10: Random Variate Generation
10.1 THE INVERSION METHOD
10.1.1 Continuous Random Variables
10.1.2 Discrete Random Variables
10.1.2.1 Generating a Bernoulli Variate
10.1.2.2 Generating a Binomial Variate
10.1.2.3 Generating a Geometric Variate
10.2 THE REJECTION METHOD
10.3 THE COMPOSITION METHOD
10.4 THE CONVOLUTION METHOD
10.5 SPECIALIZED METHODS
10.5.1 The Poisson Distribution
10.5.2 The Normal Distribution
10.6 SUMMARY
10.7 EXERCISES
CHAPTER 11: Random Number Generation
11.1 PSEUDO-RANDOM NUMBERS
11.2 CHARACTERISTICS OF A GOOD GENERATOR
11.3 JUST ENOUGH NUMBER THEORY
11.3.1 Prime Numbers
11.3.2 The Modulo Operation
11.3.3 Primitive Roots for a Prime Number
11.4 THE LINEAR CONGRUENTIAL METHOD
11.5 THE MULTIPLICATIVE CONGRUENTIAL METHOD
11.5.1 2k Modulus
11.5.2 Prime Modulus
11.6 LINEAR FEEDBACK SHIFT REGISTERS
11.7 STATISTICAL TESTING OF RNGs
11.7.1 The Chi-Squared Test
11.7.2 The Poker Test
11.7.3 The Spectral Test
11.7.4 The Lag Plot
11.8 SUMMARY
11.9 EXERCISES
PART V: Case Studies
CHAPTER 12: Case Studies
12.1 NETWORK RELIABILITY
12.2 PACKET DELIVERY OVER A WIRELESS CHANNEL
12.3 SIMPLE ARQ PROTOCOL
12.4 SUMMARY
12.5 EXERCISES
APPENDIX A: Overview of Python
A.1 BASICS
A.2 INPUT AND OUTPUT
A.3 BITWISE OPERATORS
A.4 LISTS
A.5 LIST FUNCTIONS
A.6 GENERATING RANDOM NUMBERS AND RANDOM VARIATES
A.7 IMPLEMENTING THE EVENT LIST
A.7.1 Priority Queue
A.7.2 Heap Queue
A.7.3 Sorting a List
A.8 PASSING A FUNCTION NAME AS AN ARGUMENT
A.9 TUPLES AS RECORDS
A.10 PLOTTING
APPENDIX B: An ObjectOriented Simulation Framework
APPENDIX C: The Chi-Squared Table
APPENDIX D: The t-Distribution Table
Bibliography
Index