Monte Carlo Simulation

Lesson4 min readCalculation & Safety Stock

Monte Carlo simulation estimates the range of possible outcomes of an uncertain process by running it many times with random inputs drawn from probability distributions. Instead of one answer based on averages, you get a whole distribution: how likely each outcome is. It is especially useful when formulas break down, such as with unusual demand patterns, several uncertain inputs at once or complex supply chains.

The steps

  1. Define the model: the output you care about (for example demand during lead time, stockout probability, total cost).
  2. Define distributions for the uncertain inputs, based on history or expert judgment.
  3. Sample: draw random values for every input.
  4. Calculate the output for this trial.
  5. Repeat thousands of times.
  6. Analyze: mean, percentiles, probability of exceeding a threshold, histogram.

Worked example: reorder point for lumpy demand

Daily demand for a spare part follows this distribution, and lead time is a fixed 3 days:

Daily demand 0 1 2 3 4
Probability 10% 20% 40% 20% 10%

Mean daily demand is 2 units and the standard deviation is about 1.1. The normal-distribution formula with Z = 1.645 would give a 95 percent reorder point of 6 + 1.645 × 1.1 × √3 ≈ 9.1 units. Now simulate: each trial draws three daily demands and adds them. Over many trials, the distribution of lead-time demand is:

Lead-time demand (units) ≤5 6 7 8 9 10
Probability of exactly this 39.6% (cumulative) 20.8% 18.0% 12.3% 6.2% 2.4%
Cumulative probability 39.6% 60.4% 78.4% 90.7% 96.9% 99.3%

These probabilities are the exact answer that a large simulation converges to. A reorder point of 8 gives 90.7 percent protection, and 9 gives 96.9 percent. For a 95 percent target you would choose 9, which agrees with the normal approximation here because the demand is not very skewed. For skewed or intermittent demand the two methods diverge and simulation is the safer one.

Doing it in a spreadsheet

You can run a simulation in Excel or Google Sheets using =RAND() to generate random numbers, a lookup to convert them to demand values, and a data table to repeat a few thousand times. Or use Python:

import numpy as np
rng = np.random.default_rng(1)
demand = rng.choice([0,1,2,3,4], size=(100000,3), p=[.1,.2,.4,.2,.1]).sum(axis=1)
print(np.percentile(demand, 95))   # about 9

Supply chain uses

  • Safety stock and service-level analysis with non-normal demand or variable lead times. See the Z-score method for the analytical alternative.
  • Project and schedule risk, supplier disruption and network design under uncertainty.
  • Budget and cost-of-goods risk with uncertain commodity prices.
  • Testing a policy, such as a new reorder point or review interval, before using it.

Strengths and limits

Strengths Limits
Handles any distribution and complex interactions Results are only as good as the input distributions
Shows risk and probabilities, not just an average Needs enough trials and a random-number generator
Easy to explain with histograms Can create false confidence if inputs are guessed
Lets you test policies safely Correlated inputs must be modeled together

Common mistakes

  • Using too few trials. Thousands are typical.
  • Treating uncertain inputs as independent when they move together.
  • Fitting distributions to bad or too little data.
  • Presenting one run’s output as the truth.

Key takeaways

  • Monte Carlo runs a model many times with random inputs to show the range of outcomes.
  • It beats formulas when demand is skewed, intermittent or when many risks combine.
  • Use percentiles to set safety stock or buffers.
  • Validate the input distributions first.

Frequently asked questions

What is Monte Carlo simulation?

Monte Carlo simulation runs a model thousands of times using random inputs drawn from probability distributions, producing a distribution of possible outcomes rather than a single estimate.

How is Monte Carlo used for safety stock?

Simulate demand over the lead time many times, then pick the reorder point at the percentile that matches the service level, for example the 95th percentile.

How many trials does a Monte Carlo simulation need?

Thousands are typical, and results for tail probabilities such as 99 percent need more. Increase the number until the answer stops changing.

When is Monte Carlo better than the Z-score formula?

When demand or lead time is skewed, intermittent or otherwise non-normal, or when several uncertain inputs interact.

What tools can I use for Monte Carlo simulation?

Excel or Google Sheets with RAND, Python with NumPy, R, or dedicated risk-analysis add-ins.