hanase / vote

R package for counting election votes via various methods, including single transferable vote
3 stars 3 forks source link

In equal number of votes situation, who should win? #12

Open Sjan1 opened 4 months ago

Sjan1 commented 4 months ago

In the following example, "APE" wins, while the number of votes equals. Is the winner determined alphabetically?

ballot_plurality_subset GO APE [1,] 1 0 [2,] 0 1 [3,] 1 0 [4,] 1 0 [5,] 0 1 [6,] 1 0 [7,] 0 1 [8,] 0 1 plurality(ballot_plurality_subset, nseats = 1)

Results of Plurality voting ===========================
Number of valid votes: 8 Number of invalid votes: 0 Number of candidates: 2 Number of seats: 1

Candidate Total Elected
1 GO 4
2 APE 4 x
Sum 8

Elected: APE

hanase commented 4 months ago

It's not alphabetical. It's simply the last candidate, since it is using rev(sort(total))[1:nseats] to get the totals in a decreasing order.

Sjan1 commented 4 months ago

While the function works the way it should, which is reassuring, I find the behaviour misleading. When the two candidates reach the same number of votes, it would be fair to win for both of them. And print a message of why it happened.