This is a Parliamentary Allocation method.
The task is:
The main idea of this method is to satisfy the following constraint:
If this constraint is not respected, we have:
So we give a place to a party $i$ with maximal $\cfrac{p_i}{\lfloor s_i \rfloor + 1}$ score
Meaning:
$S = 10$
$p_i$ | $q_i$ | $\lfloor q_i \rfloor$ | $s_i$ | $\cfrac{p_i}{\lfloor s_i \rfloor + 1}$ | |
---|---|---|---|---|---|
$P_1$ | 6373 | 6.373 | 6 | 6 | 910.42 |
$P_2$ | 2505 | 2.505 | 2 | 2 | 835 |
$P_3$ | 602 | 0.602 | 0 | 0 | 602 |
$P_4$ | 520 | 0.520 | 0 | 0 | 502 |
8 | 8 |
$P_1$ has the highest $\cfrac{p_1}{\lfloor s_1 \rfloor + 1}$ score
$p_i$ | $q_i$ | $\lfloor q_i \rfloor$ | $s_i $ | $\cfrac{p_i}{\lfloor s_i \rfloor + 1}$ | |
---|---|---|---|---|---|
$P_1$ | 6373 | 6.373 | 6 | 7 | 796 |
$P_2$ | 2505 | 2.505 | 2 | 2 | 835 |
$P_3$ | 602 | 0.602 | 0 | 0 | 602 |
$P_4$ | 520 | 0.520 | 0 | 0 | 502 |
8 | 9 |
$P_2$ has the highest score now
$S = 10$
$p_i$ | $q_i$ | $\lfloor q_i \rfloor$ | $s_i$ | $\cfrac{p_i}{\lfloor s_i \rfloor + 1}$ | |
---|---|---|---|---|---|
$P_1$ | 6373 | 6.4 | 6 | 6 | 910.42 |
$P_2$ | 2505 | 2.505 | 2 | 2 | 768.33 |
$P_3$ | 702 | 0.602 | 0 | 0 | 702 |
$P_4$ | 620 | 0.520 | 0 | 0 | 620 |
8 | 8 |
Give the seat to $P_1$, recalculate the score:
$p_i$ | $q_i$ | $\lfloor q_i \rfloor$ | $s_i$ | $\cfrac{p_i}{\lfloor s_i \rfloor + 1}$ | |
---|---|---|---|---|---|
$P_1$ | 6373 | 6.4 | 6 | 7 | 796.6 |
$P_2$ | 2505 | 2.505 | 2 | 2 | 768.33 |
$P_3$ | 702 | 0.602 | 0 | 0 | 702 |
$P_4$ | 620 | 0.520 | 0 | 0 | 620 |
8 | 9 |
Again allocate the seat to $P_1$
$p_i$ | $q_i$ | $\lfloor q_i \rfloor$ | $s_i$ | |
---|---|---|---|---|
$P_1$ | 6373 | 6.4 | 6 | 7 |
$P_2$ | 2505 | 2.505 | 2 | 2 |
$P_3$ | 702 | 0.602 | 0 | 0 |
$P_4$ | 620 | 0.520 | 0 | 0 |
8 | 10 |
This shows that the method is still not perfect.
Show that
Solution
Also respected