General Batch Sizes, and the Classical Approximation

Manuel D. Rossetti, PhD P.E.

Agenda

  • Where the position sits when \(Q > 1\), and the four exact measures it gives
  • The transformer evaluated across reorder points, and what \(Q = 5\) is worth
  • A random lead time: the same model, with one condition
  • The classical approximation: its assumptions, its cost model, its conditions
  • The approximation on a fast mover and on a slow mover, priced term by term

Where the Position Sits

Recall the position column of the ledger: 9, 8, 7, 6, 5, and back to 9. With demands of one unit the position visits each of \(r+1, \ldots, r+Q\) once per cycle and spends the same expected time at each. In steady state,

\[ \mathit{IP} \sim \text{Uniform}\{r+1, r+2, \ldots, r+Q\}, \qquad \text{independent of } D(L) \]

The position when an order is placed is set by demands that have already happened; \(D(L)\) is demand that has not yet happened. Independent increments make the two independent. Then, as for base stock,

\[ \mathit{IN} = \mathit{IP} - D(L) \]

Condition on the position, apply the base-stock results at \(S = \mathit{IP}\), and average over the \(Q\) values.

Averaging Base-Stock Results

\[ \begin{aligned} \bar{B}(r, Q) &= \frac{1}{Q}\sum_{j=r+1}^{r+Q} G^{1}(j) &&\text{average } \bar{B}(S) = G^{1}(S) \text{ over } S = j\\ &= \frac{1}{Q}\left[G^{2}(r) - G^{2}(r+Q)\right] &&G^{2}(b) = \textstyle\sum_{x > b}G^{1}(x)\\[6pt] \overline{\mathit{RR}}(r, Q) &= \frac{1}{Q}\sum_{j=r+1}^{r+Q} G(j-1) = 1 - \frac{1}{Q}\sum_{x=r}^{r+Q-1} G^{0}(x) &&G = 1 - G^{0}\text{, shift the index}\\ &= 1 - \frac{1}{Q}\left[G^{1}(r) - G^{1}(r+Q)\right] &&G^{1}(b) = \textstyle\sum_{x \ge b}G^{0}(x)\\[6pt] \bar{I}(r, Q) &= E[\mathit{IP}] - \theta + \bar{B} = \frac{Q+1}{2} + r - \theta + \bar{B}(r, Q) &&I = \mathit{IN} + B \end{aligned} \]

and \(\overline{\mathit{OF}} = \lambda/Q\) as before. Four formulas, and every one of them is exact.

Two Checks That Travel With Them

Set \(Q = 1\). Every sum has one term, at \(j = r + 1 = S\), and the four formulas collapse to base stock.

Read \(\tfrac{1}{2}(Q+1)\). It is the average of the integers 1 through \(Q\), the discrete counterpart of the EOQ’s \(Q/2\). The classical cycle stock is still in there, raised by half a unit because units are whole and by \(\bar{B}\) because shortages are possible.

The spread. \(\bar{B}\) is the mean of a quantity that is zero most of the time and occasionally large. Averaging the shortage’s second moment the same way,

\[ \begin{aligned} E\left[B^{2}\right] = \frac{1}{Q}\Big\{&2\left[G^{3}(r) - G^{3}(r+Q)\right]\\ &+ \left[G^{2}(r) - G^{2}(r+Q)\right]\Big\} \end{aligned} \]

and \(\mathit{Var}[B] = E[B^{2}] - \bar{B}^{2}\). This is the first place the book needs the third order loss function.

Evaluating a Policy for the Transformer

\(\lambda = 45\), \(k = \$220\), \(h = \$950\), \(b = \$8{,}550\), \(D(L)\) Poisson with \(\theta = 7.5\). Start from the EOQ, whose cost curve is flat: \(Q = \sqrt{2(220)(45)/950} = \sqrt{20.84} = 4.57 \to 5\).

\(r\) \(\bar{B}\) \(\overline{\mathit{FR}}\) \(\bar{I}\) Ordering Holding Backorder Total
7 0.3854 0.7492 2.8854 $1,980 $2,741 $3,295 $8,016
8 0.2212 0.8357 3.7212 $1,980 $3,535 $1,891 $7,406
9 0.1202 0.8990 4.6202 $1,980 $4,389 $1,028 $7,397
10 0.0619 0.9417 5.5619 $1,980 $5,284 $529 $7,793
11 0.0302 0.9683 6.5302 $1,980 $6,204 $258 $8,442

The answer. \((r, Q) = (9, 5)\), $7,397 a year, fill rate 0.8990.

The check. \(\bar{I} = (5+1)/2 + 9 - 7.5 + 0.1202 = 4.6202\), which the table reproduces.

What Five at a Time Is Worth

Policy Ordering Holding Backorder Total
Base stock, \(S = 11\) $9,900 $3,478 $1,381 $14,760
\((r, Q) = (9, 5)\) $1,980 $4,389 $1,028 $7,397

Ordering five at a time halves the cost of running this item, and it raises the fill rate from 0.8622 to 0.8990 while doing it. The base-stock policy was worse on both counts at once.

The spread at \((9, 5)\). \(E[B^{2}] = 0.3533\), so \(\mathit{Var}[B] = 0.3533 - 0.1202^{2} = 0.3388\) and the standard deviation is 0.582 units, nearly five times the mean. The average of 0.12 units owed is not a typical state. The typical state is zero, punctuated by occasions of several. Reporting the mean alone describes a situation that never occurs.

When the Lead Time Is Random

The lead time enters the four formulas only through the distribution of \(D(L)\). Thus, a random lead time is the same model with a different \(D(L)\).

One condition

\(\mathit{IN} = \mathit{IP} - D(L)\) holds because every earlier order has arrived. Orders must be received in the sequence they were placed. A fixed route preserves it; a pool of suppliers, any of whom may fill an order, does not.

Both suppliers average two months; \((r, Q)\) optimized under each.

The supplier \(\mathit{Var}[D(L)]\) \((r, Q)^{*}\) Cost
Exactly two months 7.5 \((8, 7)\) $7,225.15
Std. dev. one month 21.5625 \((10, 8)\) $11,079.73

The uncertainty costs $3,854.58 a year, 53% more than a reliable supplier. That is the number to put in front of a purchasing department choosing between a cheaper supplier and a predictable one. Both \(r\) and \(Q\) rise: \(r\) because the tail is heavier, \(Q\) because each cycle is more expensive to start.

The Classical Approximation

The exact model is not the one most textbooks give first. The classical treatment, from Hadley and Whitin, is what nearly every spreadsheet and planning package implements. It rests on twelve assumptions; four do the damage.

Assumption What it does
(h) \(D(L)\) is a continuous random variable replaces the distribution
(i) Never more than one order outstanding \(D(L)\) never exceeds \(Q\)
(k) \(r \ge 0\), reached while \(I(t) > 0\) no backorders when \(r\) is reached
(l) Expected backorders very small against expected on hand \(E[B] \approx 0\)

Also: shortage cost \(\pi\) per unit short (c), and a fixed lead time (f).

Notice that (i), (k) and (l) drop terms from a cost the exact model computes, and (h) replaces the distribution. Those are separate errors, and they can run in opposite directions.

The Cost Model, One Term at a Time

Ordering. Orders are placed at the rate demand consumes them: \(k\lambda/Q\).

Shortage. By (k), \(I = r\) when the reorder point is reached, so a cycle is short exactly when \(D(L) > r\), by \(D(L) - r\):

\[ \frac{\text{units short}}{\text{cycle}} \times \frac{\text{cycles}}{\text{year}} \times \frac{\text{dollars}}{\text{unit short}} = G^{1}(r) \times \frac{\lambda}{Q} \times \pi \]

Holding. By (l), \(E[I] \approx E[\mathit{IN}]\). The safety stock \(r - \theta\) remains when an order arrives and \(Q\) arrive with it, so the level cycles between \(r - \theta\) and \(r - \theta + Q\):

\[ C(r, Q) \approx k\frac{\lambda}{Q} + h\left(\frac{Q}{2} + r - \theta\right) + \pi\frac{\lambda}{Q}G^{1}(r) \]

Notice that this is the EOQ cost with two terms added, and the \(Q/2\) is the deterministic cycle stock unchanged. The uncertainty has been pushed entirely into \(r\).

Two Conditions, Solved Together

\[ \begin{aligned} \frac{\partial C}{\partial Q} &= -\frac{k\lambda}{Q^{2}} + \frac{h}{2} - \frac{\pi\lambda G^{1}(r)}{Q^{2}} = 0 &&\text{differentiate in } Q\\ Q &= \sqrt{\frac{2\lambda\left[k + \pi G^{1}(r)\right]}{h}} &&\text{solve for } Q\\[4pt] \frac{\partial C}{\partial r} &= h - \frac{\pi\lambda}{Q}G^{0}(r) = 0 &&dG^{1}/dr = -G^{0}(r)\\ G^{0}(r) &= \frac{Qh}{\pi\lambda} &&\text{solve for } G^{0}(r) \end{aligned} \]

The first is the EOQ with the ordering cost inflated by \(\pi G^{1}(r)\), the expected shortage cost per cycle. Uncertainty raises \(Q\) by making each cycle more expensive to begin.

The second makes the stockout probability per cycle \(Qh/(\pi\lambda)\), so for a given \(Q\), \(r\) is a quantile. Neither solves alone: start at the EOQ, solve for \(r\), put it back, repeat.

A Fast Mover: the Compression Connector

\(\lambda = 6{,}000\) a year, \(c = \$3.40\), \(k = \$27.50\), \(h = 0.25(3.40) = \$0.85\), \(\pi = \$8.50\), two weeks: \(\theta = 6000 \times 2/52 = 230.77\), Poisson, so the gamma has \(\alpha = 230.77\), \(\beta = 1\).

Pass \(Qh/(\pi\lambda)\) \(r\) \(G^{1}(r)\) new \(Q\)
1 0.010385 267.33 0.0599 628.83
2 0.010481 267.28 0.0606 628.89
3 0.010481 267.28 0.0606 628.89

Starting at \(Q = \sqrt{2(6000)(27.50)/0.85} = 623.09\).

At \((267, 629)\), with \(G^{1}(267) = 0.0635\) recomputed after rounding:

\[ \begin{aligned} C &= 262.32 + 298.12 + 5.15\\ &= \$565.59 \text{ a year} \end{aligned} \]

The exact evaluation gives $565.14: 0.08% high. A full search puts the best policy at $565.14 too. The policy penalty is zero.

A Slow Mover: the Transformer

\(\lambda = 45\), \(k = \$220\), \(h = \$950\), \(\theta = 7.5\); an emergency purchase costs $9,500 against $3,800, so \(\pi = \$5{,}700\) per unit short. The iteration takes twenty-one passes and recommends \((14, 6)\):

\[ C = \underbrace{220\tfrac{45}{6}}_{1{,}650.00} + \underbrace{950\left(\tfrac{6}{2} + 14 - 7.5\right)}_{9{,}025.00} + \underbrace{5700\tfrac{45}{6}(0.0351)}_{1{,}499.25} = \$12{,}174.25 \]

The exact evaluation gives $11,922.90, so the report is 2.11% high. Is a 2% error a sign the approximation works here?

Cost Against the truth
Exact $11,922.90
What (i), (k) and (l) alone would report $11,448.30 \(-3.98\%\)
What the gamma then adds \(+\$725.95\)
What the approximation reports $12,174.25 \(+2.11\%\)

A small net error is hiding two large errors of opposite sign.

Where Each Piece Comes From

Source Term Cost
(k), discreteness \(h \times \tfrac{1}{2}\) \(-\$475.00\)
(l), backorders negligible \(h \times \bar{B} = 950(0.0022)\) \(-\$2.06\)
(i), \(D(L)\) never exceeds \(Q\) the \(G^{1}(r+Q)\) term \(+\$2.46\)
(h), a gamma in place of a Poisson the tail of the shortage term \(+\$725.95\)

(h) is the largest. One unit is \(1/2.74 = 36.5\%\) of a standard deviation here, against 6.6% on the connector. No continuous family can represent a count that small.

(k) is next, because \(Q\) is small: the half unit is \(1/Q\) of the cycle stock, 0.16% on the connector and 17% here.

(i) barely registers, although \(\theta/Q = 7.5/6 = 1.25\) says it is violated. The reorder point landed high enough that \(G^{1}(r+Q)\) is nearly zero.

Three Diagnostics Before Trusting It

Ask Tests Connector Transformer
One unit as a fraction of \(\sigma\) (h), a continuous family for a count 6.6% 36.5%
\(1/Q\) (k), the half unit of cycle stock 0.16% 17%
\(\theta/Q\) (i), at most one order outstanding 0.37 1.25

Use the approximation to choose a policy. Evaluate the policy you chose with the exact formulas before quoting a cost or a service level to anyone.

When all three diagnostics are small the two answers converge and the second step is a formality. When any of them is not, the second step is the only one that is true, and the exact model costs no more to run.

What We Did Today

The position is uniform on \(r+1, \ldots, r+Q\) and independent of \(D(L)\). Every \((r, Q)\) measure is a base-stock measure averaged over the band, and all four are exact.

For the transformer, \((9, 5)\) costs $7,397, half of what one for one costs, at a better fill rate.

A random lead time is the same model with a different \(D(L)\), provided orders do not cross. An unreliable supplier costs this item 53%.

The classical approximation is the EOQ with uncertainty pushed into \(r\). Its errors come from dropped terms and from the continuous family, and they can cancel.

Choose with the approximation, quote with the exact model.

For Next Time

Read before next session: Service Levels Instead of a Shortage Cost, The Cost Function and Its Shape, What You Know Before You Solve and An Exact Algorithm.

Today’s material was General Batch Sizes and The Classical Approximation.

Next session:

  • The cycle service level and the fill rate as targets, and why the same number means two different things
  • What a service target says about the backorder cost nobody would name
  • The shape of the exact cost, bounds before solving, and an algorithm that finds the optimum without iterating to convergence

Bring \(\pi\) and \(b\) for the transformer. A service target is about to replace both.

⌂ Index