# The finer details of Meek's STV

Meek's version of the Single Transferable Vote system [.pdf] is used in multiple big elections including those of New Zealand and Stack Exchange.

Demonstration (with thanks to the Department of Internal Affairs of New Zealand).

I have a basic understanding of how the votes are counted, but there's one thing I haven't been able to figure out.

What happens if positions are left blank?

For example: Assume 6 candidates and no limit on the amount of choices.

One could vote (where left is first vote and right is last): 3 4 5 6 1 2 or 4 5 6 and leave the rest blank.

In the STV system, the following is legal as well: 0 2 4 0 1 6 What would happen in that case?

Will the choices be shifted to clear it from any left-open positions or will the votes be counted at the moment indicated by the position? Those options will (likely) influence the election both in different ways.

I'm not a CS expert in any way, just trying to get the hang of an interesting system to implement my own vote counter.

In Meek STV, there is the concept of the quota or threshold that a candidate must exceed to be considered elected. This threshold is changed from round to round in the Meek STV system. The threshold changes based on how many votes are thrown away.

Let's say that your code is 4 5 6 and the rest blank, then once all those candidates are either elected or eliminated, the remaining part of your vote is considered "thrown away". Based on this, the threshold is changed for what candidates need to be elected in the next round.

In the STV system, the vote 0 2 4 0 1 6 is considered the same as 2 4 1 6 0 0, i.e. the zeros are automatically put at the end.

In the Stack Exchange moderator elections, it is possible to choose only a second candidate and a third candidate, but not a first. That is the same thing as choosing a first candidate and a second candidate.

Related on Meta Stack Exchange: How are moderator election votes counted, in pure English?

Elections always have the notion of a spoiled ballot. Your example, 0 2 4 0 1 6 is not "legal." It is a ballot but not a well formed one. It would be thrown out of the process and none of the choices would count.

The program that counts the ballots must validate each ballot to make sure it makes sense.

If the ballot is an ordered list of choices (as in the paper you pointed to) then the program must make the following validation checks:

• each entry in the list contains a single candidate identifier in the range 1...6.
• no entry in the list (other than the one indicating the end of the list) is empty.
• no entry in the list is a repeat (has the same candidate identifier) as any other entry.

Failing any of these validation checks makes the ballot invalid or spoiled, and the ballot is rejected.

If the ballot is a list of the candidates where you must fill in a number next to each candidate (as in the example New Zealand ballot you pointed to) then the checks would be:

• There is either a single preference number in the range 1...6, or no preference number entered next to each candidate's name.
• No two candidates have the same preference number entered next to their name.
• The preference number 1 is next to some candidates name.
• If the preference number k (in the range 2...6) is entered next to some candidates name then the preference number k-1 must be entered next to some other candidates name.

Again, failing any of these checks makes the ballot invalid or spoiled, and the ballot is rejected.

• For Meek STV, especially how Stack Exchange uses it, this is not how it works. – Simon Forsberg Oct 12 '15 at 17:13
• Depending upon the specific system and specification, 0 2 4 0 1 6 might be treated as equivalent to 2 4 1 6 rather than being thrown away entirely. – D.W. Oct 12 '15 at 18:02