# Negative vote-counting approach for pairwise counting

As an example, suppose there are 10 candidates, and a voter votes A>B. In the usual pairwise counting approach, 9 markings are made to indicate A’s dominance over 9 other candidates on this voter’s ballot, and likewise 8 for B. But note that because A is this voter’s 1st choice, we could’ve simply said “A is 1 voter’s 1st choice”, and then at the central vote-counting place, they can simply “unpack” this to put 1 vote in every matchup A has against other candidates. Note that this naturally allows you to handle write-in candidates.

This approach can be generalized to handle 2nd choices as well: ignoring A, B is this voter’s 1st choice. So the same trick can be applied to B. To prevent A and B from simultaneously getting votes against each other in the A vs B matchup, the precinct vote-counters can put a “negative vote” in the B>A side of the matchup. When the central vote-counters unpack B’s 1st choice support, this will result in the negative vote and the 1st choice support cancelling each other out, leaving only 1 vote for A>B and 0 for B>A. Note that this only required 3 markings, as opposed to 17.

A small issue is if the voter votes A=B; this could mean 1 vote is added to both A>B and B>A, resulting in no change in the margin between the two candidates (good) but a change in the “winning votes” totals for each candidate (potentially bad). So if you want perfectly accurate vote totals, you have to subtract one vote on both sides of this matchup, either by manually putting a negative vote for both sides (2 markings), or making some special marking which indicates the same (1 marking).

Hi AVA, this is an interestiing idea, though as noted in your electowiki write-up, it is more beneficial when there are many candidates and ballots generally rank only a few. When most ballots rank most candidates, the work is similar, because you have to keep as many negative pairwise votes looking upward in the ranking as you have looking downward in the ranking with the standard scheme. And in fact, if accurate count is required, an additional ranked-above-bottom-and-tied pairwise array would be required.

Regarding write-in candidates, I think the extra ranking work would be similar – in practice, only approval of a write-in would be noted to avoid having to add row/columns to the pairwise array as the precinct count was proceeding, then a recount would be held once all write-ins were found and one of them had approval over some threshold.

However, I think the idea has definite merit, and my own opinion is that voters will likely rate fewer than the entire range of candidates and there would be some cost savings. I also am interested in methods that keep track of tied above-bottom rankings as well.

In fact, if you combine the two approaches, I think you can get roughly a halving of the number of marks required to count ballots that sequentially rank every candidate. This is because when, say, a voter ranks a candidate one rank above last, that can be counted with one positive pairwise vote for that candidate against the last-place candidate, rather than negative pairwise votes against every candidate other than these two along with the mark to indicate that this candidate is ranked by the voter.

In fact, if you combine the two approaches, I think you can get roughly a halving of the number of marks required to count ballots that sequentially rank every candidate. This is because when, say, a voter ranks a candidate one rank above last, that can be counted with one positive pairwise vote for that candidate against the last-place candidate, rather than negative pairwise votes against every candidate other than these two along with the mark to indicate that this candidate is ranked by the voter.

If I understand you correctly, you’re saying to accumulate two pairwise arrays:

Negative preference array for scores in the top half of the ranking, plus positive preference array for scores in the bottom half of the ranking.

And you still have to include a Ties array for equal ranking above last.

This is still a lot of complexity per ballot. In my own codes, the pairwise update is easily done using a matrix outer product. I guess you’re looking to make hand-counting easier?

1 Like

I’m not sure what you mean by “accumulate”, but I do want to mention that both the arrays can be combined into one. This is because the negative preference array can be thought of as negative votes that can be added to the positive votes from the positive preference array. So, for example, if you’re told 1 voter ranked A and ranked A below B, while another ranked A>B, then in the pairwise array you put (1-1)=0 votes for A>B, and then you give 1 vote to A>B because 1 voter ranked A.

Something I hadn’t even realized: this “semi-negative” counting procedure would slightly reduce the amount of work you’d have to do to count equal-ranking voters from the negative counting procedure. This is because if, for example, the voter ranks all of 10 candidates but equally ranks 3 of them 5th, then rather than count 4+1=5 marks for each 5th-ranked candidate (they’re each ranked below 4 candidates and they are ranked by 1 voter) plus 3 marks overall for the 3 equal-ranked matchups, you can just count 3 marks, since each of them is ranked above 3 candidates.

How about an example or two?

Say we have ten candidates:

Ballot 1: A > B > C > D (E through J equal last)
Ballot 2: A = B > C = D > E > F ( G through J equal last)
Ballot 3: A > B = C = D > E > F > G = H > I (J last)

What would each update look like, then how would the resulting negative preference array get turned into a standard pairwise update?

Question for @Antagonist: is there a way to natively edit and create tables and matrices on this forum, or to enable that? That’d be useful for discussing pairwise/Condorcet information. Currently I’m just using Electowiki’s Visual Editor to create the tables, and then copy/pasting them here.

@Ted_Stern, I’ll do these examples using the semi-negative procedure (combining negative and regular pairwise counting to halve the work), which I think is what you wanted me to show. I’ll also, for simplicity, put negative votes on both sides of an equal-ranked matchup, even though the faster ways involve either not doing this at all, or creating a separate array (i.e. if 5 voters equally ranked A and B, then you can count that with 5 marks and then manually remove 5 votes from both sides of their matchup afterwards).

So this would become (cutting out the rows and columns of the equal-last candidates to save space):

A B C D
A 1 b
B -1 1 b
C -1 -1 1 b
D -1 -1 -1 1 b

(I write “1 b” to mean “This candidate was ranked on 1 ballot”).

This on its own would be (here I’ll cut out the rows but not the columns of G through J):

A B C D E F G H I J
A 1 b -1
B -1 1 b
C -1 -1 1 b -1
D -1 -1 -1 1 b
E -1 -1 -1 -1 1 b
F -1 -1 -1 -1 -1 1 b 1 1 1 1

Notice F’s row; it’s faster to count the fact that F is ranked above 4 candidates (the bolded numbers), than to count the fact they’re ranked below 5 candidates (plus the fact that they’re ranked at all). So only the bolded values get counted in that row for this example.

Adding Ballot 1 and 2’s matrices together yields:

A B C D E F G H I J
A 2 b -1
B -2 2 b
C -2 -2 2 b -1
D -2 -2 -2 2 b
E -1 -1 -1 -1 1 b
F 0 b 1 1 1 1
G
H
I
J

(I’ve removed the previously italicized values for F’s row, and explicitly mentioned that we’re pretending they aren’t ranked on any ballots by putting 0 b for their row, to avoid confusion going forward. This ensures that later on, instead of giving F an additional vote for being ranked on 1 ballot, which would mean giving Ballot 2 a “double vote”, F only gets the 1 vote we already counted them as getting).

On its own:

A B C D E F G H I J
A 1 b
B -1 1 b -1 -1
C -1 -1 1 b -1
D -1 -1 -1 1 b
E -1 -1 -1 -1 1 b
F 1 1 1 1
G 1 1
H 1 1
I 1
J

Added to Ballots 1 and 2:

A B C D E F G H I J
A 3 b -1
B -3 3 b -1 -1
C -3 -3 3 b -2
D -3 -3 -3 3 b
E -2 -2 -2 -2 2 b
F 2 2 2 2
G 1 1
H 1 1
I 1

Now that we have counted all 3 ballots, we apply the calculation step to find the final matrix from this one (Example of calculation step shown in some rows as italicized and small):

A B C D E F G H I J
A 2 (3 b-1) 3 3 3 3 3 3 3 3
B 0 2 2 3 (3 b-0) 3 3 3 3 3
C 0 0 1 3 3 3 3 3 3
D 0 0 0 3 3 3 3 3 3
E 0 0 0 0 2 2 2 2 2
F 2 2 2 2
G 1 1
H 1 1
I 1
J

Hopefully I understood your request for an example properly, if not let me know.

1 Like

Ok, I get it now. For top half counts, you do ballot counts on diagonal and below top offsets (negative values) off diagonal. For bottom half counts, you do straightforward pairwise with no on-diagonal counts. This yields a large memory-update savings for truncated ballots, and at worst one-quarter of the work (because the lower right triangle is one quarter of the total upper triangle) with no equal-ranking for fully-ranked ballots.

The one tricky area here is figuring out when to start doing explicit pairwise. I guess you count all candidates, and do normal positive vote counting once the number of higher ranked candidates exceeds half the total candidate count.

Seems like write-ins still are a little tricky, though.

How so? I’d think that you’d just add them to the matrix when you find them, and at the end you’ll get an accurate count for their matchups, since you recorded how many voters ranked the non-write-in candidates and whatnot.

The only part that is off is that, since we don’t count how many voters ranked a candidate in the regular pairwise counting approach, we wouldn’t be able to determine that a voter prefers, say, their 3rd choice out of 5 candidates over every write-in candidate. To illustrate this with the semi-negative procedure, with W1 and W2 being write-in candidates, W2 not having been added to the matrix yet (ignore the small italicized values for now):
Ballot 1: W1>A>B>C>D>E

A B C D E W1 W2
A 1 -1
B -1 1 -1
C 1l 1 1 -1
D 1l 1 -1
E 1l -1
W1 1
W2

If we convert this to the final matrix:

A B C D E W1 W2
A 1 1 1 1 1
B 1 1 1 1 1
C 1 1
D 1
E
W1 1 1 1 1 1 1
W2

So, because W2 hadn’t been discovered by the time this ballot was counted, the vote-counters couldn’t have recorded the voter’s preference for C, D, and E over W2. To rectify this, I’d suggest creating a separate count of how many voters rank a candidate above every write-in candidate; in the above matrices, this value is counted as “1l”. Note that, because this particular voter ranked one of the write-in candidates above C, D, and E, that we actually had to record a negative vote for C, D, and E against that candidate, to avoid them getting a vote against W1 later on.
Doing this separate count means making at most 2 additional marks for every candidate counted using the regular pairwise approach; most voting implementations only allow the voter to write-in one candidate, so there can be at most one write-in ranked above or equal to these candidates, along with the one mark counted to show that they’re preferred over every write-in.

I think you’ve done a great job with tables!
Is that what you intended?