Chapter 8 of 8

Simulation Capstone: Deciding Under Uncertainty

Learning objectives

  • Model a decision whose payoff depends on an uncertain quantity and evaluate options across the full outcome distribution
  • Apply the critical ratio rule to a single-period stocking decision and verify it by direct expected value calculation
  • Size a Monte Carlo run for a target precision and report risk alongside the expected value

Why the average input gives the wrong answer

The habit of plugging a single best-guess value into a spreadsheet and reading off the answer fails whenever the payoff is a curved or kinked function of the uncertain input. This is Jensen's inequality, and in business it is nearly universal because payoffs are full of kinks: you cannot sell inventory you do not have, so profit rises with demand up to the stock level and then flattens; a penalty clause triggers below a threshold and not above it; a bonus caps out. Evaluating such a function at the mean of demand overstates profit, because the flat upper part of the curve is ignored. The general remedy is to push the whole distribution of the input through the model and look at the distribution of the output, either exhaustively when the input takes a handful of values, or by Monte Carlo sampling when it does not. The second habit worth breaking is reporting only the mean of the output. A decision maker needs the mean, the spread, and the specific downside quantiles, because the option with the best average frequently has the worst floor, and only the decider knows whether that floor is survivable.

The single-period stocking decision and the critical ratio

A single-period stocking problem covers any commitment made once, before demand is known, that cannot be repeated: seasonal merchandise, event catering, a print run, a chartered aircraft. Two costs frame it. The underage cost is the contribution given up per unit of unmet demand, price minus unit cost. The overage cost is the loss per unit left unsold, unit cost minus salvage value. The optimal order quantity is the smallest quantity for which the probability that demand does not exceed it reaches the critical ratio, which is the underage cost divided by the sum of the underage and overage costs. The intuition is a marginal argument: stock one more unit only while the chance it sells, times what it earns, beats the chance it does not, times what it loses. The critical ratio makes the asymmetry vivid. High-margin items with a decent salvage value have a critical ratio near one and should be stocked well above expected demand; low-margin items that become worthless unsold have a low ratio and should be stocked below it. The rule assumes one ordering opportunity, no reordering, and no effect of a stockout on future demand, all of which soften it in practice.

Running and reading a Monte Carlo model

Monte Carlo replaces exhaustive enumeration with sampling. Specify a distribution for each uncertain input, draw a value from each, compute the outcome, and repeat many thousands of times to build up the output distribution. Three points determine whether the results are trustworthy. First, precision follows the square root law: the standard error of the estimated mean is the output standard deviation divided by the square root of the number of trials, so halving the error requires four times the trials, and it is worth computing the required number in advance rather than picking a round figure. Second, correlation between inputs matters more than the shape of any individual input. Sampling costs and demand independently when a real recession would depress both understates the frequency of joint bad outcomes and produces a tail that is far too thin, which is the failure mode behind most risk models that look fine until they matter. Third, when comparing options, use the same random draws for each, a technique called common random numbers. It removes sampling noise from the comparison, so the observed difference reflects the options rather than the luck of the draw. Report results as a distribution with named quantiles, and state the input assumptions next to the output, because a simulation is only ever as good as the distributions fed into it.

Bringing the course together

This capstone reuses every earlier chapter. The decision framing from chapter one fixes the currency and the options. The data audit from chapter two determines whether the historical demand series used to build the input distribution is even trustworthy, since duplicates and missing periods distort both the mean and the spread that drive the answer. The visual exploration of chapter three is how you choose a distribution shape and spot the outliers that would otherwise fatten the tail. The expected value machinery of chapter four is what folds the outcome distribution into a single comparable number, with the same caveat about one-shot bets. Regression from chapter five is a common way to build the input distribution when demand depends on price or season, with its residual standard error supplying the noise term. The threshold logic of chapter six reappears whenever the simulated decision is a yes-or-no action with asymmetric error costs. The optimization of chapter seven is what the simulation wraps around when the decision has several interacting levers rather than one quantity. The final report should state the recommendation, the expected value, the downside quantile, the assumptions, and the point at which the recommendation would flip.

Worked example

Problem

A hypothetical retailer must place one pre-season order for a seasonal item. Unit cost is 22 dollars, selling price is 50 dollars, and unsold units are cleared at a salvage value of 12 dollars. Demand is estimated as a discrete distribution: 200 units with probability 0.10, 300 with 0.20, 400 with 0.30, 500 with 0.25, and 600 with 0.15. Find the optimal order quantity using the critical ratio, verify it by computing expected profit directly for 400, 500, and 600 units, compare the risk of the top two options, and determine how many Monte Carlo trials would be needed to estimate the expected profit of the chosen quantity to within plus or minus 50 dollars with 95 percent confidence.

Step by step

  1. Underage cost = price - cost = 50 - 22 = 28 dollars per unit of lost sale. Overage cost = cost - salvage = 22 - 12 = 10 dollars per unsold unit.
  2. Critical ratio = 28 / (28 + 10) = 28 / 38 = 0.7368.
  3. Cumulative probabilities: 200 gives 0.10, 300 gives 0.30, 400 gives 0.60, 500 gives 0.85, 600 gives 1.00. The smallest quantity whose cumulative probability reaches 0.7368 is 500 units, since 0.60 is below it and 0.85 is above.
  4. Profit formula for order Q and demand D: 50 x min(D, Q) + 12 x max(Q - D, 0) - 22Q.
  5. Q = 400, purchase cost 22 x 400 = 8,800. D = 200: 10,000 + 2,400 - 8,800 = 3,600. D = 300: 15,000 + 1,200 - 8,800 = 7,400. D = 400 or more: 20,000 + 0 - 8,800 = 11,200.
  6. Expected profit at Q = 400 = 0.10(3,600) + 0.20(7,400) + 0.70(11,200) = 360 + 1,480 + 7,840 = 9,680 dollars.
  7. Q = 500, purchase cost 11,000. D = 200: 10,000 + 3,600 - 11,000 = 2,600. D = 300: 15,000 + 2,400 - 11,000 = 6,400. D = 400: 20,000 + 1,200 - 11,000 = 10,200. D = 500 or 600: 25,000 - 11,000 = 14,000.
  8. Expected profit at Q = 500 = 0.10(2,600) + 0.20(6,400) + 0.30(10,200) + 0.40(14,000) = 260 + 1,280 + 3,060 + 5,600 = 10,200 dollars.
  9. Q = 600, purchase cost 13,200. D = 200: 10,000 + 4,800 - 13,200 = 1,600. D = 300: 15,000 + 3,600 - 13,200 = 5,400. D = 400: 20,000 + 2,400 - 13,200 = 9,200. D = 500: 25,000 + 1,200 - 13,200 = 13,000. D = 600: 30,000 - 13,200 = 16,800.
  10. Expected profit at Q = 600 = 0.10(1,600) + 0.20(5,400) + 0.30(9,200) + 0.25(13,000) + 0.15(16,800) = 160 + 1,080 + 2,760 + 3,250 + 2,520 = 9,770 dollars.
  11. The direct calculation confirms the critical ratio: 500 units is best at 10,200 dollars, against 9,680 at 400 and 9,770 at 600.
  12. Note the Jensen effect. Expected demand = 0.10(200) + 0.20(300) + 0.30(400) + 0.25(500) + 0.15(600) = 20 + 60 + 120 + 125 + 90 = 415 units. Ordering the expected demand would be worse than ordering 500, and evaluating profit at demand exactly 415 would suggest 28 x 415 = 11,620 dollars, well above any achievable expected profit, because it ignores every outcome in which stock or demand falls short.
  13. Risk comparison. At Q = 500 the profit outcomes are 2,600 with probability 0.10, 6,400 with 0.20, 10,200 with 0.30, and 14,000 with 0.40. Variance = 0.10(-7,600)^2 + 0.20(-3,800)^2 + 0.30(0)^2 + 0.40(3,800)^2 = 5,776,000 + 2,888,000 + 0 + 5,776,000 = 14,440,000, so the standard deviation is 3,800 dollars.
  14. At Q = 400 the outcomes are 3,600 with 0.10, 7,400 with 0.20, and 11,200 with 0.70, around a mean of 9,680. Variance = 0.10(-6,080)^2 + 0.20(-2,280)^2 + 0.70(1,520)^2 = 3,696,640 + 1,039,680 + 1,617,280 = 6,353,600, so the standard deviation is about 2,521 dollars.
  15. So Q = 500 buys 520 dollars of extra expected profit at the cost of about 1,279 dollars more standard deviation and a worst case of 2,600 dollars instead of 3,600 dollars.
  16. Monte Carlo sizing. The half-width of a 95 percent interval for the mean is about 1.96 times the standard deviation divided by the square root of n. Setting 1.96 x 3,800 / square root of n equal to 50 gives square root of n = 7,448 / 50 = 148.96, so n = 22,189, about 22,200 trials.
  17. Sanity check on the square root law: to tighten the interval to plus or minus 25 dollars would need four times as many trials, roughly 88,800.

Answer. Order 500 units. The critical ratio of 28 / 38 = 0.7368 points to 500 because that is the smallest quantity whose cumulative demand probability, 0.85, reaches it, and the direct expected profit calculation confirms it at 10,200 dollars against 9,680 for 400 units and 9,770 for 600. The recommendation comes with a risk statement: profit at 500 units has a standard deviation of 3,800 dollars and a 10 percent chance of falling to 2,600 dollars, whereas ordering 400 units gives up 520 dollars of expected profit for a standard deviation of about 2,521 dollars and a floor of 3,600 dollars. If the firm can absorb the worse floor, order 500; if this single order could threaten the season's cash position, 400 is a defensible choice and the 520 dollars is the price of that protection. Estimating the mean of the 500-unit option to within plus or minus 50 dollars at 95 percent confidence would take roughly 22,200 Monte Carlo trials. All figures are for one selling season in dollars, exclude any goodwill cost from stocking out, assume the salvage value holds for any quantity cleared, assume a single ordering opportunity with no mid-season replenishment, and rest entirely on the stated demand distribution, which in practice should be built from an audited history and stress-tested by re-running the calculation with the probability mass shifted toward the low end.

Practice

Work each question before opening the solution.

  1. A catering manager buys ingredients at 6 dollars per meal, sells at 21 dollars, and unsold meals are discarded with no salvage value. Demand is 80 with probability 0.15, 100 with 0.35, 120 with 0.30, and 140 with 0.20. Compute the critical ratio and the optimal order quantity.

    Show solution for question 1

    Underage cost = 21 - 6 = 15 dollars per unmet meal. Overage cost = 6 - 0 = 6 dollars per discarded meal. Critical ratio = 15 / (15 + 6) = 15 / 21 = 0.7143. Cumulative probabilities are 0.15 at 80, 0.50 at 100, 0.80 at 120, and 1.00 at 140. The smallest quantity reaching 0.7143 is 120 meals. Note that 120 exceeds expected demand, which is 0.15(80) + 0.35(100) + 0.30(120) + 0.20(140) = 12 + 35 + 36 + 28 = 111 meals, because the margin lost on a missed sale is two and a half times the cost of a wasted meal.

  2. For the retailer in the worked example at an order of 500 units, how many Monte Carlo trials are needed to estimate expected profit to within plus or minus 100 dollars at 95 percent confidence? Explain why this is not simply half of the 22,200 trials needed for plus or minus 50 dollars.

    Show solution for question 2

    Set 1.96 x 3,800 divided by the square root of n equal to 100, giving square root of n = 7,448 / 100 = 74.48, so n = 5,547, about 5,600 trials. It is a quarter of the previous figure, not half, because the standard error falls with the square root of the number of trials: doubling the allowed error divides the required trials by four. The same law running the other way is why chasing very tight simulation precision gets expensive fast, and why it is usually better to spend effort on the input distributions than on extra trials.

  3. A risk model simulates revenue and input costs independently and reports a 1-in-100 worst case that management finds reassuring. During an actual downturn the firm does far worse. Explain the modelling error and how to fix it.

    Show solution for question 3

    The inputs were treated as independent when they are in fact correlated in the tail: a demand shock and a cost or credit shock tend to arrive together. Independent sampling makes the joint bad outcome the product of two small probabilities, so the simulated tail is far thinner than reality and the 1-in-100 figure is optimistic. Fix it by estimating the correlation from history and sampling from a joint distribution, and by adding explicit scenario runs in which the adverse values are imposed together rather than drawn. Report the scenario results alongside the simulated quantiles, since the correlation estimated from calm periods routinely understates what happens in a stressed one.