Operations and capacity × Programming
Business lens: Operations and capacity · Technology lens: Programming
Reading scope: Original fictional teaching; same-author arithmetic checks are not independent editorial validation.
A small arithmetic rule can lose work
A fictional document-processing team writes a script to group customer files into batches. The script reports four batches and the scheduler allocates four processing slots, yet some files remain untouched. Operations and programming meet at the rule that converts work into scheduled units. Define whether a partially filled batch still consumes a slot and how incomplete work is reported. A convenient integer division can be correct for counting full batches while incorrect for planning all required batches. Begin with the operating promise: every eligible file must be processed or retained as an explicit exception, rather than disappearing at a rounding boundary.
Specify the batch function and its states
The process owner defines eligibility, the developer implements grouping and the scheduler supplies processing windows. Distinguish full, partial, pending and failed batches. State whether a partial batch takes the same time as a full batch or has a different cost. Record stable file identifiers so retries do not duplicate output. Check zero files, an exact multiple and one file beyond a multiple. A program that finishes without an error may still omit work if its loop excludes the remainder. Keep input and output counts visible, with an explicit relationship between them. Faster code does not repair an incorrectly specified operational unit.
Worked rounding and window capacity
There are ninety-five invented eligible files, with at most twenty files per batch. Four full batches cover eighty files, leaving fifteen. All files therefore require five batches: four full batches and one partial batch. Under a stipulated twelve-minute duration for every batch, total sequential processing requires sixty minutes. A forty-eight-minute window accommodates four batches and eighty files, leaving fifteen files pending. A floor calculation of 95 divided by 20 yielding four answers the full-batch question, not the all-work scheduling question. The example does not assume parallel processing or a faster duration for the partial batch.
Make the remainder operationally visible
The scheduler can extend the window, provide appropriate additional capacity or revise the promised completion time. It cannot make the fifteen files complete by rounding the required batches down. If a partial batch actually takes less time, measure that behaviour and revise the planning rule explicitly. A recovery procedure should identify which files produced acceptable outputs before retrying. Test boundaries that change the batch count and check that every input identifier has a final state. The useful software outcome is complete and interpretable work accounting. A pleasing elapsed time that excludes the remainder is not a valid throughput improvement.
Practice a batch specification
Use the existing queue-simulation lesson to propose a grouping rule, the five-batch sequence and a forty-eight-minute stopping point. Reproduce eighty processed and fifteen pending files at four batches, then sixty minutes for all five. Add test cases for zero, twenty, twenty-one and ninety-five files with their required batch counts. Your portfolio should include an output-identity check and a customer message for unfinished work. This extends bounded scheduling practice; it does not add a new executed batching fixture or claim measured document-processing performance. Any local implementation should retain its actual outputs and expose missing identifiers instead of silently dropping the final partial batch.
Questions and level progression
Who defines an eligible file, and Whom should the developer ask about partial-batch duration? Whose document remains pending? What consumes a slot, Where is the remainder recorded, and When does the window end? Why is floor division insufficient? Which boundary changes the count? How will output completeness be checked? Foundation learners identify a remainder. Undergraduate learners calculate full and required batches. Postgraduate learners critique duration assumptions, retries and parallel alternatives. DBA/research learners design an auditable workload-conversion study with observed costs and a bounded contribution. For revision, explain why four full batches are mathematically correct but operationally insufficient for ninety-five files, and why the final fifteen must remain visible under the forty-eight-minute limit.
Study questions and answers
How many batches are needed for all files?
Five: four batches of twenty and one of fifteen. Four counts only the full batches.
Marking guide: Credit five batches including final fifteen-file batch; do not discard partial batch.
What fits in the stipulated window?
48/12 = four batches, covering eighty files and leaving fifteen pending; all five need sixty minutes.
Marking guide: Credit four batches/eighty files in 48 minutes, fifteen pending; complete run sixty minutes.
What boundary tests should the rule pass?
Zero files need zero batches; twenty need one; twenty-one need two; ninety-five need five under the stated maximum.
Marking guide: Specify boundary cases 0→0,20→1,21→2,95→5 under the stipulated maximum batch size.
Practice task
Specify and check a batch scheduler that preserves the partial batch and unfinished identifiers.
Practice bridge
- Specify and check a batch scheduler that preserves the partial batch and unfinished identifiers.
- Reproduce the worked arithmetic, change one assumption and label invented evidence separately from actual practice observations.
Boundary: Original fictional exercise connected to an existing bounded or guided lesson. No new executable fixture, external platform execution or catalogue lab claimed.