pik-gane/vodle

poll initiator can optionally set a poll-wide minimum share and a number of indivisible budget units

mensch72 opened this issue · 0 comments

Use story: In the draft poll page, if the poll type is "share", the initiator can optionally set a minimum share (a percentage m) and optionally a number of indivisible budget units (an integer k>1). If both m and k are set, require that m is a multiple of 1/k.

Effect: In the final resulting shares, each option will get 0 or at least m (if set), and will get a multiple of 1/k (if set). The shares will be drawn by a random process so that each option's expected share equals their target share that results from the normal tallying process.

Implementation:

  • If m is set: sum up the shares s(x) of all options x with s(x)<m. If the sum still < m, add shares of other options from bottom to top in the final ranking, until the sum S>=m. Let X be the set of those options summed up. Assign s(y) to all y not in X deterministically. Draw x from X with probability s(x)/S. Assign S to x and zero to all other members of X. Call the new shares derived like this s'. Not that each s'=0 or >=m.
  • If k is set: Paint a pie chart with pie sizes s'(x) and options placed in order of descending rank. Pick a random offset o between 0 and 1. For l=1...k, assign the l'th budget unit to the option whose pie piece contains the angle 2 pi (l - o) / k. Note that this preserves expected budget shares and, if m is set, the constraint that final share =0 or >= m (since m is a multiple of 1/k).