var partyAmount = null, // 12 --- for each row where vote share is above threshold
seatAmount = null, // 179
population = null, // 5000000
threshold = null, // in per cent; e.g. 2
columns = function(seatAmount) {}; // find more optimal value than seatAmount
Steps
1
D'Hondt
Create a table with
a header row and {{ partyAmount }} rows
a party-name and vote-amount column and {{ seatAmount }} columns
Party
Votes
1
2
3
...
seatAmount
A
v_A
v_A/1
v_A/2
v_A/3
...
v_A/seatAmount
B
v_B
v_B/1
v_B/2
v_B/3
...
v_B/seatAmount
C
v_C
v_C/1
v_C/2
v_C/3
...
v_C/seatAmount
Saine-League
Create a table with
(...)
(...) and {{ seatAmount }}/2 columns of uneven numbers
Links
Config
Denmark's mandate calculation:
mandates = dHondt(votes, 135) + sainteLeague(votes, 40);
Steps
1
D'Hondt
Create a table with
{{ partyAmount }}
rowsa party-name and vote-amount column and
{{ seatAmount }}
columnsSaine-League
Create a table with
(...) and
{{ seatAmount }}
/2 columns of uneven numbers2
Pick the
{{ partyAmount }}
largest values3
Summary:
#1
+#2
#1
Party C: 0 mandates