Daddy Clanger (imc) wrote,
Daddy Clanger
imc

More politicking

As you will no doubt know by now, I survived the nomination process for the LiveJournal Advisory Board election and will therefore appear in the poll which is due to be posted tomorrow.

There has been a certain amount of controversy about the rules for counting the votes because they are not actually that clear, and some interpretations of them lead to non-intuitive results. Here is what the rules say:

  1. If a user has 51% of the first-choice vote, that candidate will be declared the winner.
  2. If no user has 51% of the first-choice vote, we will begin using an Instant Runoff process. The user with the lowest tally for first-choice vote will be eliminated, and the second choice candidate on those ballots will be substituted as first choice. This process will continue (drop lowest candidate, reassign to next vote, tally again) until any user has 51% of the vote.
  3. If all ballots are exhausted and no candidate has 51% of the vote, we will return to the first round and award the election to the candidate with the most 1st choice votes.

The particular problem with this is what is meant by "51% of the vote." Suppose 35% of voters vote for A and no one else; 30% vote for B first and C second; 15% vote for C first and B second, and 20% vote for other candidates entirely. If A, B and C are the last three candidates in then C will be eliminated, giving B 45% of the original vote to A's 35%. But neither candidate has 51% of the vote, so under the last rule above the election will be awarded to A despite the fact that A is clearly less popular than either B or C.

The other way of looking at it is in this: if 100 people voted originally, then when only A and B remain, A has 35 votes and B has 45, so out of those 80 votes B has a clear majority and the election would be awarded to B (which is as it should be in my opinion). If this is the case though, the last rule quoted above will never come into operation unless the final result is a tie (or very nearly so).

Well, there is no substitute for looking at the code.

The first thing to note is that the procedure for deciding whether there's a winner (has_majority) declares a result if any one candidate has strictly more than half of the total vote (i.e., not 51% as the rules say; I am guessing here that they meant to say "more than 50%").

The procedure for determining the winner seems to go like this:

  1. Sort every ballot paper into buckets (vote_totals), one for each candidate, based on who currently appears in first choice on the ballot paper.
  2. Count the number of votes in each bucket and note the total number of votes in all buckets. If any candidate has more than half the total votes, that candidate is the winner.
  3. List the candidate or candidates with the least number of votes in their buckets. If that happens to be all the candidates (it's a dead heat) then cross off the first choice from every vote and go back to the start.
  4. Take all the votes out of the eliminated candidates' buckets and cross off the current first choice before going back to the start.

Most importantly, any ballot papers without a valid vote on them are not placed in any bucket and so take no further part in the election. Therefore the second scenario in my hypothetical example applies (i.e., B is elected).

The code doesn't actually mention what happens if this procedure fails to return a result, but it does display its internal workings to the LiveJournal official who counts the vote so that case can be handled manually.

The upshot of this is that putting me in first place on your ballot will not automatically let the troll candidate get in by default, provided you use the second and third place votes wisely.

If any perl experts beg to differ and would like to pronounce me wrong, please go ahead. :-)

Tags: lj
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 8 comments