What did my vote do? is a tool written by by Roy Ward to explore the counting of the most recent local body election for the Dunedin City Council that was run using STV (Single Transferrable Vote). In particular, it lets you enter your vote, and then shows how this vote affected the counting process. It also has a mode where the counting can be stepped though on iteration at a time to explore the internals of the STV process.

Contents

The Counting Algorithm

STV in local body elections in New Zealand uses Meek’s counting method. The specific algorithm used is specified in the Local Electoral Regulations 2001, Schedule 1A, Part 1 - Multi-member vacancies. This specification is exact, and includes how to do the counting, how many decimal places to use, how to round calculations, and exactly what to do in the case of a tie. The software here follows all of those rules (except for some of the exceptional cases which don’t arise in the Dunedin City Council election), so will end up with exactly the same numbers as the official count.

How to use the software

This is a brief description of the controls, and how to interpret the results.

Ranking the Candidates

Rank the candidates as you would a ballot, with consecutive numbers from 1 up to the number of candidates - just like a real vote, you may rank as many or as few as you like. If you pick numbers out of range, miss values or use duplicate values, only a non-duplicate consecutive range starting from 1 will be used, the same rules as would be used on a real ballot. This is as described in Part 3 - Recognising preferences of the Local Electoral Regulations 2001, Schedule 1A.

On my computer, Tab and Shift-Tab are useful to navigate up and down the ranking boxes, particularly if you already have an alphabetically ordered list with your ranks.

Clear Ranks

Clear all the rank boxes. A page reload will also do this.

Process Vote

This generates the election results, with the provided ballot included.

Sort Order

This chooses the sort order for the candidates.

  • Outcome order: Sort by the order that that the candidates were elected or excluded. This is close to ordering by the Iteration column, but there is also an internal ordering when more than one candidate can be elected/excluded in the same iteration.

  • Your ranking: Sort by order of the candates you ranked. Any unranked candidates are sorted below the ranked ones in outcome order.

  • Final Votes: This is the order that the results are displayed in the offical results - it gives some idea of the ‘success’ of each candidate. The elected candidates (first elected at the top) are listed before the excluded candidates (first excluded at the bottom).

  • Alphabetical: Ordered by the candidate’s last name.

Detail

There are three levesl of detail: Summary, Full Results, and Show Iterations

  • In Summary mode, only candidates that had a portion of your vote applied to their election or exclusion will be shown in the results table, only a few columns will be included.

  • In Full Results mode, all candidates will be shown in the results table, and most columns will be included.

  • In Iterations, all candidates will be shown in the results table, and you can step through the iterations of the counting algorithm. In addition, two extra columns appear: Votes and Keep.

Result Table

If detail is set to Summary, only candidates that had a portion of your vote applied to their election or exclusion will be shown. In the other detail modes, all candidates will be shown.

Different Columns will be displayed depending on the level of detail selected:

Column Summary Full Results Iterations
Name
Ranking
Votes
Keep
Status
Iteration
Vote Applied
Weight

Name

This is the name of the candidate, as appeared on the voting paper, with the affliation left off.

Ranking

This is the rank that you gave the candidate in the form above. Note that only the valid part of the vote is shown here.

Votes

This column is only shown in Show iterations mode. It is the number of votes (including transfers from surplus or excluded candidates) that the candidate had at that iteration.

Keep

This column is only shown in Show iterations mode. This is the keep value at that interation as described in the New Zealand Local Electoral Regulations 2001, Schedule 1A, Part 1 - Multi member vacancies, clauses 7 and 17.

Status

Elected or Excluded. In Show iterations mode, this column will only be populated if the candidate was elected or excluded in the current iteration or before.

Iteration

The iteration of the counting in which the election of exclusion happened. This can be used to see the order of processing.

Vote Applied

This is the important column for determining what happened with your vote. If the detail level is set to Summary, this will display what proportion of your vote went towards electing of excluding that candidate.

In the more detailed modes, it may have serveral types of entry:

  • A number: At the time of election/exclusion for a candidate, this was the weight of your vote at that iteration - it represents what proportion of your vote went towards making that decision. If the candidate was elected, some of your vote will be kept to elect that candidate (according to the Keep Value, which changes every iteration), and the rest of your vote can be used for lower rank candidates. If the candidate was excluded, none of your vote is kept with that candidate, and can all be used for lower ranked candidates. There will usually be a relatively small number of candidates that have a number.

  • Blocked M/N: You ranked the candidate at position N, but the you ranked another candidate above them at position M that hadn’t been elected/excluded at that point. Because the algorithm doesn’t look beyond the highest ranked candidate that hasn’t yet been elected/excluded, there may be many of these.

  • Unranked M/N: You didn’t rank the candidate (N is the next position that you would have used if you had ranked another candidate), but you still another candidate at postion M that hadn’t been elected/excluded at that point, so had you ranked that candidate below your other rankings, it still would not have contributed to the outcome’

  • Exhausted: Your vote was exhausted - you didn’t rank the candidate, and all your choices had been elected/excluded at that point. If you had ranked that candidate, it may have contributed to the outcome.

Weight

This is the the weight \(v_m\) as described in the counting algorithm, and changes every iteration, depending on the keep values. If Show iterations is not selected, the final \(v_m\) will be shown here.

Privacy

Privacy is important when doing anything related to voting.

This website does all the usual traffic logging - your IP address and what pages you visited are logged, but the details of what you do on any particular page are private (except for the contact me page). in particular on the What did my vote do? page, what ranks are entered, what controls you used and any processing done never leaves the local machine, and is never transmitted.

Also, this website does not store any cookies, so even if you use it on a public computer, nothing will be stored when you leave the page. The downside of this is that if you reload the page or leave the page and come back, any data you have entered will be lost.

Other Elections

There are two ways that STV can be used in local body elections:

  • To elect multiple candidates, such as as for a council. This is the case that this software is designed to handle. This is covered in Part 1 - Multi-member vacancies of the Local Electoral Regulations 2001, and is it not obvious how your individual vote is counted (hence this software).

  • To elect single candiates, such as for a mayor or small ward. This is a special case of STV, also known as Instant Runoff Voting. This is a much simpler process, and it doesn’t need software to see the effect that your vote had by inspection the order that candidates were excluded - your vote is considered in any iteration that a candidate is elected/excluded where you don’t have a higher ranked candidate that hasn’t been elected or excluded yet.

As a result of that, I have not included an option the Dunedin City Council mayoral election, although I could provide that if there is enough interest.

It would be relatively easy to add other elections, and I will do so if enough people consider this software to be of value.

Contact Me

Any comments, corrections, observations or requests for for more elections to be added? Please feel free to contact me