Decision Atlas
ANLAnalytics & AIStop 3 of 6
  1. Statistics you will actually use
  2. Optimization basics: LP and MILP
  3. Simulation & Monte Carlo
  4. Machine learning in supply chain
  5. AI agents, RAG & copilots
  6. AI + optimization

Simulation & Monte Carlo

Testing a decision against thousands of possible futures, and how simulation complements optimization.

3 min gist, 9 min in full Draft, review pending

Read atChange any time

Play the future thousands of times and look at the spread of results.

Some questions don’t have a neat formula. “If demand varies, suppliers are sometimes late and a machine breaks down now and then, how often will we run out?” Simulation answers by playing out the system many times on a computer.

Monte Carlo simulation draws random values for every uncertain input, runs the model once, records the result, and repeats thousands of times. For a warehouse item, each run might draw a month of daily demand and a random lead time for each delivery, then count stockout days. After 10,000 runs you don’t get one answer, you get a distribution: “a stockout in about 6% of months, and in the worst 1% of months we lose more than 300 units.”

The safety stock lab on this site does a small version of this: switch it to real-life mode, replay a few times, and watch how often the buffer is used up.

Discrete-event simulation models how things flow through a system over time, such as trucks arriving at a dock, orders queuing at packing stations, or containers waiting at a port. It’s the tool for questions like “will two more dock doors clear the morning queue?”

Simulation and optimization work best together:

  • Optimization finds the best decision under given assumptions.
  • Simulation tests how that decision behaves when reality is random.

A network plan that looks optimal on average can fail badly in a bad week; simulation shows that before you commit.

Words to use

Monte Carlo simulation
Repeating a model with random inputs many times to estimate the distribution of outcomes.
Discrete-event simulation
Modelling a system as events over time, such as arrivals, queues and processing.
Replication
One run of a simulation; many replications give a reliable picture.

A Monte Carlo study of lead-time demand for a lumpy item, the queue at a two-door dock, and the steps of a sound simulation study.

Monte Carlo for a lumpy item

Worked example: setting a reorder point by simulation

Daily demand: 0 units on 60% of days, 5 units on 30%, and 20 units on 10%. Lead time: 4, 5 or 6 days, equally likely. What reorder point covers 95% of lead times?

  • Simulate 100,000 lead times: draw a lead time, draw each day’s demand, add them up.
  • Average lead-time demand: 17.5 units (3.5 a day × 5 days).
  • 95th percentile from the simulation: 45 units. 99th: 55.
  • The normal approximation, using the same mean and standard deviation, gives 17.5 + 1.645 × 13.6 ≈ 40.

The normal formula would set the reorder point about 5 units too low, because lumpy demand has a long right tail the normal curve doesn’t capture.

A dock with two doors

Trucks arrive at random, on average every 30 minutes, and unloading takes 50 minutes on average, also random. With 2 doors, the doors are busy 83% of the time. Queueing formulas for this simple case give:

DoorsUtilizationChance a truck waitsAverage wait
283%76%about 114 minutes
356%30%about 11 minutes

A third door cuts the average wait tenfold. Real docks add appointment schedules, different truck types and unloading crews, which formulas can’t handle but a discrete-event simulation can, and the simple case is a useful check that the simulation behaves correctly.

Steps of a sound study

  1. Define the question and the measures (stockout rate, waiting time, cost).
  2. Build the model logic at the level of detail the question needs.
  3. Fit input distributions from data, not averages.
  4. Verify (the model does what you intended) and validate (it reproduces reality).
  5. Discard the warm-up period for steady-state questions.
  6. Run enough replications and report results with confidence intervals; precision improves with the square root of the number of runs.
  7. Compare alternatives using the same random numbers for each, so differences come from the decision, not from luck.

Four kinds of simulation, the flaw of averages, comparing alternatives efficiently, simulation-optimization, and why animation isn't validation.

Four kinds of simulation

TypeModelsTypical supply chain use
Monte CarloRandom inputs to a static calculationLead-time demand, project risk, financial outcomes
Discrete-eventEntities flowing through processes over timeWarehouses, docks, factories, ports
System dynamicsStocks, flows and feedback loops at an aggregate levelBullwhip, capacity investment cycles, policy effects
Agent-basedMany individual decision makers interactingConsumer adoption, carrier behaviour, disruption spread

Forrester’s system dynamics (1961) produced one of the earliest explanations of the bullwhip effect, and Sterman’s (2000) textbook remains the standard reference for the method.

The flaw of averages

Plans built on average inputs are wrong on average. Savage’s “flaw of averages” (2009) gives many examples: average demand fed into a capacity plan hides the weeks when demand exceeds capacity and sales are lost, so the average outcome is worse than the outcome of the average. Simulation replaces single numbers with distributions and shows the true average and the spread.

Comparing alternatives efficiently

  • Common random numbers: run each alternative with the same sequence of random demand, delays and failures, so the comparison isn’t blurred by different luck.
  • Antithetic variates and other variance-reduction methods reach the same precision with fewer runs.
  • Enough replications: report differences between alternatives with confidence intervals, not single runs.

Simulation-optimization

When there are many possible decisions (reorder points for hundreds of items, numbers of doors and staff), search methods can drive the simulation: try settings, simulate, keep the better ones, repeat. It is slower than pure optimization but handles randomness and complexity that formulas can’t.

Animation is not validation

Watching trucks move on screen builds confidence, sometimes too much. Validation means comparing the model’s outputs (throughput, waiting times, stock levels) with real historical performance, and checking extreme cases behave sensibly (zero demand means zero shipments; double the arrivals and queues grow).

Interview kit

Practise it out loud

Answer each question yourself before opening the model answer.

Say it in 30 seconds

Simulation models uncertainty by running a system many times with random inputs. Monte Carlo gives the distribution of outcomes, such as stockout probability or worst-case cost, and discrete-event simulation models queues and flows over time. I’d use optimization to choose a plan and simulation to stress-test it, because a plan that’s optimal on average can perform badly when demand, lead times or failures vary.

What is the difference between optimization and simulation?

Optimization searches for the best decision given the model’s assumptions. Simulation evaluates how a given decision performs across many random futures. Optimization says what to do; simulation says how likely it is to work.

How would you use Monte Carlo to set safety stock for a lumpy item?

Fit distributions to its demand and lead time, or resample actual history, simulate thousands of replenishment cycles for several candidate stock levels, and pick the lowest level that meets the service target with acceptable worst-case risk. It avoids assuming normal demand.

Connected stops

Where this idea feeds in, or gets its inputs from.

Sources and further reading

  1. Law, A. M. Simulation Modeling and Analysis. McGraw-Hill.
  2. Hopp, W. J. & Spearman, M. L. Factory Physics. Waveland Press.
  3. Savage, S. L. (2009). The Flaw of Averages: Why We Underestimate Risk in the Face of Uncertainty. Wiley.
  4. Sterman, J. D. (2000). Business Dynamics: Systems Thinking and Modeling for a Complex World. McGraw-Hill.

Reading settings

Saved on this device. Changes apply as you choose them.

Theme
Text size
Typeface for reading
Line spacing
Line length
Start each topic at

Deeper levels stay one click away whichever you choose.

Preview

Safety stock covers the surprises while you wait for a delivery. It grows with the square root of lead time, not with lead time itself.

Lines

↑ ↓ move ↵ open Topics marked “Soon” open their line