The belt’s fourteen-week total had a standard deviation of 92.64 belts.
One belt is 1.1% of that, so treating the total as continuous was safe: rounding could not decide the answer.
That was a property of the aggregation, not a property of the newsvendor model.
Today’s item does not have it.
A continuous distribution is the wrong tool, and the inverse does not exist.
A discrete distribution function is a staircase, and a critical ratio almost never lands exactly on a step.
The replacement follows from the same marginal argument: keep adding a unit while \(F(Q) < c_{u}/(c_{u}+c_{o})\). That is,
\[ Q^{*} = \min\left\{Q : F(Q) \ge \frac{c_{u}}{c_{u}+c_{o}}\right\} \]
It is the smallest quantity whose cumulative probability reaches the ratio, and at that quantity \(F(Q^{*})\) is usually strictly greater than the ratio.
That gap is not an error. It is the staircase.
A discrete newsvendor generally achieves a service level a little better than the one its costs call for, because it cannot buy a fraction of a unit.
A municipal utility carries a pad-mount transformer at $3,800. A capital project is about to begin, after which the specification changes.
Demand process? Failures arrive independently at a low rate. Over the window the utility expects 6 failures, and models the count as Poisson with \(\lambda = 6\).
Costs? Bought and not used, it scraps at $900, so \(c_{o} = \$2{,}900\). A failure with no spare is covered by an emergency purchase at $9,500, so \(c_{u} = \$5{,}700\).
\[ \frac{5700}{5700+2900} = 0.662791 \]
| \(Q\) | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|
| \(F(Q)\) | 0.2851 | 0.4457 | 0.6063 | 0.7440 | 0.8472 |
| Expected shortage \(G^{1}(Q)\) | 2.2330 | 1.5181 | 0.9637 | 0.5700 | 0.3140 |
| Expected cost | $13,404 | $10,155 | $8,288 | $7,802 | $8,501 |
The rule reads the \(F(Q)\) row and stops at 7, because 0.6063 is short of 0.6628 and 0.7440 clears it.
Buy 7 spare transformers, at $26,600, expecting $7,802 in obsolescence and emergency purchases.
The cost row confirms the rule rather than being used by it. Its minimum is at 7, where the rule put it.
Usually. Not always.
Treating demand as normal with mean 6 and variance 6:
\[ 6 + \Phi^{-1}(0.6628)\sqrt{6} = 6 + 0.4201(2.4495) = 7.029 \to 7 \]
Agrees. Now change one number: suppose the emergency purchase costs $8,150 rather than $9,500, so \(c_{u} = \$4{,}350\) and the ratio is exactly 0.6000.
The exact rule reads \(F(5) = 0.4457\) and \(F(6) = 0.6063\), and stops at 6.
The normal gives \(6 + 0.2533(2.4495) = 6.621\), which rounds to 7.
The approximation buys one transformer too many, at $3,800. A real error on a real decision.
A normal approximation to a discrete distribution is good when the mean is large enough that one unit is a small fraction of the standard deviation.
At \(\lambda = 6\): \(\sigma = 2.45\) units, so one transformer is 40% of it, and rounding decides the answer.
At \(\lambda = 600\): one unit is 4%, and rounding decides nothing.
Use the staircase rule whenever the numbers are small, which is exactly when slow-moving items are involved, and exactly when each unit is expensive.
They change what goes into it.
A penalty beyond the lost margin. \(c_{u} = s - c\) is the whole cost only when a customer turned away returns next time as though nothing happened. Otherwise \(c_{u} = s - c + \pi\).
For the belt, suppose a refused dealer costs $40 in future business. Then \(c_{u} = 85\), the ratio rises from 0.5422 to 0.6911, and the order rises from 475 to 512 belts.
Notice the size: a penalty under half the selling price moved the order by 7.8%.
\(\pi\) is the parameter no ledger contains and the one hardest to defend.
So the honest way to report this decision is not a single number.
It is that 475 belts is right if a stockout costs only the margin, and 512 if it costs $40 more, and that the organization should say which it believes.
Suppose \(I\) belts are already held. The decision is now how many to add, and the model is unchanged in a way worth seeing.
What the model determines is the quantity that should be available, which is stock on hand plus the order. The cost of ending with \(S - X\) units left does not care how they got there.
\[ S^{*} = F^{-1}\!\left(\frac{c_{u}}{c_{u}+c_{o}}\right), \qquad Q^{*} = (S^{*} - I)^{+} \]
With \(S^{*} = 475.18\) and 120 on hand, order 355. With 600 on hand, order zero, and the distributor is over-stocked before it begins.
This is the first appearance of the order-up-to level, a structure the rest of the course uses constantly. The truncation at zero matters: a newsvendor cannot sell stock back.
The ratio requires \(c_{o} > 0\) and \(c_{u} > 0\), and both failures are informative.
If \(c_{u} \le 0\): no penalty for being short, so the answer is to order nothing. That is correct, and it usually means the problem was stated wrongly. An item nobody loses anything by running out of is an item nobody should stock.
If \(c_{o} \le 0\): salvage meets or beats purchase cost, so the answer is to order without limit. Also correct, also a mis-stated problem.
An unbounded answer is the model reporting that you have described a situation with no downside.
The right response is to find the cost you left out.
The strongest assumption is the one in the title: leftover stock must have no value after the period.
Exactly true for a perishable item, and for a final buy before a product is withdrawn.
False for most inventory. A belt left over in an ordinary week is a belt available next week, worth its purchase cost less one week of holding.
Applying the newsvendor model there charges the whole value of the unit against a decision that costs only a week of carrying, so the order comes out far too small.
The test: what is a leftover unit worth at the end of the period?
Its scrap value, and this is a newsvendor problem. Nearly what you paid, and it is not.
The staircase rule applies to the belt too, and here it can be applied exactly.
A sum of independent negative binomials sharing \(p\) is negative binomial with the same \(p\) and the numbers of successes added. So the fitted weekly model gives the fourteen-week distribution with no approximation at all:
\[ \mathit{NB}(\hat{p} = 0.054222,\; 14\hat{r} = 26.6798) \]
Walking it, \(F(468) = 0.5392\) is short of the ratio and \(F(469) = 0.5434\) clears it.
So the exact answer is 469 belts, against the normal’s 475.
Six belts apart, and we priced that gap at 0.19% last session. It is the number the simulation below is checked against.
Everything so far has been a formula. Now compute the same answer by sampling.
The order matters. The formula already gives the exact answer, so simulating it proves nothing about the belt.
What it proves is that the simulation is right, and that is worth having before the simulation is pointed at a problem where no formula exists.
Sample from the fitted model, not from the normal approximation. There is no reason to hand a simulation an approximation, and sampling counts removes the truncation at zero a normal would have needed.
val demand = NegativeBinomialRV(probOfSuccess = 0.054222, numSuccess = 26.6798, streamNum = 1)
val stat = Statistic("profit at Q")
demand.resetStartStream()
repeat(100_000) {
val d = demand.value
stat.collect(s * minOf(d, q) + u * maxOf(0.0, q - d) - c * q)
}
println("%.2f +/- %.2f".format(stat.average, stat.halfWidth))Notice resetStartStream. Running it before each candidate makes every quantity face the same hundred thousand demands.
That is what lets the rows be compared with one another, rather than only with the exact answer. It also makes each row reproducible on its own.
| \(Q\) | 440 | 460 | 469 | 490 | 510 |
|---|---|---|---|---|---|
| Estimated profit | $17,737.18 | $17,877.57 | $17,893.03 | $17,818.04 | $17,610.98 |
| Half-width | $21.02 | $24.68 | $26.31 | $29.95 | $33.15 |
| Closed form | $17,732.96 | $17,871.00 | $17,886.06 | $17,811.30 | $17,606.01 |
At \(Q^{*} = 469\) the interval is \([\$17{,}866.72,\ \$17{,}919.34]\), and the exact $17,886.06 lies inside it. So does the exact figure in every other column.
Five agreements are far more convincing than one, and they cost nothing extra to report.
Every figure carries a half-width.
A simulated answer is an estimate with a standard error, and reporting one without its interval is reporting a number that is not there.
The half-width shrinks with the square root of the replication count, so ten times the precision costs a hundred times the run.
And notice what it cost. The exact answer took one walk up a distribution function.
The estimate took half a million samples and is still uncertain in the third significant figure.
Simulation is not how you solve the newsvendor problem.
Simulation earns its place the moment any assumption behind the ratio fails.
A distribution with no convenient inverse. A mixture has no closed-form quantile. The formula needs a search; the simulation does not care.
A salvage rule that is not linear. The scrap dealer takes the first 100 belts at $12 and the rest at $4. The derivation breaks; three lines change in the simulation.
A constraint. A supplier minimum, a case quantity, a shared budget.
More than one item that interact. Two products competing for one display, or a substitution rule. There is no formula, and there is an obvious simulation.
The policy stays simple: a single quantity chosen once.
What changes is the cost function.
And a cost function is easier to sample than to integrate.
The staircase rule is not an inverse. It is the smallest quantity whose cumulative probability reaches the ratio, and the gap above it is not an error.
Rounding a continuous answer is safe only when one unit is a small fraction of the standard deviation, and one worked case cost a real $3,800.
Four extensions change what goes into the ratio, never the ratio itself.
An unbounded answer is a mis-stated problem, and the right response is to find the cost you left out.
Simulation validated against a formula first, because the agreement is the only thing that licenses pointing it at a problem where no formula exists.
Read before next session: the opening of Continuous and Periodic Review Systems.
The single-period assumption is the one we drop next:
The order-up-to level you saw today is the structure the next several chapters are built on. What changes is what triggers the order.