Data & evidence

Allocate money and rounding residuals reproducibly

By Anurag · Published 4 November 2026 · Updated 17 November 2026Global methods · Country rules separately scoped
Constructed learning material. Prepared with AI assistance. Sample businesses, records and outcomes are fictional. External sources support the named methods or scoped facts; they do not validate the sample values as benchmarks.

A restaurant group needs to distribute a shared 1.01 MU reporting cost across three eligible outlets. An exact equal share is one third of that amount, but the reporting system stores whole minor units. Rounding each share independently creates 1.02 MU. Rounding every share down creates 0.99 MU. Assigning the unexplained difference to a convenient outlet makes the total tie while hiding a policy decision. The calculation needs a complete allocation rule, including its remainder and tie handling.

This laboratory builds a deterministic allocation workpaper for the fictional group Hazel Wharf. It starts with 101 integer minor units and three equal weights, develops an exact proportional remainder method, tests negative reversals and exposes a two-stage grouping effect. Every amount, weight and policy is invented teaching material. The method is a management allocation convention, not a rule for taxes, customer charges, employee pay, payment-provider fees or statutory accounting. Those applications require their own applicable requirements and evidence.

Download the allocation inputs and the expected answers and counterexamples. The interactive lab changes the signed amount and three weights, showing exact integer assignments and the difference between direct and two-stage allocation. It never connects to a payment or payroll system. Its purpose is to make a small rounding choice reproducible before that choice becomes a recurring unexplained reconciliation difference.

TRY THE CASE

Where does the last minor unit go?

Fictional inputs and stated model boundaries. The worked calculations and downloadable records below remain available without JavaScript.

Verify supported source amount, native unit and scale → Freeze eligible identities, weights, grain and tie policy → Allocate the absolute magnitude using exact integer quotients → Rank exact remainders and assign the residual deterministically → Restore the original sign and prove conservation → Compare row assignments, hierarchy and reversal behaviour → Reject unsupported denominators or policy properties → Review and reconcile the actual executed output version
  1. Verify supported source amount, native unit and scale
  2. Freeze eligible identities, weights, grain and tie policy
  3. Allocate the absolute magnitude using exact integer quotients
  4. Rank exact remainders and assign the residual deterministically
  5. Restore the original sign and prove conservation
  6. Compare row assignments, hierarchy and reversal behaviour
  7. Reject unsupported denominators or policy properties
  8. Review and reconcile the actual executed output version
Follow the evidence through the decision. Each gate belongs to this constructed case. Download the diagram.

1. State what is being allocated

Hazel Wharf has a supported shared reporting cost of 1.01 fictional monetary units, MU. The teaching currency scale is 100 minor units per MU, so the source amount is exactly 101 minor units. The cost has already been established and approved outside this exercise. The allocation decides how to distribute that amount among eligible reporting objects. It does not prove that the cost occurred or determine the financial-statement category in which it belongs.

The eligible objects are A, B and C. In the baseline each has weight one. Equal weights are a company assumption for this case, not a claim that the outlets consume equal resources or should always bear equal costs. A real allocation needs a defensible driver, such as a verified service relationship, usage measure or another approved basis. The mathematical routine cannot select the economic driver for management.

Record amount, currency, scale, eligible population, weights, policy version and output precision before calculating shares. A missing outlet should not become an implicit zero-weight outlet merely because its row failed to arrive. An unknown currency should not be assigned the scale of the most common currency in the file. Those are population and unit questions that precede rounding. A perfect allocation of the wrong amount or population is still wrong for the intended report.

The distinction between allocation and measurement is important. Distributing a shared cost changes outlet presentation while leaving the group total unchanged. It does not show which outlet caused the cost, nor does it establish that changing an outlet's allocation would save cash. The workpaper should support a clear management explanation instead of turning a reporting convention into an unsupported claim about operating efficiency.

2. Separate exact amounts from display amounts

The source amount is stored as an integer count of minor units in this fixture. A display function may show 101 as 1.01 MU, but the arithmetic does not repeatedly convert it to a rounded text string and back. The chosen scale is explicit. Other monetary systems may use a different scale or additional internal precision, so the model should not assume that every currency and use case has two decimal places.

The PostgreSQL numeric documentation distinguishes exact numeric representations from inexact floating-point types and explains precision and scale. It also documents implementation-specific rounding behaviour. This guide uses that source for the narrow principle that representation and rounding semantics must be deliberate. Hazel Wharf's remainder policy is original teaching design, not a PostgreSQL business recommendation or a legal monetary rule.

An ideal proportional share can be a fraction even when the final stored assignment must be an integer. Keep the ideal share and the assigned share as different concepts. For 101 divided equally among three objects, the ideal is 33 and two thirds of a minor unit each. None of the three integer allocations can equal that ideal exactly. The policy must decide which objects receive 34 and which receives 33 while preserving 101 in total.

Formatting should not choose that policy accidentally. If a report displays each ideal share as 0.34 MU, three displayed rows imply 1.02 MU even though the hidden exact fractions sum to 1.01. A footer saying totals may differ due to rounding may be acceptable for some presentation questions, but it does not produce an exact posted allocation. Hazel Wharf's workpaper requires stored row assignments to reconcile exactly with the source amount.

3. Inspect the equal-weight baseline

The three object identities are stable ASCII codes A, B and C. The tie rule uses ascending stable identity when exact remainders are equal. It does not use spreadsheet row order, a manager's preference or a locale-dependent display name. This makes the result deterministic when the same population arrives in another order. The choice is a fictional convention that needs management approval before real use.

ObjectWeightIdeal minor-unit shareInitial whole-unit shareFinal assigned minor units
A133 + 2/33334
B133 + 2/33334
C133 + 2/33333

The initial whole-unit assignments sum to 99. Two minor units remain. All three fractional remainders are equal, so A and B receive one additional unit under the tie rule. The final allocation is 34, 34 and 33, totaling 101. In MU that is 0.34, 0.34 and 0.33. The last object is not wrong because it receives one unit less; an exact equal split is impossible at the chosen output precision.

The workpaper explains both conservation and deviation from the ideal. Each assigned amount differs from its ideal by less than one minor unit under this method. That numerical property does not establish economic fairness in every sense. A stable tie convention can repeatedly favour the same identifiers over many similar allocations. If the company wants a different long-run fairness policy, it needs to define and test that policy rather than quietly rotate winners without a record.

The baseline also tests replay. Reordering the input rows to C, A, B should not change the identity-to-allocation mapping. Running the same workpaper again should produce the same values. A routine that gives the extra units to whichever two rows happen to appear first is not implementing the stated stable-identity policy, even though every run still sums to 101.

4. Derive the proportional remainder procedure

Let the nonnegative amount magnitude be A and the sum of nonnegative weights be W. For each object, multiply A by its weight. Divide that product by W to obtain a whole-unit quotient and an exact remainder. The quotient is the initial assigned magnitude. The remainder measures the fractional part without requiring an approximate decimal representation. All objects share the same denominator W, so their remainders can be ranked directly.

Add the initial quotients and subtract their sum from A. The difference is the number of minor units still to assign. Rank objects by descending exact remainder, breaking ties by ascending stable identity. Give one additional unit to each of the highest-ranked objects until the residual is exhausted. With nonnegative weights and this floor-based construction, the residual is less than the number of positively weighted objects, so no object needs multiple remainder units in a single allocation pass.

For the baseline, A is 101 and W is 3. Every product is 101, every quotient is 33 and every remainder is 2. Initial sum is 99 and residual is 2. The ranking is A, B, C because all remainders tie. Final magnitudes become 34, 34 and 33. This integer derivation is easier to audit than comparing decimal strings such as 33.6666667 that may have been rounded differently by different tools.

The implementation must use a numeric representation capable of holding the intermediate products exactly within its supported range. Even when A and each weight fit individually, their product may exceed a chosen fixed integer range. The local model uses exact integer intermediates and validates its external numeric bounds. A production implementation needs equivalent range and precision tests in its own language and storage system rather than assuming that an integer-looking input guarantees exact internal arithmetic.

5. Work a weighted allocation from start to finish

Now keep the 101 minor-unit amount and change weights to 1, 2 and 3. Total weight is 6. A's ideal share is 101/6, or 16 and five sixths. B's is 202/6, or 33 and two thirds. C's is 303/6, or 50 and one half. The initial whole shares are 16, 33 and 50, again totaling 99 with two units remaining.

Exact remainders against denominator 6 are 5 for A, 4 for B and 3 for C. The two largest belong to A and B, so final assignments are 17, 34 and 50. Their sum is 101. The remainder decision follows proportional fractions rather than object size alone. C has the largest weight and largest base share, but it does not receive a remainder unit in this case because its fractional claim is smaller.

Compare a 100 minor-unit amount under the same weights. Ideal shares are 16 and two thirds, 33 and one third, and 50 exactly. Initial sum is 99, with one unit remaining. A has the largest remainder and receives it, producing 17, 33 and 50. The two source amounts differ by one, and the allocation changes in a specific row. A reviewer can trace that change without treating it as an unexplained balancing entry.

Weights should have a declared measurement basis. If they come from gross charges, define whether those charges include discounts, cancellations or taxes. If they come from usage, establish the period and unit. This model accepts integer weights to keep exact ratios transparent. A company with fractional input weights can use a controlled exact scaling or another appropriate representation, but should not let a hidden conversion change the relative proportions.

6. Handle zero weights and a zero amount deliberately

A zero weight means an eligible object has no share under the stated driver. With amount 101 and weights 0, 1 and 1, A receives zero. B and C each have an ideal 50.5. The tie rule gives B the additional unit, so final values are 0, 51 and 50. The zero-weight object must not receive a remainder unit simply because its identifier sorts first.

An all-zero weight set cannot distribute a nonzero amount proportionally. The model rejects that state and asks for a supported basis. Dividing by zero, substituting equal weights or assigning everything to the last object would invent a policy. Management may choose an approved fallback for a real process, but the fallback needs its own name, evidence and review. It should not be hidden inside a divide-by-zero recovery branch.

A zero source amount can validly produce zero assignments even when all weights are zero. There is no monetary residual to distribute. The workpaper should still state that the proportional denominator is absent and that no nonzero allocation was performed. A zero amount is different from a blank amount: the former is a known numeric input, while the latter is missing evidence. The model rejects missing required amounts rather than interpreting an empty form as zero.

Negative weights are outside this teaching proportional model. They can create a denominator and distribution with different meaning, potentially assigning costs in unexpected directions. A contra-allocation or credit driver needs a separately defined policy. Do not accept a negative weight simply because the arithmetic language permits it. Validation should protect the business meaning of the ratio, not only prevent a runtime exception.

7. Reverse the allocation symmetrically

Suppose the supported source cost is reversed for -101 minor units with the same eligible population, weights and policy version. The model allocates the absolute magnitude 101 using the same procedure, then restores the negative sign. The result is -34, -34 and -33. Each original row plus its reversal equals zero. The group total also returns to zero.

Applying floor division directly to negative ideal values can produce a different residual problem and different tie effects. Rather than rely on a language's negative rounding convention, the teaching policy states its sign treatment explicitly. This is a management reversal convention, not a claim that every negative invoice or tax calculation must use it. A real reversal should also identify the original allocation and appropriate authority outside the arithmetic model.

If the reversal relates to the original allocation, using today's changed weights may fail to cancel the historical rows. For example, the original equal-weight cost was 34, 34 and 33. A reversal under weights 1, 2 and 3 would be -17, -34 and -50, leaving nonzero amounts at A and C. The group still nets to zero, but the outlet history has changed. That may be intentional redistribution or an error; the workpaper must identify which.

The safest evidence chain for a true cancellation retains the original assignment values and version. A later reallocation can be a separate pair of events: reverse the original under its actual mapping, then allocate the supported new amount or driver under a new version. This prevents a seemingly harmless rerun from turning cancellation into an unrecorded transfer between outlets.

8. Expose the two-stage grouping effect

Now group A and B together as AB, leaving C separate. The first stage allocates 101 across group weights 2 for AB and 1 for C. Their ideal shares are 67 and one third, and 33 and two thirds. Initial shares are 67 and 33, leaving one unit. C has the larger remainder and receives it, so AB gets 67 and C gets 34.

The second stage splits AB's 67 equally between A and B. Their ideal shares are 33.5 each. Initial shares are 33 and 33, leaving one unit. The stable tie rule gives it to A. The final two-stage allocation is therefore A 34, B 33 and C 34. The direct equal-weight allocation was A 34, B 34 and C 33. Both conserve 101, but B and C differ by one minor unit.

This is not a software bug if the two-stage policy is deliberate. It is a consequence of introducing rounding at an intermediate boundary. The company must decide whether the authoritative allocation grain is the final outlet population or the intermediate group. If a reporting team assumes that arbitrary regrouping preserves every leaf assignment, this small fixture disproves that assumption under the stated integer method.

Avoid fixing the difference by editing one outlet after each report. That hides the chosen grain and creates a manual exception on every rerun. Instead state whether direct allocation or the defined hierarchy governs. Preserve the group identity, weights and intermediate assignments when hierarchy is used. A later reviewer should be able to reproduce why C received 34 in one policy and 33 in the other.

9. Distinguish conservation from business fairness

Conservation means assigned minor units sum exactly to the source amount. It is an essential arithmetic property for Hazel Wharf's workpaper, but it does not establish that the weights are appropriate or the tie rule is desirable. A method can conserve perfectly while assigning a cost to an outlet that never used the service. The reviewer needs both an exact calculation and a defensible allocation basis.

Stable-identity ties make a single run reproducible, but repeated equal remainders can systematically give the same objects the extra unit. A company may consider a documented rotating or cumulative-balance policy for repeated allocations. Such a policy requires persistent state, clear reset rules and stronger replay controls than the stateless method in this lab. It is not implemented here, and should not be implied by a label such as fair allocation.

The relative materiality of one minor unit also depends on context and volume. A small per-record difference can accumulate across many allocations. A company should assess cumulative and directional effects without inventing a universal acceptable tolerance. Reporting every one-unit difference as proven financial leakage is as misleading as ignoring all small differences because each appears trivial alone. Keep the population, frequency and policy meaning visible.

If the allocated amounts affect customer charges, contractual reimbursements, employee pay or regulated reporting, obtain the applicable requirements before applying a convenient management convention. The local method is not legal advice for those uses. Its institutional value is showing exactly which choices exist and what evidence must accompany them, so the company can implement the right approved policy rather than inherit an accidental spreadsheet default.

10. Build the exact allocation calculator

The model accepts a signed integer minor-unit amount and a nonempty set of unique stable object identities with nonnegative integer weights. It validates the supported numeric range and the identity domain used for deterministic tie ordering. It calculates exact products, quotients and remainders internally, assigns the residual and restores the sign. The output includes every intermediate quantity required to audit the result.

For each object, show weight, initial whole share, remainder numerator, common denominator, whether a remainder unit was awarded and final signed assignment. The interface can display an approximate ideal decimal for convenience, but it should not use that rounded display value to rank remainders. The conservation check compares the integer sum with the integer source amount, returning an exact zero difference for valid runs.

The lab also computes the defined AB-then-A/B hierarchy as a separate teaching policy. It displays direct and hierarchical assignments side by side, with row differences. It does not silently choose whichever result gives a particular outlet a lower cost. The comparison teaches why allocation grain belongs in the policy record. If a zero-weight subgroup receives zero, its internal zero allocation is handled without inventing a nonzero denominator.

Try amount 101 with weights 1, 1 and 1, then change B's weight to 2 and C's to 3. Compare 34, 34, 33 with 17, 34, 50. Change the amount to -101 and verify the symmetric signs. Set A's weight to zero and compare the remaining tie. Finally set all weights to zero with a nonzero amount and confirm a validation failure rather than an equal-share fallback.

11. Test the properties that totals alone cannot prove

The first property is conservation: every valid assignment sum equals the original signed amount. The second is identity stability: permuting input rows does not change the object-to-assignment mapping. The third is sign symmetry under the same policy and population: allocating negative A produces the negation of allocating positive A. These are meaningful properties of the stated method and can be tested across many small deterministic cases.

The fourth property is zero-weight exclusion: a zero-weight object receives zero, including during remainder distribution. The fifth is bounded deviation from the exact ideal under a single direct pass. The sixth is rejection of duplicate identities, invalid weights, missing amounts and a nonzero amount with no positive weight. A test suite that checks only one friendly 101-unit example could miss defects in all of these properties.

Do not assert a regrouping-invariance property that the chosen method does not possess. The AB example deliberately demonstrates the contrary. A good test can confirm that direct and hierarchical policies differ in the expected rows. This guards against a future refactor that accidentally replaces one declared policy with another while still satisfying conservation. A passing sum does not establish a passing policy implementation.

Range tests matter too. Exact intermediate products can be much larger than final row assignments. The local implementation uses a representation that preserves those integer operations and returns only supported external values. A port to a spreadsheet, database or other language should rerun the same fixtures and larger bound cases. The printed formula alone does not prove that the receiving implementation evaluates it with equivalent precision.

12. Keep currency conversion and allocation separate

The source amount in this fixture is already expressed in one unit and scale. A cross-currency process needs to decide whether to convert a group amount first and then allocate, or allocate native amounts and convert each result. These operations can produce different rounded outputs. The company should choose and document its actual reporting policy, rate source, date and precision rather than assume both sequences are interchangeable.

Do not add 101 minor units from two currencies as though they share a monetary scale. Even currencies with the same number of decimal places represent different units. Retain native amounts and explicit conversion evidence. A neutral MU in a teaching example avoids pretending to know an exchange rate. It is not a global currency implementation or a recommendation for any statutory translation method.

Conversion residuals should have a separate explanation from allocation residuals. If a translated total differs from the sum of translated rows, the reviewer needs to know whether the difference arose at the exchange-rate step, output rounding, population selection or distribution. A single field labeled rounding adjustment can conceal several unrelated mechanisms. Preserve the stages so each can be tested independently.

The calculator therefore declines to perform currency conversion. It teaches exact distribution of a supported single-unit amount. That boundary is useful because the method can be verified completely from its inputs. A company adapting it to a wider workflow should add the necessary conversion policy and expected-answer fixtures, then test the combined decision process rather than assume the single-unit test certifies every additional stage.

13. Preserve the source and policy versions

An allocation record should identify the source cost event, amount version, eligible population snapshot, weight source, policy version, scale and output. It should preserve the direct or hierarchical grain and tie rule. A file containing only final outlet amounts cannot explain why a later rerun differs. The evidence pack should let a reviewer determine whether the amount, population, weights or algorithm changed.

Weights may be revised after the reporting period. A corrected usage measure can legitimately change an allocation, but the earlier release should remain reproducible. The company can issue a revised report with a bridge or apply a change prospectively under its policy. It should not overwrite the old weights and retain the original approval date as though the reviewer saw the new result. Calculation history is part of decision history.

The source cost should not be created again every time the allocation runs. A recurring job can distribute a new period's supported amount, while a rerun of the same source event should create a new controlled output version or reproduce the existing one according to the process. Stable source and run identities prevent a technical retry from posting the allocated cost twice. This is separate from deterministic remainder assignment.

Approval belongs to the relevant version and purpose. A manager approving the equal-weight basis has not necessarily approved a later sales-weighted basis or a customer-billing use. The authority process should identify which facts were reviewed and which execution is permitted. The local export is a workpaper, not a posting instruction or payment authorization. Keep that distinction explicit when integrating the calculation into a company workflow.

14. Reconcile execution after the workpaper is prepared

A correctly calculated allocation can still be imported incorrectly. An outlet code may map to another entity, an export may be loaded twice or a downstream system may round again. The company should reconcile the executed population and amounts with the approved output. A generated CSV proves preparation, not successful posting. The receiving system's actual records need their own reference and verification.

Check row identity, native unit and scale at the interface. Importing 34 minor units as 34 MU multiplies the amount by one hundred in this fixture. Importing 0.34 MU into a field that expects integer minor units can truncate or fail. The interface contract should name the unit in the field definition and include a small known-answer import test. A readable column title alone is insufficient if the downstream mapping uses another interpretation.

Retain a complete group tie and row-level mapping. If A and C are swapped during import, the group still sums to 101 while outlet reporting is wrong. The row assignments, like the point-in-time cost examples elsewhere in the library, need identity-level verification. A zero group difference is valuable but not a complete test of correct attribution.

If execution fails partially, determine which rows were accepted before retrying. Reimporting the entire file blindly can double accepted rows while repairing only the missing ones. An appropriate idempotent or controlled reconciliation route depends on the receiving system. The workpaper should preserve output identities and expected assignments so the operator can establish the actual state rather than guessing from an error message.

15. Diagnose recurring one-unit differences

Suppose one report assigns 34, 34 and 33 while another shows 34, 33 and 34. Both sum correctly. The investigation should compare allocation grain, tie identity order and intermediate rounding before labeling one report corrupt. The fixture demonstrates a legitimate direct-versus-hierarchical explanation. A different case might arise from input row order or an unapproved locale-sensitive sort. The evidence needs to distinguish them.

If every row is independently rounded, the group may be off by one or more units. Record the exact ideal shares and the downstream rounding rule. Do not add a balancing line with no source identity and call the problem fixed. The lasting fix is an agreed allocation policy or presentation convention that the systems implement consistently. A manual plug may hide a symptom while leaving every subsequent run vulnerable.

Track cumulative direction where the use case warrants it. Repeated ties allocated to A and B can create a predictable pattern. That does not prove wrongdoing or an economic loss, but it may inform whether the policy fits the intended fairness objective. If management changes the tie rule, preserve the old and new policy versions and assess their effects. Avoid a silent change that improves one outlet's presentation while making historical comparisons inconsistent.

The incident review should end with a specific testable action: align the source scale, enforce stable identity order, remove unintended intermediate rounding or declare the authoritative grain. A generic instruction to be careful with decimals does not address those mechanisms. The teaching calculator helps isolate them because every step is visible and every expected result can be reconstructed without a proprietary system.

16. Test an increase that reduces one object's assignment

One further property needs explicit review: increasing the total amount does not guarantee that every object's assigned integer amount stays the same or increases under this remainder method. Consider three weights of 5, 3 and 1, for total weight 9. With an amount of four minor units, ideal shares are 20/9, 12/9 and 4/9. Initial whole shares are 2, 1 and 0, leaving one unit. C has the largest remainder, so final shares are 2, 1 and 1.

Increase the source amount to five with the same weights. Ideal shares become 25/9, 15/9 and 5/9. Initial whole shares are again 2, 1 and 0, but now two units remain. A and B have the largest remainders, so final shares become 3, 2 and 0. C's allocation falls from one to zero even though the total increased. Both outputs conserve the amount and remain close to their proportional ideals.

The calculator includes this case in its expected-answer tests. It is a consequence of reranking fractional remainders, not an implementation error to patch with an undocumented exception. A company that requires every recipient's integer assignment to be nondecreasing as the total increases should not assume this method satisfies that requirement. It needs to select and review a policy with the required properties for the actual use case, considering the trade-offs rather than treating conservation as proof of every desirable behaviour.

This matters when small allocated amounts influence a visible entitlement, charge or incentive. A manager may reasonably ask why an object's number fell after the source amount rose. The correct answer must explain the adopted method and its limits. It should not claim that the object used less service when its weight did not change. If the company considers that presentation unacceptable, the policy decision belongs before deployment, not in a manual override after a complaint.

The example also distinguishes exactness from intuitive expectations. The output is exact under the stated integer rule. Exact arithmetic prevents representation error, but it cannot make an allocation convention possess mathematical properties it lacks. A robust framework lists the properties required by the business, tests those properties and rejects a method that does not fit. It does not use a technical word such as deterministic as a substitute for a complete policy discussion.

For the workshop, reproduce the two allocations by hand and identify the winning remainder at each amount. Then explain why a regression test asserting that every row must rise with the source amount would fail even with correct code. Keep this counterexample in the policy test pack. It protects future maintainers from either promising an unsupported property or “fixing” the result in a way that silently changes the declared algorithm.

17. Complete the reviewer workshop

First reproduce 101 divided equally across A, B and C. Explain why independently rounding to 34 each produces a one-unit excess, while flooring each to 33 leaves two units unassigned. Apply the exact remainder and tie rules to obtain 34, 34 and 33. Then permute input order and verify the same identity mapping. A correct reviewer should be able to explain the assigned remainder, not merely read the final total.

Next change weights to 1, 2 and 3 and reproduce 17, 34 and 50. Reverse the amount and verify exact row cancellation under unchanged policy. Change the reversal weights and explain why group conservation can coexist with outlet redistribution. These cases connect arithmetic to version control and prevent a negative amount from becoming a hidden repair mechanism.

Finally reproduce the two-stage result 34, 33 and 34. State which policy the company intends to use and what evidence must accompany it. Prepare a handover containing the source amount, scale, eligible population, weights, tie rule, grain, assignments and execution status. Another colleague should be able to reproduce the result and identify the decisions still outside the calculator's scope.

Methods, sources and boundaries

Boundary drill: two source events are not one monthly allocation

Allocate two separate 101-unit source events with equal weights and the same stable tie rule. Each produces 34, 34 and 33, so the combined outlet assignments are 68, 68 and 66. Now aggregate the two sources first and allocate 202 once. Ideal shares are 67 and one third each; the single residual unit goes to A. The result is 68, 67 and 67. Both policies conserve the same 202, but B and C differ by one unit.

The company must therefore define the allocation event as well as the recipient grain. An invoice-by-invoice policy and a month-total policy are not guaranteed to produce identical recipient totals. Neither should silently replace the other during a reporting refactor. Preserve source-event identities and state whether aggregation happens before or after the integer allocation. A monthly tie to the group total cannot establish that the declared event-level policy was followed.

This case also explains why repeated stable ties can accumulate directionally. Under the event-level convention, A and B repeatedly receive the residual. Under a different approved policy, the company might manage cumulative fairness another way. That would require explicit state and replay semantics. Do not introduce a hidden rotation or manual adjustment while leaving the workpaper labeled as the same stateless stable-identity method.

All records, amounts, weights and company choices are original fictional teaching material. The model uses integer minor units and an explicit proportional floor-and-remainder convention with stable identity ties. Negative amounts use magnitude allocation followed by sign restoration. The AB hierarchy is a separately labeled policy demonstration. No tax, payroll, consumer-price or statutory accounting rule is inferred from this arithmetic method.

The primary reference is PostgreSQL's numeric-type documentation, supporting the narrow distinction between exact representation, precision, scale and implementation-specific rounding. The restaurant allocation procedure, examples, fairness discussion and workpaper are this guide's own construction. The cited documentation does not endorse these management choices or establish legal compliance.

Use the input CSV and answer file to audit the calculation. Before adapting it, verify the economic driver, native unit, output precision and authoritative allocation grain. A trustworthy allocation can explain every minor unit, including the one that prevents the rows from being exactly equal.

Research sources and scope

Build on the foundations

These introductory resources are already available in the existing website library.