# How are moderator election votes counted, in plain English?

The election pages' sidebars state that Stack Exchange elections use the Meek STV vote-counting method:

After m days, the final voting results will be freely downloadable from this page forever, and we will calculate the n winners using OpenSTV with the Meek STV method.

How does that work? I suspect that Meek STV is unfamiliar to most Stack Exchange users, with experience from previous SE elections notwithstanding. After reading the linked description of Meek STV twice, as well as some other descriptions of the Meek method, I finally understand it... I think. Kinda. Sorta. Can someone provide a layman's explanation?

-
Do I get a badge for the first use of the word psephology, here and on chat? :) chat.meta.stackoverflow.com/transcript/89?m=485684#485684 – Benjol Feb 2 '11 at 17:10
Why isn't it just "the 3 guys with the most votes"?? Since when is that not accurate? lol – Jhawins Feb 26 '14 at 16:40
Because you dont just vote for one person @Jhawins You vote for 1st second and 3rd choice. – qwertynl Feb 26 '14 at 16:41
Oh yeah. Well, I still don't see how it can be this complicated. But whatever. – Jhawins Feb 26 '14 at 16:48

Meek's method of STV is an iterative process that approaches the will of the people asymptotically.

TL;DR Your vote, valued at `1.00 vote`, is applied to your candidates in the order you rank them. Each candidate only uses as much of your vote as needed to become elected (shared equitably between all who voted for that candidate). The fractional remainder of your vote is then passed down your list to your next choice, in the order of preference. If a candidate is considered out of the race, you get that part of your vote back to apply further down your list.

For a more detailed example, assume:

• 24 people voting
• 6 candidates
• 3 open seats

Thus, 6 is the vote "quota"¹ for becoming elected (24 votes ÷ (3 seats + 1)).

To cast their ballot, each voter chooses who should receive their vote by selecting a first choice, second choice, and a third choice candidate.

At the beginning of the counting process, every vote is fully applied to the first choice candidate. So now the question is asked: "Did any candidate receive more votes than the quota?":

• Yes. If a candidate receives more than the 6 vote quota, the "excess" (which is the number of votes over the quota for that candidate) is redistributed to those votes' next choices.

If Candidate A has received 10 votes when the threshold is 6, then only 6/10 of each vote is needed to elect Candidate A. Therefore the remaining fraction (4/10) of each of those votes is transferred to each votes' next choice down the list of candidates on that ballot.

or...

• No. If no candidate's status changed to be above the quota, the candidate with the least number of votes is removed from the race. Those votes are then transferred to count fully toward their next choice down the ballot.

Once the votes are transferred at the end of the current iteration, the quota is recomputed (I believe this is to remove the partial votes for candidates that are out of the running), and the same question is asked again. This is repeated until there are only three candidates left in the running and each has votes at (or "near" for small values of near) the quota value.

If all candidate choices on a ballot are eliminated, that vote no longer has an impact on the outcome.

If a candidate has votes above the quota, votes are transferred (at the end of option 1.) before determining if a candidate should be eliminated. That's why choosing a popular candidate as your first choice isn't "throwing your vote away" under this method.

¹ The quota can actually vary as the process iterates. See the wiki article for the formula which is actually recomputed at each step.

-
Voting for a candidate who you think is going to lose also isn't throwing your vote either - because 100% of it will transfer to the next candidate. Tactical voting is less relevant and less effective. And the iterative nature of this algorithm does away with the problem that occurs in other methods when two elected candidates transfer votes to each other (thus putting them both above the quota again, and meaning voters would have spent too large a proportion of their vote on them). – DMA57361 Feb 2 '11 at 18:46
Finally, a system that actually makes sense! – The Guy with The Hat Jan 31 '14 at 21:10
"Thus, 6 is the vote "quota"¹ for becoming elected (24 votes ÷ (3 seats + 1))." Why is that how you calculate the quota? Why do you add 1 to the number of seats? – bpromas Dec 1 '15 at 14:12
@BrunoRomaszkiewicz I think the arithmetic is wrong. It would make sense to do `ceil(voters / seats)`. in this case 6 isn't automatically elected, since 4 candidates could get 6 votes. One would then meet the quota, but not be elected. – Adam Smith Dec 4 '15 at 20:22
@BrunoRomaszkiewicz If there is 1 seat, we want the winner to get over 50% of votes, not 100%. So division by 2 (number of seats + 1) makes sense. This is called Droop quota. – ᴡᴏʀᴅs Mar 14 at 20:38
actually, compared to Condorcet, this system sucks. quite complicated and hard to explain to people who count on knowing how their votes are considered by the tabulator in order to know how to vote most effectively. – robert bristow-johnson Mar 15 at 0:31
@robertbristow-johnson Condorcet isn't a voting system, it is a property of voting systems. Also, Maximal lotteries is rather hard to explain, but is better on average than any other voting system with voters who vote for how they want. – PyRulez Apr 13 at 0:24
sorry, @PyRulez, but your initial statement is pedantic. the only difference between the "voting systems" that Condorcet is a "property" of, is how they would resolve the Rock-Paper-Scissors cycle if one were to happen (which is unlikely). otherwise Ranked-Pairs, MinMax, Schulze all pick the same candidate, the *Pairwise Champion". would you like me to explain to you how Condorcet, without any of those other specific qualifications works as a "voting system"? Pure Condorcet, no Tideman, no Schulze, no Kemeny... – robert bristow-johnson Apr 13 at 2:38
so after all of the ballots are tabulated and you can constructed this Defeat Matrix, you might know what that is. now every candidate's forehead is nice and clean, and you (the election judge) have a marker pen. for each pair of candidates you see from the Defeat matrix, which candidate defeats the other (gets more votes). on the forehead of the defeated candidate, you mark a big L for Loser. after doing that for every candidate pair, you elect the candidate that doesn't have a big L on his/her forehead. (might not always work, but it's a system.) – robert bristow-johnson Apr 13 at 2:45

Meek STV does calculations in rounds (or "iteratively," for you programmer types). In the first round, all votes count for the candidate marked as the first choice. The system figures out how many votes are needed to win. If anyone gets that many votes, he wins, and any "extra" votes he got are handed out to the voters' second choices. If nobody wins, the weakest candidate gets cut and all votes he received go to the voters' second choices. Then the next round starts. Rounds keep going until enough people have been elected.

Or, if you're into explanatory videos, check out Politics in the Animal Kingdom: Single Transferable Vote on YouTube.

As you might guess from the name "Single Transferable Vote," every voter gets one vote. But that doesn't make sense; you get to vote for three people in the election, right? Don't be fooled! In Meek STV, every voter's one vote might be split up into fractional bits and divided amongst the candidates or even thrown away. More on this later.

As with any voting system, there exists some threshold for victory, and any candidate who reaches the threshold is considered "elected." Meek STV calculates this threshold ahead of time. If a candidate gets more than enough votes to be elected, the difference between the votes received and the threshold is the "surplus." The candidate keeps just enough of everyone's vote to stay above the threshold; the rest is given to the voters' next-most-preferred choices in "redistribution."

Wait, what?

Example time. Let's say that 100 voters select candidate A as their first choice. Let's also say that the threshold is 25. At the end of the first round, candidate A is considered elected. Since the threshold is 25, candidate A only keeps 25/100, or a quarter, of the votes he got. But this doesn't mean that 75 of the people who voted for him transfer their votes to their second choice!

Instead, candidate A keeps one fourth of every one of those hundred votes he got. Then, all 100 voters get to transfer the remaining three quarters of their votes to their second-choice candidates.

In short: when someone you vote for gets elected, you lose a fractional bit of your vote based on the threshold and the total number of votes the candidate got.

Okay. But what if there are no surpluses to redistribute at the end of a given round? In that case, whoever has the lowest number of votes — let's call him candidate Z — gets thrown out of the election as if he had never participated in the first place. Whatever votes Z did accumulate get redistributed to the voters' next-most-preferred candidate, and they're worth just as much as they were when they were assigned to Z.

In short: when nobody gets elected and your vote is counting for the weakest candidate, your vote gets transferred to the next candidate on your priority list.

Finally, what happens when a vote is already on a voter's third choice, and it's time for redistribution? The remaining portion of that vote just gets thrown away, not counted towards any candidate. Any slivers of votes that get thrown away are still useful for one thing: they count towards "excess" in the threshold calculation.

In short: when everyone you voted for has either been elected or eliminated, any fraction of your vote that hasn't been used yet gets thrown away.

Note that, after any given redistribution, an already-elected candidate may exceed the threshold again; the algorithm re-redistributes votes to account for this.

The ratio of the threshold to the total number of votes a candidate gets is called the candidate's weight, or w. In the example above, wa is 25/100, or 1/4.

Say that your first choice was candidate A, your second choice was candidate B and your third choice was candidate C. Here's where your vote goes, assuming nobody you vote for gets eliminated:

A: wa
B: (1 - wa) wb
C: (1 - wa) (1 - wb) wc
excess: (1 - wa) (1 - wb) (1 - wc)

What if B got eliminated? Here's the adjusted breakdown:

A: wa
B: 0
C: (1 - wa) wc
excess: (1 - wa) (1 - wc)

(This concludes the math.)

Alright, so how is that threshold calculated, anyways? It's a lot harder than it is in older STV methods; actually, it's the reason the algorithm requires a computer. Meek STV is the only method to change quota mid-process. The quota generated at the start of every round by this expression:

`````` total number of voters - excess
---------------------------------
available seats + 1
``````

Note that total number of voters and available seats are constant, so the threshold is only affected by excess once tabulation begins.

### Partial list of sources:

-
nice! That pdf link is awesome! as I'm a math head `:)`. – yhw42 Feb 2 '11 at 18:54
btw: that PDF link breaks at the `\$` – yhw42 Feb 2 '11 at 18:54
@yhw, yeah, I originally tried to make the text a link, but the system wouldn't recognize it. `\$` is not in the list of illegal characters, so I'm saying it's Markdown's fault until proven otherwise. I've edited to de-linkify the whole thing. – Pops Feb 2 '11 at 18:59
Please define `excess` in the last paragraph. – Erwin Brandstetter Nov 14 '11 at 21:46
`excess` is the votes that are thrown away (e.g. where all 3 candidates on the wishlist are eliminated) – Johannes Kuhn Mar 12 '13 at 21:25
Not that it matters, but I like this answer a lot better than the other one, even though the other currently has almost twice as many votes. That other answer is pretty good, but I feel the "accessible to lay people" portion of this answer is simultaneously a little more understandable and a little more rigorous; the walk-through of an example scenario is more thorough and less mysterious; there is a deeper dive into the math at the end for those who care for it; and there is a more complete list of references. This is a textbook example of a Great Answer. – John Y Nov 24 '15 at 22:40
May I suggest a switch to approval voting? It's so much easier to understand. – Mark Feb 9 at 1:42
@Mark You may, but not here in the comments; probably nobody will see it other than me. Feel free to post as a feature request here on Meta SE though! – Pops Feb 9 at 5:25

I had to write my own explanation in order to figure out how STV works in practice. This answer goes into more detail about how the system works for multiple position elections such as most Stack Exchange elections.

As I write this, Donald Trump is well on his way to winning the Republican primary even though most people predict he'd lose a two candidate race. The problem can be summed up with this (hypothetical) chart:

``````Percentage | First choice | Second choice | Third choice
---------- | ------------ | ------------- | ------------
33%        | Trump        | N/A           | N/A
22%        | Rubio        | Cruz          | N/A
22%        | Cruz         | Rubio         | N/A
8%        | Bush         | Rubio         | Cruz
8%        | Kasich       | Rubio         | Cruz
7%        | Carson       | Cruz          | Rubio
``````

Trump supporters tend to be pretty adamant about their candidate, so let's suppose they wouldn't bother to vote if he weren't running. And let's suppose that Cruz and Rubio supporters would rather have the other candidate rather than Trump. And let's suppose Bush, Kasich and Carson are stealing votes that would go to one of the leading "not-Trump" candidates. In this scenario, it's clear that Trump is only in play because the rest of the field is divided. He'd lose to Rubio in a two-candidate race.

This is precisely the sort of paradox that single transferable vote (STV) systems are designed to resolve. While the math can be daunting, the idea is rather simple. Instead of waiting for candidates to drop out, an STV system allows voters to rank their preferences and resolve the voting accordingly. So in the example above, Carson, as the least-supported candidate, would be dropped and his votes would be transferred to Cruz.1 The new tally would be:

``````Percentage | First choice | Second choice | Third choice
---------- | ------------ | ------------- | ------------
33%        | Trump        | N/A           | N/A
29%        | Cruz         | Rubio         | N/A
22%        | Rubio        | Cruz          | N/A
8%        | Bush         | Rubio         | Cruz
8%        | Kasich       | Rubio         | Cruz
``````

Then the process of dropping the candidate with the least votes would continue until some candidate gets a majority:

``````Percentage | First choice
---------- | ------------
67%        | Rubio
33%        | Trump
``````

Moderator elections often involve multiple winners. Traditional plurality systems suffer from well-known problems that cause people to occasionally withhold votes to their prefered candidate. We use the Meek method which avoids this problem. Let's look at another hypothetical example of an election on The Beatles—Stack Exchange. The first round of voting looks like this:

``````Votes | First choice
----- | ------------
64    | Paul
25    | John
15    | George
10    | Ringo
``````

For this example, two moderator positions are open and there are four candidates. The first step is to establish a threshold for election. We use the Droop quota:

``````Votes           114
--------- + 1 = ----- + 1 = 38 (rounded down)
Seats + 1       2 + 1
``````

Notice that if there were only one seat, the quota would be 50% + 1 vote which is the definition of a majority. Droop generalizes the definition for any number of seats.

We can see at a glance that Paul has passed the threshold and will be elected. But what happens to the 26 extra votes he got, but didn't need?2 One potential method is to take 26 random ballots and transfer them to their second choice. That doesn't feel very fair because the results depend on which random sample is transferred rather than something under the voter's control. So the Meek method transfers fractional votes instead.

To simplify the example, suppose John is a very divisive candidate and none of Paul's fans pick him as their second choice:

``````Votes | Second choice | Percentage | Transferred votes
----- | ------------- | ---------- | -----------------
0    | John          |  0%        |  0
16    | George        | 25%        |  6.5
48    | Ringo         | 75%        | 19.5
``````

``````Votes | First choice
----- | ------------
38    | Paul
29.5  | Ringo
25    | John
21.5  | George
``````

Introducing fractional votes complicates the calculation, but it's a practical way to account for the secondary preference of all 64 Paul supporters while only transferring 26 votes.

Unfortunately we need to eliminate one candidate and George is now the lowest on the totem pole. So we need to transfer his 21.5 votes. Remember that 15 of his votes were first choices for him and the rest were transferred from Paul. The George-first ballots get redistributed according to their second choice and the Paul-first ballots get redistributed according to their third choice. Even in a hypothetical situation, the calculations are too tedious to continue. But the mathematical principles aren't so difficult; it's just juggling everyone's preferences.

One complication that might come up is undervoting or (in a large field) all preferences on a ballot have been elected or eliminated. Meek's solution is to recalculate the threshold based on the new vote count. If someone has already been elected, they will have some surplus votes because the threshold always decreases when ballots are eliminated. This is where the process gets especially complicated.3 But the principles remain the same:

1. Candidates are elected when they reach a "majority" threshold, which is a function of viable ballots and seats.

2. Surplus ballots committed to elected and eliminated candidates are transferred proportionally according to valid secondary preferences.

3. Once all seats are filled, the election ends.

No voting system is perfect. But we've run elections on 60 sites (many with multiple elections) since we started using STV and elected a diversity of well-qualified moderators who represent the interests of users. It's worked fairly well for us.

Footnotes:

1. To simplify the explanation, I'm assuming all of the supporters of Carson would have identical preferences. In reality, other candidates, including Trump, would pick up some of those votes.

2. The technical term for this is "wasted". Thankfully, that's also the common term for votes that don't count toward getting someone elected.

3. For an example of how complicated it can be, take a look at the first Worldbuilding election which had 10 candidates vying for 4 spots and took 22 rounds.

-
Perhaps you would be interested in weighing in on this question: communitybuilding.stackexchange.com/questions/1144/… (which specifically asks about choosing voting schemes for multi-seat elections like SE's; most STV discussion focuses on single-winner races). – Monica Cellio Mar 3 at 3:59

# Once more, with robots

Assume each voter gets a billion tiny robots. Their votes essentially are a preference list programmed into that robot.

Further assume, each candidate has a big robot-accessible, dry swimming pool assigned to them. All swimming pools are equally large. (To be precise, they are so large that all robots from all voters can exactly fill n + 1 swimming pools, where n is the number of available moderator positions.)

When all votes have been cast (i.e., all robots are programmed), all robots try to get into swimming pools according to their preference list. Now the following things can happen:

• A swimming pool is full. In this case, the respective candidate is elected and all robots that do not fit into the swimming pool have to look for another pool (according to their preference list). The separation between robots that are allowed to go into this pool and those that don’t is made absolutely fairly (for the robots), i.e., each robot has the same chance to get into the pool it desires.

• All robots have settled and there are still free moderator positions. In this case, the most empty swimming pool is closed and all contained robots are evicted and have to look for another pool according to their preference list. (To be precise, all robots from all pools are evicted and then start a new run on the pools. It’s fairer to the robots, you know.)

• A robot‘s preference list is depleted and it hasn’t found a pool yet. In this case, it self-destructs.

The size of the pools is such that, when enough swimming pools are closed, a sufficient number of moderators is elected. To this purpose the swimming pools are slightly shrunken whenever robots self-destruct (as if those robots had never existed).

-