Imagine we have an integer amount (e.g. integer cents) to be allocated across a weighted set of items where the total allocated amount must sum to the original amount. For example:
Amount: $1.00 Item Weight Allocated Amount a 1 $0.33 b 1 $0.33 c 1 $0.33
Which could be brought to satisfaction by adjusting item
c to be $0.34.
Is there an algorithm that results in even distribution of rounding error with only earlier weights and the total weight being known?