# A Small STV Election for Meek’s Method

I’m continuing my experiments to figure out the strengths and weaknesses of different types of single transferable vote. I thought I’d explore Meek’s Method.

The following small election produces a different (unambiguous) result depending on whether you use Meek’s method or normal Gregory counting:

We are trying to fill three seats, with four candidates (named 0, 1, 2, 3) competing for those seats. Six votes are cast for them as follows:

• One vote of 3, 0, 1, 2
• Two votes of 0, 1, 2, 3
• Three votes of 3, 0, 2, 1

Both Meek and normal Gregory counting elect candidates 0 and 3, but they differ on whether they elect 1 or 2. Meek elects candidate 1, Gregory elects candidate 2.

The reason for this is that in the first round both methods elect candidates 3 and 0 (the quota to meet here is 2 votes). With normal Gregory counting all of the votes that cast 3 as their first vote now transfer to their third preference, because 0 is already elected. With Meek, the cost of electing 0 is more spread out between all of the votes, so the strong bloc who have candidate 2 as their third choice preference got more weight.

I feel like in this case it’s probably fairer for 1 to be elected than 2: The candidates who voted for ‘3, 0’ as their first choice are doing a lot better than the candidates who voted for ‘0, 1, 2, 3’ by the third round – they have their two favourite candidates – so giving the latter more weight in the ranking is probably fair. In Gregory counting they are instead penalised heavily because the they were made solely responsible for bringing in candidate 0 despite the fact that it was everyone else’s second favourite candidate which they would have happily voted in next round if 0 hadn’t made the quota in the first round.

I’m glad I did this experiment though, because it taught me two important things:

• I think Meek’s method probably produces noticeably fairer results in many cases.
• I don’t trust Meek’s method at all and suspect many or most implementations of it are subtly broken.

To unpack on the latter: This implementation was very hard to get right. I’m still not 100% sure I have, and I definitely wouldn’t have without a lot of assertions, testing it using Hypothesis, and implementing everything as arbitrary precision fractions rather than floating number so I could do a lot of cross checking.

Additionally, it required at least one significant change to the method that is both obviously necessary and don’t seem to be documented anywhere at all:

With the method as described it is possible for a candidate to retain more than 100% of the vote that is allocated to them, so you need to cap the weights at 1 if an elected candidate currently has less than the quota (this can happen because they get some large percentage of their vote passed on from other elected candidates), or everything goes horribly wrong and you start getting candidates with negative numbers of votes. You also have to handle a possible divide by zero here if in the initial rounds of the iterative process an elected candidate actually has no votes at all.

On top of that, all implementations in the wild probably use floating point rather than arbitrary precision numbers. On the one hand this is a good thing because the arbitrary precision method proved to be incredibly slow – the calculations involved produce massive blow-ups in the size of the fractions, so everything basically ground to a halt after a fairly small number of iterations. On some slightly larger elections (e.g. I saw one trying to elect 7 out of 8 candidates)  it essentially never terminated.

This probably means you’re getting a lot of rounding errors in practice if using floating point numbers, which makes me somewhat reluctant to use the system in practice. If I were to use it I would probably insist on a software floating point library so as to have a reproducible result on different machines. A fixed point solution might also work her.e

Interestingly, Meek’s method is used in practice by several countries. It’s not totally clear to me how they deal with these issues, or how much that would matter in practice.

This entry was posted in voting on by .