title: How to implement fair division(?) with buffer in javascript?
body: <p>For the sake of explaining, imagine I have 101 entities. The entities are all people.</p>
  
  <p>In the first entity, it has x amount of "potatoes", I want it to have y potatoes, for now I shall use 950 as an example, intentionally choosing a more awkward number than 1000 for testing.</p>
  
  <pre><code>var personOne = {
       ...
       potatoes: 100
  }
  </code></pre>
  
  <p>I have 100 more of these entities which may have any number of potatoes, but I set a constant buffer that at least 100 for the sake of example again - have to remain with each person.</p>
  
  <p>This means for all of the entities that have over 100, I will be taking some from them - I want this to be shared proportionally across all of them, so that 850 aren't taken from the first two or three, but 10 or 5 taken from all those that are capable of providing such an amount.</p>
  
  <p>Any ideas for an approach?</p>
  
  <p>Optionally: I am using more properties than one "potatoes" property, but I plan on looping through each type and re-using the method that I find to each. I am unsure as to whether this could affect the answer.</p>
  
  <p><strong>Important / Simplified</strong><br>
  The one entitiy is pulling "potatoes" from all of the other entities, they are not being distributed evenly across all of them - they are being taken to one entity. I just do not want to do it in a way that is not proportional across all other 100 entities.</p>
  
  <p>This is more taxation than cake-cutting. I am struggling to google for or think of the correct name for the mathematical problem.</p>