Moonwise home page | Moonwise Calendar | Moonwise Diaries | online ordering |
Moonwise on Facebook | latest newsletter | watching the sky | dates |
site index & links | live calendar page | live diary page |
D’Hondt elections, such as the English, Scottish and Welsh regional elections for the European Parliament, work by allocating the available seats in a number of rounds.
In each round, a “quotient” is calculated for each party. This is the number of votes divided by one plus the number of seats already allocated to the party.
The party with the highest quotient is allocated a seat, and the process continues until all available seats are allocated.
You can use this page to review old results, follow results as they come in, or experiment to see how many votes your party needs to get that extra seat!
Fill out the names of the parties, and put in the votes. You can use percentages instead, if you wish. Press the button to submit changes.
The result you are looking for will be in the column with the total available seats shown at the bottom.
A tie means that more than one seat gets allocated in a round, and if there is no result column with the total available seats at the bottom, the result is invalid.
In case you are interested, here is the important part of the code:
for ($round = 0; $round <= $total_rounds; $round++) {
for ($party = 0; $party < $total_parties; $party++) {
if ($round == 0) { $quotient[$round][$party] = $partyvote[$party]; } else { $quotient[$round][$party] = $partyvote[$party] / ($seat[$round - 1][$party] +1); }
}
$max[] = max($quotient[$round]);
for ($party = 0; $party < $total_parties; $party++) {
if ($round == 0) { $seat[$round][$party] = 0; } elseif ($quotient[$round][$party] == $max[$round]) { $seat[$round][$party] = $seat[$round - 1][$party] + 1; } else { $seat[$round][$party] = $seat[$round - 1][$party]; }
}
}
William Morris