2.3 Discrete-Event Simulation, Random Variates & Model Validation

Key Takeaways

  • Discrete-event simulation updates system state variables instantaneously at discrete points in simulated time using a chronological next-event time-advance mechanism.

  • The Inverse Transform Method generates non-uniform continuous random variates via X = F^(-1)(U), mapping standard uniform random numbers U in (0, 1) directly through the inverse cumulative distribution function.

  • In non-terminating (steady-state) simulations, initialization bias must be eliminated by discarding transient data during a warm-up period determined via Welch's graphical moving-average procedure.

  • Statistical output analysis across independent simulation replications utilizes the Student's t-distribution to construct valid confidence intervals for expected performance measures.

  • Verification confirms that the conceptual simulation model is accurately translated into computational code ('building the model right'), whereas validation confirms that the model accurately predicts real-world system behavior ('building the right model').

Last updated: October 2026

2.3 Discrete-Event Simulation, Random Variates & Model Validation

Discrete-Event Simulation (DES) is an indispensable computational modeling paradigm used by industrial engineers to analyze complex, dynamic, stochastic systems that defy closed-form analytical solutions. While queueing theory models provide exact steady-state equations for idealized Markovian structures, real-world manufacturing plants, supply chains, and hospital operating suites feature non-exponential distributions, finite buffer blocking, sequence-dependent machine setups, routing recirculations, and dynamic labor scheduling that necessitate simulation.


Discrete-Event Simulation (DES) Architecture & System State Mechanics

Unlike continuous simulation (where state variables change continuously according to differential equations) or Monte Carlo simulation (which evaluates static stochastic relationships without a time dimension), Discrete-Event Simulation models systems where state changes occur instantaneously at discrete, separated points in time.

Core DES Elements

  1. Entities: Dynamic objects that flow through the simulation model (e.g., parts, pallets, customers, work orders). Entities are created, travel through processes, seize resources, wait in queues, and are ultimately disposed.
  2. Attributes: Local data values attached to individual entities that travel with them (e.g., entity creation timestamp, part geometry type, priority level, rework count).
  3. Resources: Static operational units that provide service to entities (e.g., CNC milling machines, automated storage cranes, forklifts, certified technicians). A resource possesses a finite capacity and distinct states: IDLE, BUSY, FAILED, or BLOCKED.
  4. Queues: Ordered lists of entities waiting to seize a resource when its capacity is fully utilized. Queues operate under specific ranking rules (FIFO, LIFO, Lowest Processing Time First, Earliest Due Date).
  5. Events: Instantaneous occurrences that change the state of the system at a specific simulation clock instant. Common events include:
    • ARRIVAL_EVENT: A new entity enters the system.
    • DEPARTURE_EVENT / END_SERVICE_EVENT: A resource completes processing an entity.
    • BREAKDOWN_EVENT: An operational resource experiences an unscheduled failure.
  6. Simulation Clock: A global variable that holds the current point in simulated time. It does not progress uniformly; rather, it leaps forward instantaneously to the timestamp of the next scheduled event.
  7. State Variables: The set of mathematical variables required to completely describe the status of the system at clock time tt (e.g., Nq(t)N_q(t): number of entities in queue at time tt; B(t)B(t): number of busy servers at time tt).
  8. Future Event List (FEL) / Event Calendar: A priority queue containing all scheduled future events, sorted chronologically by scheduled occurrence time (te1≤te2≤⋯≤tekt_{e1} \le t_{e2} \le \dots \le t_{ek}).

The Next-Event Time-Advance Mechanism

The engine of any discrete-event simulator operates on the Next-Event Time-Advance algorithm:

  1. Initialization: Set simulation clock CLK=0CLK = 0. Initialize state variables (e.g., Nq=0,B=0N_q = 0, B = 0). Schedule the initial arrival event in the FEL.
  2. Identify Imminent Event: Retrieve the event from the head of the FEL with the smallest timestamp t∗=min⁡{te∈FEL}t^* = \min \{t_e \in \text{FEL}\}.
  3. Advance Clock: Jump the simulation clock directly to the event time: CLK=t∗CLK = t^*.
  4. Execute Event Routine: Update system state variables corresponding to the event type. For example, if an END_SERVICE_EVENT occurs:
    • Decrement the count of busy resources.
    • If Nq>0N_q > 0, remove the first entity from the queue, decrement NqN_q, assign it to the newly freed resource, and generate a new END_SERVICE_EVENT at CLK+TserviceCLK + T_{service}.
    • If Nq=0N_q = 0, set resource state to IDLE.
  5. Statistical Accumulation: Update time-weighted area accumulators for performance metrics (e.g., ∫Nq(t)dt\int N_q(t) dt).
  6. Check Stopping Criteria: If the target simulation run length or processed entity count is reached, terminate; otherwise, return to Step 2.
Loading diagram...

Pseudo-Random Numbers and Random Variate Generation

Stochastic simulation models require a stream of continuous uniform random numbers U∼U(0,1)U \sim U(0, 1) that are subsequently transformed into random variates representing operational phenomena (interarrival times, process durations, machine times-to-failure).

Linear Congruential Generators (LCG)

Pseudo-random numbers are generated deterministically using mathematical recurrence relations. The most widely implemented algorithm is the Linear Congruential Generator (LCG):

Zi=(aZi−1+c)(modm)Z_i = (a Z_{i-1} + c) \pmod m Ui=ZimU_i = \frac{Z_i}{m}

Where:

  • mm: Modulus (a large prime number or power of 2, typically 231−12^{31}-1 or 2642^{64}).
  • aa: Multiplier integer.
  • cc: Increment integer.
  • Z0Z_0: The initial seed value.

Under the Hull-Dobell Theorem, an LCG achieves its maximum possible cycle period of mm if and only if cc and mm are relatively prime, (a−1)(a - 1) is divisible by all prime factors of mm, and (a−1)(a - 1) is divisible by 4 if mm is divisible by 4.

The Inverse Transform Method

The Inverse Transform Method is the primary mathematical technique for converting standard uniform random numbers U∼U(0,1)U \sim U(0, 1) into non-uniform random variates XX following an arbitrary continuous probability distribution with Cumulative Distribution Function (CDF) F(x)F(x).

Theoretical Foundation (Probability Integral Transform): Let XX be a continuous random variable with strictly increasing CDF F(x)=P(X≤x)F(x) = P(X \le x). The variable U=F(X)U = F(X) is uniformly distributed on the interval (0,1)(0, 1). Therefore, setting U=F(X)U = F(X) and solving for XX yields:

X=F−1(U)X = F^{-1}(U)

Step-by-Step Derivation for Exponential Distribution

  1. Define CDF: F(x)=1−e−λxF(x) = 1 - e^{-\lambda x} for x≥0x \ge 0.
  2. Set F(X)=UF(X) = U: 1−e−λX=U1 - e^{-\lambda X} = U
  3. Solve algebraically for XX: e−λX=1−U  ⟹  −λX=ln⁡(1−U)  ⟹  X=−1λln⁡(1−U)e^{-\lambda X} = 1 - U \implies -\lambda X = \ln(1 - U) \implies X = -\frac{1}{\lambda} \ln(1 - U)
  4. Since (1−U)(1 - U) is also uniformly distributed on (0,1)(0, 1), the formulation is commonly written as: X=−1λln⁡(U)X = -\frac{1}{\lambda} \ln(U)

Common Inverse Transform Formulations

Target DistributionProbability Density Function f(x)f(x)Cumulative Distribution Function F(x)F(x)Random Variate Generator X=F−1(U)X = F^{-1}(U)
Uniform on [a,b][a, b]1b−a\frac{1}{b - a}x−ab−a\frac{x - a}{b - a}X=a+(b−a)UX = a + (b - a)U
Exponential (λ)(\lambda)λe−λx\lambda e^{-\lambda x}1−e−λx1 - e^{-\lambda x}X=−1λln⁡(1−U)X = -\frac{1}{\lambda} \ln(1 - U)
Weibull (α,β)(\alpha, \beta)αβ(xβ)α−1e−(x/β)α\frac{\alpha}{\beta}\left(\frac{x}{\beta}\right)^{\alpha-1} e^{-(x/\beta)^\alpha}1−e−(x/β)α1 - e^{-(x/\beta)^\alpha}X=β[−ln⁡(1−U)]1/αX = \beta \left[ -\ln(1 - U) \right]^{1/\alpha}
Triangular (a,m,b)(a, m, b)Piecewise linearPiecewise quadraticX={a+U(b−a)(m−a)U<m−ab−ab−(1−U)(b−a)(b−m)U≥m−ab−aX = \begin{cases} a + \sqrt{U(b-a)(m-a)} & U < \frac{m-a}{b-a} \\ b - \sqrt{(1-U)(b-a)(b-m)} & U \ge \frac{m-a}{b-a} \end{cases}

Other Random Variate Generation Methods

  • Acceptance-Rejection Method: Used when the CDF cannot be analytically inverted (e.g., Gamma, Beta distributions). Variates are sampled from an easy-to-generate proposal distribution and accepted with probability proportional to the ratio of the target density to the proposal density.
  • Box-Muller Transformation (for Normal Distributions): Generates two independent standard normal variates Z1,Z2∼N(0,1)Z_1, Z_2 \sim N(0, 1) from two independent uniform numbers U1,U2∼U(0,1)U_1, U_2 \sim U(0, 1): Z1=−2ln⁡U1cos⁡(2πU2),Z2=−2ln⁡U1sin⁡(2πU2)Z_1 = \sqrt{-2 \ln U_1} \cos(2\pi U_2), \quad Z_2 = \sqrt{-2 \ln U_1} \sin(2\pi U_2) To obtain X∼N(μ,σ2)X \sim N(\mu, \sigma^2), scale by X=μ+σZ1X = \mu + \sigma Z_1.

Simulation Experiment Design: Terminating vs. Steady-State Systems

Simulation models are classified by their operating time horizon:

1. Terminating (Transient) Simulations

A terminating simulation possesses a natural, physical event that defines the start and end of the system's operational cycle:

  • Examples: A bank branch open from 9:00 AM to 5:00 PM; a manufacturing facility processing a discrete work order of 500 units; an emergency room during a 24-hour hurricane event.
  • The initial conditions (e.g., empty facility at opening) are a realistic part of the operational system.
  • Output analysis focuses on transient performance measures across RR independent replications, each beginning at identical initial conditions.

2. Non-Terminating (Steady-State) Simulations

A non-terminating simulation models a system that runs continuously without a defined stopping point:

  • Examples: A 24/7 semiconductor fabrication plant; an automated distribution hub; an internet telecommunication router.
  • The objective is to estimate long-term steady-state performance parameters: θ=lim⁡t→∞E[Y(t)]\theta = \lim_{t \to \infty} E[Y(t)]

The Initialization Bias & Welch's Graphical Procedure

When a steady-state simulation starts from an empty-and-idle state, early observations are biased downward (shorter queues, zero initial waiting times). Including these initial data points introduces initialization bias.

To eliminate initialization bias, the model must run through a warm-up period (T0T_0), during which all generated statistical observations are deleted:

Welch's Graphical Procedure for Determining Warm-Up Period:

  1. Conduct RR independent replications of the simulation, each of length mm observations (R≥5R \ge 5).
  2. Compute the cross-replication average for each discrete observation index i=1,2,…,mi = 1, 2, \dots, m: Yˉi=1R∑r=1RYri\bar{Y}_i = \frac{1}{R} \sum_{r=1}^R Y_{ri}
  3. Smooth the cross-replication averages using a symmetric moving average with window half-width ww: Yˉi(w)={12w+1∑s=−wwYˉi+sfor i=w+1,…,m−w12i−1∑s=−(i−1)i−1Yˉi+sfor i=1,…,w\bar{Y}_i(w) = \begin{cases} \frac{1}{2w + 1} \sum_{s=-w}^w \bar{Y}_{i+s} & \text{for } i = w+1, \dots, m-w \\ \frac{1}{2i - 1} \sum_{s=-(i-1)}^{i-1} \bar{Y}_{i+s} & \text{for } i = 1, \dots, w \end{cases}
  4. Plot Yˉi(w)\bar{Y}_i(w) against observation index ii. The warm-up truncation point dd is identified visually as the point beyond which the moving average curve stabilizes into horizontal steady-state oscillations. Delete all data for i≤di \le d.

Statistical Output Analysis & Replication Framework

Because simulation outputs are stochastic random variables, a single simulation run represents only a single sample point (N=1N = 1). Valid engineering conclusions require statistical confidence intervals.

Method of Independent Replications

To obtain statistically independent, identically distributed (i.i.d.) observations:

  1. Execute RR independent replications of the simulation model, resetting the system state but initializing each replication with an independent pseudo-random number seed.
  2. For each replication rr, calculate the mean performance measure Xˉr\bar{X}_r after deleting the warm-up period: Xˉr=1n−d∑i=d+1nXri\bar{X}_r = \frac{1}{n - d} \sum_{i=d+1}^n X_{ri}
  3. Compute the grand sample mean across all RR replications: Xˉˉ=1R∑r=1RXˉr\bar{\bar{X}} = \frac{1}{R} \sum_{r=1}^R \bar{X}_r
  4. Compute the sample variance between replication means: S2=1R−1∑r=1R(Xˉr−Xˉˉ)2S^2 = \frac{1}{R - 1} \sum_{r=1}^R (\bar{X}_r - \bar{\bar{X}})^2
  5. Construct the (1−α)100%(1 - \alpha)100\% Confidence Interval for the true mean μX\mu_X using the Student's tt-distribution with R−1R - 1 degrees of freedom:

Xˉˉ±tα/2,R−1⋅SR\bar{\bar{X}} \pm t_{\alpha/2, R-1} \cdot \frac{S}{\sqrt{R}}

Where the term HW=tα/2,R−1⋅SRHW = t_{\alpha/2, R-1} \cdot \frac{S}{\sqrt{R}} is the half-width of the confidence interval.

Sample Size Determination

If an engineering study requires the confidence interval half-width to be no larger than an acceptable error margin ϵ\epsilon, the required number of replications R∗R^* is estimated by:

R∗≈(zα/2⋅Sϵ)2R^* \approx \left( \frac{z_{\alpha/2} \cdot S}{\epsilon} \right)^2


Model Credibility: Verification, Validation & Testing Protocols

A simulation model is useless unless stakeholders trust its decisions. Credibility requires rigorous separation of verification and validation.

Verification vs. Validation Matrix

DimensionVerificationValidation
Core Question"Did we build the model right?""Did we build the right model?"
FocusSoftware code, logic, mathematics, algorithm translationOperational reality, empirical system behavior, predictive fidelity
Standard TechniquesCode debugging, detailed event tracing, animation review, stress testing, degenerate parameter testingHistorical data tracking, goodness-of-fit testing, SME face validity, Turing tests, statistical output hypothesis testing

Verification Techniques

  • Structured Walkthroughs: Peer review of simulation model logic by an independent engineering team.
  • Trace Analysis: Step-by-step printing of every state transition, FEL change, and attribute update over a small time window.
  • Animation Inspection: Visual review of dynamic 2D/3D graphics to detect bottlenecks, buffer overflows, or unexpected resource deadlocks.
  • Conservation of Flow Audits: Ensuring that over a closed run, total entities entering equals total entities exiting plus entities remaining in queues and service.
  • Extreme Condition / Stress Testing: Setting arrival rate λ→0\lambda \to 0 (system should be completely idle) or λ>sμ\lambda > s\mu (queues must explode systematically).

Validation Protocols

  • Face Validity: Subject Matter Experts (SMEs, shop floor supervisors, line operators) review model input parameters and observe animations to verify reasonable operational behavior.
  • Historical Data Validation: Drive the simulation model using actual historical input traces (e.g., recorded arrival times from last month) and test whether model performance measures match historical outputs.
  • Statistical Goodness-of-Fit Tests: Validating input probability distributions using:
    • Chi-Square Goodness-of-Fit Test (χ2\chi^2): For discrete or continuous data with large sample sizes (n≥50n \ge 50).
    • Kolmogorov-Smirnov Test (KK-SS): For continuous empirical data, measuring the maximum vertical deviation D=max⁡∣Fn(x)−F0(x)∣D = \max |F_n(x) - F_0(x)| between empirical and theoretical CDFs.
  • The Turing Test: Present operational output reports from both the real physical facility and the simulation model to experienced managers in an identical format. If the managers cannot distinguish between real and simulated data, the model has demonstrated high operational validity.
Test Your Knowledge

Using the inverse transform method, generate an exponential service duration variate X for a machining process with an average service rate of mu = 4.0 parts per hour, given a standard uniform pseudo-random number draw of U = 0.20.

A

0.0250 hours

B

0.0402 hours

C

0.0558 hours

D

0.0825 hours

Test Your Knowledge

An industrial engineer conducts 16 independent simulation replications of a hospital emergency department after eliminating the warm-up period. The sample mean patient length of stay is 42.0 minutes with a sample standard deviation of S = 6.0 minutes. Using the Student's t-value for a 95% confidence interval with 15 degrees of freedom (t_0.025, 15 = 2.131), what is the resulting 95% confidence interval for the true mean patient length of stay?

A

42.00 +/- 1.50 minutes

B

42.00 +/- 3.20 minutes

C

42.00 +/- 2.45 minutes

D

42.00 +/- 4.12 minutes

Sections you finish are checked off in the contents.