1Overview
Two stochastic simulations exploring uncertainty in supply chain decisions using the Economic Order Quantity (EOQ) and Newsvendor models. Both simulations implemented in Excel and Python with sample sizes of 787 (Excel) and 78,766 (Python), demonstrating how larger samples reduce variance and stabilize estimates.
2Simulation 1: EOQ with random ordering costs
The Economic Order Quantity model determines optimal order size to minimize total costs. In this simulation, the fixed ordering cost K is randomized using a normal distribution (μ=240, σ=40), while demand and holding costs remain constant.
Parameters: Demand = 1,100 units, Mean ordering cost = €240 (σ=40), Holding cost = €20.
Results show costs cluster between €2,653–€5,800, with most simulations landing in the €3,574–€3,764 range. The histogram reveals a near-normal distribution, confirming the propagation of ordering cost uncertainty through the EOQ formula.
3Simulation 2: Newsvendor with demand uncertainty
The Newsvendor model optimizes order quantity Q* when demand is uncertain. The critical ratio determines the ideal balance between stockouts and leftovers. Here, demand follows a normal distribution (μ=300, σ=40) while price (€9), cost (€6), and salvage value (€2) are fixed.
Order quantity Q* = 292.80 units. On average, ~280 units sell, ~13 remain as leftovers. The profit histogram is right-skewed, indicating frequent scenarios where demand exceeds supply, concentrating profits in the €850–€930 range.
4Excel vs Python comparison
Both implementations were coded and executed independently:
| Metric | Excel (N=787) | Python (N=78,766) |
|---|---|---|
| EOQ Avg Cost | €3,829.40 | €3,249.78 |
| EOQ Std Dev | €513.81 | €271.07 |
| Newsvendor Profit | €790 (avg) | €789.95 |
| Service Level | 38–47% | 93.39% |
Findings: Expected profits are nearly identical (€1 difference), confirming both implementations are correct. Histograms show similar shapes, right-skewed with demand met in most scenarios. The service level discrepancy likely stems from sample size—larger samples provide more reliable estimates. Colab notebook: View Python code
5View files
Explore the Excel models and full analysis:
6Conclusion
Monte Carlo simulations reveal how uncertainty propagates through supply chain models. The EOQ model's total cost is sensitive to ordering cost variability, while the Newsvendor model's profits hinge on the demand forecast's accuracy. Larger samples (78,766 vs 787) reduce estimation variance by ~50%, enabling more confident decision-making in practice. Both models demonstrate that stochastic optimization is essential when parameters are uncertain.