Stochastic Modeling

Chapter 11
Monte Carlo and Discrete-Event Simulation

Graduate Program in Business Analytics
Stochastic Modeling   •   Graduate

Monte Carlo and Discrete-Event Simulation

Introduction

Simulation is the study of a system through an executable model that reproduces selected aspects of the system’s behavior. In business analytics, simulation is valuable when uncertainty, interactions, and operational constraints make analytical solutions difficult or unrealistic. A model can estimate waiting times in a hospital, evaluate inventory policies, forecast portfolio risk, test call-center staffing, or assess the resilience of a supply network without experimenting directly on the real system.

Two closely related approaches dominate this chapter. Monte Carlo simulation repeatedly samples uncertain quantities and evaluates an outcome. It is especially suitable for static or time-independent models, such as project-cost risk or financial loss. Discrete-event simulation (DES) represents a system as a sequence of events occurring at particular times. It is suitable for queues, production systems, logistics, service operations, and other dynamic processes.

Simulation does not discover certainty. It produces estimates whose quality depends on the conceptual model, input data, random-number generation, experimental design, and statistical analysis of outputs. A sophisticated simulation with poor assumptions can be less useful than a simple, transparent model with credible inputs.

Learning objectives

After completing this chapter, you should be able to:

  1. Distinguish Monte Carlo simulation from discrete-event simulation and identify suitable applications.
  2. Generate pseudorandom variates and fit probability distributions to empirical data.
  3. Construct event calendars, state variables, and scheduling logic for DES models.
  4. Design warm-up periods, independent replications, and output-analysis procedures.
  5. Apply variance-reduction methods and explain their assumptions.
  6. Conduct sensitivity analysis and interpret simulation uncertainty.
  7. Design rare-event experiments and discuss digital-twin architectures, governance, and limitations.

1. Simulation as a modeling method

A simulation model consists of entities, attributes, resources, state variables, events, logic, inputs, and outputs. For example, in a call center, customers are entities; priority and arrival time are attributes; agents are resources; the queue length is a state variable; arrivals and service completions are events; and average waiting time is an output.

A useful distinction is between aleatory uncertainty and epistemic uncertainty. Aleatory uncertainty is inherent variability, such as random demand or service duration. Epistemic uncertainty arises from incomplete knowledge, such as uncertain demand parameters or an incorrectly specified service-time distribution. Repeated simulation addresses aleatory uncertainty but does not automatically resolve epistemic uncertainty. Parameter uncertainty should therefore be examined through scenarios, Bayesian analysis, or sensitivity analysis.

Monte Carlo estimation can be expressed generally as:

ŶN = (1/N) ∑i=1N g(Xi)

Here, Xi is the i-th random input vector, g(·) is the model response, N is the number of trials, and ŶN estimates E[g(X). The trials should be independent, or their dependence must be explicitly considered. If the output variance is finite, the standard error of the sample mean is approximately:

SE(ŶN) = sY / √N

where sY is the sample standard deviation of the simulated outputs. This formula describes Monte Carlo sampling error, not model error.

A confidence interval based on independent observations is commonly written as:

ŶN ± t1−α/2,N−1 (sY/√N)

where α is the significance level and t1−α/2,N−1 is a Student’s t critical value. The interval is justified when observations are independent and the sampling distribution of the mean is adequately approximated by a t distribution. In time-series simulation, observations collected at successive times are generally autocorrelated, so this direct formula can be misleading.

2. Random-number generation and input modeling

Pseudorandom numbers

Computers normally generate pseudorandom rather than truly random numbers. A generator begins with a seed and produces a deterministic sequence that appears random under statistical tests. Reproducibility is a major benefit: the same seed and algorithm can reproduce an experiment for debugging or audit.

A classical linear congruential generator has the form:

Zn+1 = (aZn + c) mod m

and produces the scaled value Un = Zn/m. Here, m is the modulus, a the multiplier, c the increment, and Z0 the seed. Poor parameter choices create short periods or visible patterns. Modern applications should use a well-tested library generator with a long period, documented algorithm, independent streams, and appropriate seeding. A generator is not a substitute for cryptographic randomness when security is involved.

Transforming uniforms

If U is uniform on (0,1), an exponential random variable with rate λ can be generated by inverse transformation:

T = −ln(U)/λ

The rate has units of events per unit time, so T has units of time. Because 1−U is also uniform, implementations often use T = −ln(1−U)/λ to avoid any issue if a generator returns a value extremely close to 1.

For a discrete distribution with probabilities p1,…,pk, divide (0,1) into intervals whose lengths are the probabilities and select category j when U falls in its interval. Inverse transformation is convenient for simple distributions; acceptance–rejection, composition, and specialized algorithms are useful for more complex distributions.

Distribution fitting

Input modeling should begin with process knowledge and data exploration, not automatic distribution selection. A practical workflow is:

  1. Define precisely what is measured, including units, censoring, truncation, and time dependence.
  2. Clean errors while preserving legitimate extreme observations.
  3. Examine histograms, empirical quantiles, time plots, and subgroup differences.
  4. Propose distributions using physical or operational reasoning.
  5. Estimate parameters by maximum likelihood, method of moments, or Bayesian methods.
  6. Compare fit using graphical diagnostics and tests such as Anderson–Darling or Kolmogorov–Smirnov, recognizing their dependence on sample size and parameter estimation.
  7. Validate against holdout data or operational experts.
  8. Propagate parameter uncertainty when it could affect decisions.

Common distributions include exponential service times, normal measurement errors, lognormal positive costs, gamma durations, Weibull failure times, triangular estimates, and empirical distributions. The exponential assumption implies the memoryless property; it should not be adopted merely because it is mathematically convenient. Correlation, seasonality, autocorrelation, and dependence between inputs may be more important than marginal distribution fit.

3. Discrete-event simulation architecture

In DES, the system state changes only at event times. A minimal event-scheduling model contains:

  • a simulation clock t;
  • state variables, such as queue length and resource status;
  • an event list ordered by event time;
  • event routines that update state and schedule future events;
  • statistical accumulators for performance measures;
  • a termination rule.

The next-event time advance method removes the earliest event from the event list, advances the clock to that time, executes its routine, updates statistics, and schedules newly created events. Simultaneous events require a documented tie-breaking rule. For example, a departure may be processed before an arrival at the same instant, or vice versa. The choice can matter and should reflect the physical system.

A typical single-server queue has arrivals, service starts, and departures. If an arrival occurs while the server is idle, service begins immediately and a departure is scheduled. Otherwise, the customer joins the queue. At departure, the server becomes idle if the queue is empty; otherwise the next customer begins service. Customer waiting time is service-start time minus arrival time; time in system is departure time minus arrival time.

For a stable M/M/1 queue, arrivals follow a Poisson process with rate λ, service times are exponential with rate μ, and ρ = λ/μ < 1. The theoretical mean number in system and mean time in system are:

L = ρ/(1−ρ), W = 1/(μ−λ)

Little’s law provides a general relationship:

L = λW

where L is the long-run average number in the system, λ is the long-run throughput, and W is mean time in system. Little’s law requires a stable system and consistent measurement definitions; it does not require exponential distributions. Such analytical results are valuable for validating a DES implementation.

4. A worked Monte Carlo example

Suppose annual demand for a product is modeled as a normal random variable with mean 10,000 units and standard deviation 1,500 units. A decision maker wants the probability that demand exceeds available capacity of 12,000 units. If the normal model is accepted, standardization gives:

P(D > 12,000) = 1 − Φ((12,000−10,000)/1,500)
= 1 − Φ(1.3333)
≈ 0.0918

where Φ is the standard normal cumulative distribution function. A Monte Carlo implementation would generate N standard normal variates Zi, compute Di = 10,000 + 1,500Zi, and record the indicator Ii = 1 if Di > 12,000. The estimated probability is:

p̂ = (1/N) ∑i=1N Ii

The indicator is Bernoulli with variance p(1−p). Thus its approximate standard error is √(p̂(1−p̂)/N). For N = 100,000 and p̂ ≈ 0.092, the standard error is approximately 0.00091. The simulation estimate should be close to 0.0918, subject to sampling error. The calculation also illustrates an important principle: if a reliable analytical solution exists, simulation should be used for extension, validation, or decision analysis rather than as an unnecessary replacement.

5. Designing simulation experiments

Verification and validation

Verification asks whether the model was implemented correctly: are equations coded correctly, events scheduled once, units consistent, and boundary cases handled? Techniques include code review, assertions, extreme-value tests, conservation checks, traces of individual entities, and comparison with hand calculations.

Validation asks whether the model is an adequate representation for its intended use. Evidence may include comparison with historical outputs, expert review, face validation, sensitivity to known policy changes, and comparison with analytical benchmarks. Validation is purpose-dependent: a model adequate for staffing may be inadequate for financial-loss forecasting.

Transient and terminating systems

A terminating simulation has a natural beginning and end, such as a one-day emergency-department operation or a project lifecycle. Replicate complete runs under specified initial conditions.

A steady-state simulation represents a continuing system, such as a warehouse or telecommunications network. Initial conditions often create a transient bias. A warm-up period allows the model to approach representative operating conditions; observations from that period are discarded. The warm-up length should be justified through plots, batch means, multiple initial conditions, or domain knowledge. Discarding an arbitrary warm-up does not guarantee removal of bias.

Replications and batch means

Independent replications use different random-number streams and generate independent estimates. For replication r, let Yr be its performance estimate. The overall estimate is:

Ȳ = (1/R) ∑r=1R Yr

and its standard error is sY/√R, where sY is the standard deviation across replications. Increasing run length reduces within-replication noise; increasing the number of replications improves estimation of uncertainty and supports statistical comparisons.

When independent replications are impractical, a long run can be divided into batches. Batch means reduce, but do not automatically eliminate, autocorrelation. Batch length should be sufficiently large relative to the system’s correlation time, and the number of batches should be adequate for estimating variability.

Comparing alternatives

Suppose two policies are simulated. Comparing separate random streams may produce a noisy difference. Common random numbers (CRN) use the same underlying random inputs for corresponding scenarios, inducing positive correlation when responses react similarly. The variance of a paired difference is:

Var(YA−YB) = Var(YA)+Var(YB)−2Cov(YA,YB)

Positive covariance reduces variance. CRN is effective only when the pairing is meaningful; careless synchronization can increase variance or create misleading comparisons.

6. Variance reduction and rare events

Variance reduction seeks greater precision for a fixed computational budget. Antithetic variates use negatively related inputs, commonly U and 1−U, when the model response is approximately monotonic. Control variates exploit a correlated variable with known expectation. If Y is the target and C has known mean E(C), an adjusted estimator is:

Y* = Y − b(C−E(C))

The optimal coefficient under standard assumptions is b* = Cov(Y,C)/Var(C). The control must be correctly centered, and its expectation must genuinely be known. Importance sampling changes the sampling distribution to observe important outcomes more often and reweights observations by likelihood ratios. It is powerful but technically sensitive: poor changes of measure can increase variance dramatically.

Rare-event simulation concerns probabilities so small that ordinary sampling produces almost no events. If an event has probability 10−6, one million ordinary trials may yield only about one event on average. Useful methods include importance sampling, splitting, conditional Monte Carlo, and subset simulation. Rare-event estimates should report effective sample size, weight variability, diagnostic plots, and sensitivity to the biasing distribution. A visually impressive estimate based on a few extreme weights is not reliable.

7. Sensitivity analysis and decision interpretation

Sensitivity analysis examines how outputs change when assumptions or inputs change. One-way analysis varies one factor while holding others fixed. Scenario analysis changes coherent sets of assumptions, such as recession demand and delayed supply. Global sensitivity analysis varies several inputs jointly and can decompose output variance using methods such as Sobol indices.

For a response Y = f(X), a local elasticity of Y with respect to Xj may be approximated by:

Ej ≈ (∆Y/Y)/(∆Xj/Xj)

This is dimensionless and useful for comparing drivers, but it is local and may be misleading for nonlinear or discontinuous models. Sensitivity should distinguish operational uncertainty from uncertainty about model structure. Decision makers should focus not only on the most statistically influential variable but also on variables that can actually be controlled.

Simulation outputs should be translated into decisions using costs, constraints, service levels, and risk preferences. A confidence interval around a mean does not answer a question about a high quantile, probability of stockout, or probability that one policy dominates another. The output measure and its estimator must match the decision.

8. Digital twins

A digital twin is a continuously updated digital representation of a physical or organizational asset, process, or system. Compared with a conventional offline simulation, a digital twin typically integrates live or near-live data, state estimation, simulation, visualization, and decision support.

A practical architecture includes sensors and enterprise systems; an ingestion and quality layer; a time-series store; a semantic model of assets and relationships; a simulation or predictive layer; and a controlled decision interface. The twin may combine DES, Monte Carlo risk analysis, optimization, machine learning, and rules. A twin for a distribution center could use scanner data to estimate current queues, simulate alternative labor allocations, and recommend a policy subject to service and safety constraints.

Digital twins introduce additional risks. Data latency can make a supposedly current state obsolete. Sensor bias and missing data can create false precision. Model drift can occur when processes, products, or customer behavior change. Cybersecurity, access control, audit trails, intellectual property, and human accountability are essential. A recommendation should be explainable enough for operational review, and automated actions should have safeguards and escalation procedures.

9. Illustrative case: staffing an omnichannel fulfillment center

Background and problem

This fictional case concerns a retailer whose fulfillment center processes online orders. Orders arrive throughout the day, are picked by workers, packed at stations, and dispatched by carrier cutoffs. Management is considering whether to add a packing station during the evening peak. The decision involves uncertain arrivals, order sizes, worker availability, and occasional equipment failures.

Analysis and approach

The team constructs a DES model with order entities, order-size attributes, picker and packer resources, queues, shift calendars, equipment-failure events, and carrier deadlines. Arrival rates vary by hour and day type. Rather than fitting one distribution to all service times, the team models service by order-size class and validates the fitted distributions against recent data. Correlation between large orders and packing time is retained.

Each policy is simulated using 40 independent replications after a warm-up appropriate for the beginning-of-day state. Common random numbers are used across policies so that each policy experiences comparable demand and failure realizations. Outputs include mean and 95th-percentile order completion time, probability of missing the carrier cutoff, labor hours, overtime, and utilization. Verification checks ensure that every order is either waiting, being processed, dispatched, or explicitly classified as unfinished at termination.

Outcome

The simulation indicates that adding a station only during the peak reduces cutoff-miss probability substantially, while adding a permanent station yields little additional service improvement but materially increases labor cost. A sensitivity analysis shows that equipment downtime and the arrival surge are more influential than small changes in average packing time. Management therefore chooses a peak-only station, a preventive-maintenance schedule, and a contingency labor pool. The recommendation is conditional: it should be revisited if order mix or carrier schedules change.

Learning points

The case demonstrates that simulation is not merely a forecasting device. It links operational assumptions to competing performance measures, exposes bottlenecks, supports controlled experimentation, and clarifies which uncertainties deserve better data. It also shows why validation, replication, and sensitivity analysis are part of the decision process rather than optional technical additions.

10. Limitations, ethics, and best practice

Simulation can be expensive to build and maintain. It may hide structural bias behind numerical detail, encourage overconfidence in point estimates, and produce unstable results when random seeds, warm-up periods, or replications are poorly chosen. Input data may underrepresent vulnerable customers or unusual disruptions. Optimization around a flawed model can worsen real-world outcomes.

Ethical practice requires documenting data provenance, assumptions, exclusions, parameter estimates, random seeds, software versions, and validation evidence. Analysts should disclose uncertainty and avoid presenting simulated scenarios as observed facts. If personal or operational data are used, privacy, access control, retention, and applicable data-protection requirements must be addressed. High-impact decisions require human review, fairness assessment, and monitoring after deployment.

A professional simulation study should:

  • formulate the decision and performance measures before coding;
  • use the simplest adequate model;
  • separate conceptual validation, verification, and output analysis;
  • use independent streams and reproducible experiment specifications;
  • justify distributions, warm-up, run length, and replication count;
  • report confidence intervals and sensitivity, not only averages;
  • compare simulation with analytical benchmarks where available;
  • preserve an audit trail and version-controlled model;
  • test model behavior under stress and out-of-distribution conditions;
  • communicate limitations clearly to decision makers.

Chapter Summary

Monte Carlo simulation estimates uncertain outcomes by repeated random sampling, while discrete-event simulation models dynamic systems through a time-ordered sequence of events. Reliable studies require credible input distributions, appropriate pseudorandom-number streams, explicit event logic, and careful verification and validation. Output analysis must address transient bias, autocorrelation, replication design, confidence intervals, and the distinction between sampling error and model uncertainty. Common random numbers, antithetic variates, control variates, and importance sampling can improve precision, while rare-event methods are needed for very small probabilities. Sensitivity analysis connects uncertain assumptions to managerial priorities. Digital twins extend simulation by integrating live data and operational decision support, but add challenges involving data quality, cybersecurity, drift, governance, and accountability. Simulation is most valuable when it is transparent, reproducible, decision-focused, and appropriately modest about what its results establish.

Key Terms

Pseudorandom number: A deterministic computer-generated sequence designed to exhibit random-like statistical behavior.

Seed: An initial value that determines a reproducible pseudorandom sequence.

Monte Carlo simulation: Repeated sampling of uncertain inputs to estimate an outcome or distribution.

Discrete-event simulation: Simulation in which state changes occur at distinct, scheduled event times.

State variable: A variable describing the system condition at a particular simulation time.

Event calendar: An ordered list of future events and their scheduled times.

Input model: A probabilistic or empirical representation of an uncertain system input.

Verification: Establishing that the implemented model correctly represents its specification.

Validation: Establishing that the model is adequate for its intended purpose.

Warm-up period: Initial simulation time discarded to reduce the effect of artificial starting conditions.

Replication: An independently seeded simulation run used to estimate output variability.

Batch means: A method that aggregates observations from a long run into batches for analysis.

Common random numbers: A variance-reduction method that uses matched random inputs across alternatives.

Control variate: A correlated variable with known expectation used to improve an estimator.

Importance sampling: A method that changes the sampling distribution and reweights observations.

Rare event: An outcome with sufficiently small probability that ordinary simulation observes it inefficiently.

Sensitivity analysis: Systematic examination of output changes under altered inputs or assumptions.

Digital twin: A data-connected digital representation of a physical or organizational system.

Model risk: The possibility of poor decisions caused by incorrect, incomplete, or misused models.

Review Questions

Short Answer Questions

  1. How does Monte Carlo simulation differ from discrete-event simulation?
  2. Why are warm-up observations often discarded in steady-state simulation?
  3. What is the purpose of independent replications?
  4. State the role of an event calendar in a discrete-event model.
  5. Why does a good statistical fit not by itself validate an input model?

Long Answer Questions

  1. Explain a complete workflow for fitting and validating probability distributions for simulation inputs.
  2. Discuss verification, validation, and the distinction between aleatory and epistemic uncertainty.
  3. Explain common random numbers, antithetic variates, control variates, and importance sampling, including their assumptions.
  4. Compare terminating and steady-state simulation experiments and describe suitable output-analysis methods for each.
  5. Evaluate the opportunities and governance risks associated with digital twins in business operations.

Analytical / Application Questions

  1. A service system has arrival rate 18 customers per hour and service rate 24 customers per hour under an M/M/1 assumption. Calculate utilization and theoretical mean time in system. Explain why a simulation analyst should still validate the implementation against these results.
  2. A rare loss event is expected to have probability 10⁻⁶. Explain why ordinary Monte Carlo is inefficient and design a high-level importance-sampling study, including diagnostics that would be required.
  3. Design a simulation experiment to decide whether a retailer should add evening labor. Specify entities, events, inputs, outputs, warm-up or termination logic, replications, variance reduction, sensitivity factors, and governance controls.

Multiple Choice Questions with Answers

Question 1

Which feature most clearly distinguishes discrete-event simulation from basic Monte Carlo simulation?

A. It uses probability distributions.

B. It changes system state at explicitly scheduled event times.

C. It requires a normal distribution.

D. It cannot estimate confidence intervals.

Correct Answer: B. It changes system state at explicitly scheduled event times.

Question 2

If an exponential random variable has rate λ and U is uniform on (0,1), which transformation is appropriate?

A. T = λU

B. T = U/λ

C. T = −ln(U)/λ

D. T = −λln(U)

Correct Answer: C. T = −ln(U)/λ

Question 3

What is the primary purpose of a warm-up period in a steady-state simulation?

A. To increase the number of entities created at time zero

B. To remove all random variation

C. To reduce bias caused by artificial initial conditions

D. To guarantee independent observations

Correct Answer: C. To reduce bias caused by artificial initial conditions

Question 4

For an M/M/1 queue with arrival rate λ and service rate μ, which stability condition is required?

A. λ > μ

B. λ = μ

C. λ/μ > 1

D. λ/μ < 1

Correct Answer: D. λ/μ < 1

Question 5

What is the main advantage of common random numbers when comparing two policies?

A. They eliminate model misspecification.

B. They can induce positive covariance and reduce variance of the difference.

C. They guarantee identical outputs.

D. They remove the need for replications.

Correct Answer: B. They can induce positive covariance and reduce variance of the difference.

Question 6

In a control-variate estimator, the control variable should generally have:

A. An unknown expectation and zero correlation with the output

B. A known expectation and useful correlation with the output

C. A larger unit of measurement than the output

D. A deterministic simulation path

Correct Answer: B. A known expectation and useful correlation with the output

Question 7

Which statement about Little’s law is correct?

A. It applies only when arrivals and services are exponential.

B. It states L = λW under consistent, stable-system measurement.

C. It requires the system to have exactly one server.

D. It estimates the probability of a rare event.

Correct Answer: B. It states L = λW under consistent, stable-system measurement.

Question 8

Why is ordinary Monte Carlo often inefficient for a probability near 10⁻⁶?

A. It cannot generate uniform random numbers.

B. It will usually observe too many events.

C. It may observe very few or no events in a practical sample.

D. It produces only deterministic outputs.

Correct Answer: C. It may observe very few or no events in a practical sample.

Question 9

Which activity is primarily validation rather than verification?

A. Checking that an event is scheduled exactly once

B. Testing conservation of inventory in the code

C. Comparing simulated historical performance with observed system data

D. Reviewing variable names for consistency

Correct Answer: C. Comparing simulated historical performance with observed system data

Question 10

A digital twin differs from a conventional offline simulation chiefly because it:

A. Uses no assumptions or models.

B. Must always use artificial intelligence.

C. Is connected to current or near-current data from the represented system.

D. Cannot support what-if analysis.

Correct Answer: C. Is connected to current or near-current data from the represented system.

Stochastic Modeling
Chapter 11 of 15