Pairwise counting: Difference between revisions

no edit summary
No edit summary
Line 22:
 
If the number of voters who have no preference between two candidates is not supplied, it can be calculated using the supplied numbers. Specifically, start with the total number of voters in the election, then subtract the number of voters who prefer the first over the second, and then subtract the number of voters who prefer the second over the first.
 
In general, for N candidates, there are 0.5*N*(N-1) pairwise matchups. For example, for 2 candidates there is one matchup, for 3 candidates there are 3 matchups, for 4 candidates there are 6 matchups, for 5 candidates there are 10 matchups, for 6 candidates there are 15 matchups, and for 7 candidates there are 21 matchups.
 
These counts can be arranged in a ''pairwise comparison matrix''<ref name=":0">{{Cite book|url=https://books.google.com/?id=q2U8jd2AJkEC&lpg=PA6&pg=PA6|title=Democracy defended|last=Mackie, Gerry.|date=2003|publisher=Cambridge University Press|isbn=0511062648|location=Cambridge, UK|pages=6|oclc=252507400}}</ref> or ''outranking matrix<ref>{{Cite journal|title=On the Relevance of Theoretical Results to Voting System Choice|url=http://link.springer.com/10.1007/978-3-642-20441-8_10|publisher=Springer Berlin Heidelberg|work=Electoral Systems|date=2012|access-date=2020-01-16|isbn=978-3-642-20440-1|pages=255–274|doi=10.1007/978-3-642-20441-8_10|first=Hannu|last=Nurmi|editor-first=Dan S.|editor-last=Felsenthal|editor2-first=Moshé|editor2-last=Machover}}</ref>'' table (though it could simply be called the "candidate head-to-head matchup table") such as below.
Line 52 ⟶ 50:
Note that since a candidate can't be pairwise compared to themselves (for example candidate A can't be compared to candidate A), the cell that indicates this comparison is always empty.
 
In general, for N candidates, there are 0.5*N*(N-1) pairwise matchups. For example, for 2 candidates there is one matchup, for 3 candidates there are 3 matchups, for 4 candidates there are 6 matchups, for 5 candidates there are 10 matchups, for 6 candidates there are 15 matchups, and for 7 candidates there are 21 matchups.
To identify which candidate wins a specific pairwise matchup, such as between candidates A and B, subtract the value of B>A from A>B. If the resulting value is positive, then candidate A won the matchup. If it is zero, then there is a pairwise tie. If the result is negative, then candidate B won the matchup. (See the [[Pairwise counting#Terminology|Terminology]] section for details.)
 
Sometimes only the "dominance relation" (wins, losses, and ties) is shown, rather than the exact numbers. So for example, if A beat B in their pairwise matchup, it'd be possible to write "Win" (or a green checkmark) in the A>B cell and "Loss" (or a red X) in the B>A cell.
 
=== Example with numbers ===
Line 150 ⟶ 146:
Suppose there are five candidates A, B, C, D and E.
 
==== Ranked ballots ====
Using ranked ballots, suppose two voters submit the ranked ballots A>B>C, which means they prefer A over B, B over C, and A over C, with all three of these ranked candidates being preferred over either D or E. This assumes that unranked candidates are ranked equally last.
 
==== Rated ballots ====
Now suppose the same two voters submit [[Rated voting|rated ballots]] of A:5 B:4 C:3, which means A is given a score of 5, B a score of 4, and C a score of 3, with D and E left blank. Pairwise preferences can be inferred from these ballots. Specifically A is scored higher than B, and B is scored higher than C. It is known that these ballots indicate that A is preferred over B, B over C, and A over C. If blank scores are assumed to mean the lowest score, which is usually a 0, then A and B and C are preferred over D and E.
 
Line 201 ⟶ 199:
([https://star.vote star.vote] offers the ability to see the pairwise matrix based off of rated ballots.)
 
==== Choose-one and Approval ballots ====
Pairwise counting also can technically be done using [[Choose-one voting]] ballots and [[Approval voting]] ballots (by giving one vote to the marked candidate in a matchup where only one of the two candidates was marked), but such ballots do not supply information to indicate that the voter prefers their 1st choice over their 2nd choice, that the voter prefers their 2nd choice over their 3rd choice, and so on.
 
==== Dealing with unmarked/last-place candidates ====
Note that when a candidate is unmarked it is generally treated as if the voter has no preference between the unmarked candidates. When the voter has no preference between certain candidates, which can also be seen by checking if the voter ranks/scores/marks multiple candidates in the same way (i.e. they say two candidates are both their 1st choice, or are both scored a 4 out of 5), then it is treated as if the voter wouldn't give a vote to any of those candidates in their matchups against each other.
 
Line 209:
A comprehensive approach is to, in each [[precinct]], count the number of ballots that explicitly rank each (non-write-in) candidate. When a write-in candidate is found on a ballot, then before that ballot is counted, the number of votes each non-write-in candidate gets against the write-in candidate is the number of ballots they were so far ranked on. The ballot is then counted, and the write-in candidate is treated as a non-write-in candidate from that point onwards (from the perspective of this algorithm). When the pairwise vote totals are summed up from each precinct, then if in one precinct a write-in candidate wasn't marked by any voters but in another they were, then similarly the number of votes each candidate in the first precinct is treated as getting against the write-in candidate are the number of ballots that ranked them in the first precinct. <ref>{{Cite web|url=https://electowiki.org/wiki/Talk:Condorcet_method|title=Condorcet method|date=2020-05-14|website=Electowiki|language=en|access-date=2020-05-14}}</ref><ref>{{Cite web|url=https://www.reddit.com/r/EndFPTP/comments/fsa4np/possible_solution_to_the_condorcet_writein_problem/fm7bgpd|title=r/EndFPTP - Comment by u/ASetOfCondors on ”Possible solution to the Condorcet write-in problem”|website=reddit|language=en-US|access-date=2020-05-14}}</ref>
 
The below-discussed negative counting approach automatically handles write-ins, and requires less markings than the above-mentioned approach when equal-rankings are counted as a vote for both candidates in a matchup.
 
==Notes==
[[File:Pairwise counting table with links between matchups.png|thumb|444x444px|Green arrows point from the loser of the matchup to the winner. Yellow arrows indicate a tie. Red arrows (not shown here) indicate the opposite of green arrows (i.e. who lost the matchup).For example, the B>A matchup points to A>B with a green arrow because A pairwise beats B (head-to-head).]]Pairwise counting can be used to tally the results of [[Choose-one voting]], [[Approval voting]], and [[Score voting]]; in these methods, a voter is interpreted as giving a degree of support to each candidate in a matchup, which can be reflected either using margins or (in the case of Score) the voter's support for both candidates in the matchup. See [[Rated pairwise preference ballot#Margins%20and%20winning%20votes%20approaches|rated pairwise preference ballot#Margins and winning votes approaches]] for an example.
 
=== Quicker ways to do pairwise counting ===
The naive way of counting pairwise preferences implies determining, for each pair of candidates, and for each voter, if that voter prefers the first candidate of the pair to the second or vice versa. This requires looking at ballots <math>O(Vc^2)</math> times. If reading a ballot takes a lot of time, it's possible to reduce the number of times a ballot has to be consulted by noting that if a voter ranks X first, he prefers X to everybody else; if he ranks Y second, he prefers Y to everybody but X, and so on. The Condorcet matrix still has to be updated <math>O(Vc^2)</math> times, but a ballot only has to be consulted <math>Vc</math> times at most. If the voters only rank a few preferences, that further reduces the counting time.
Also see the negative vote-counting approach below, which can be quicker than the regular approach depending on how it's implemented.
 
==== Sequentially examining each rank on a voter's ballot ====
The naive way of counting pairwise preferences implies determining, for each pair of candidates, and for each voter, if that voter prefers the first candidate of the pair to the second or vice versa. This requires looking at ballots <math>O(Vc^2)</math> times. If reading a ballot takes a lot of time, it's possible to reduce the number of times a ballot has to be consulted by noting that if a voter ranks X first, he prefers X to everybody else; if he ranks Y second, he prefers Y to everybody but X, and so on. The Condorcet matrix still has to be updated <math>O(Vc^2)</math> times, but a ballot only has to be consulted <math>Vc</math> times at most. If the voters only rank a few preferences, that further reduces the counting time.
 
=== Techniques for when one is collecting both rated and pairwise information ===
If using pairwise counting for a [[rated method]], one helpful trick is to put the rated information for each candidate in the cell where each candidate is compared to themselves. For example, if A has 50 points (based on a [[Score voting]] ballot), B has 35 points, and C has 20, then this can be represented as:
{| class="wikitable"
Line 241 ⟶ 246:
This reduces the amount of space required to store and demonstrate all of the relevant information for calculating the result of the voting method.
 
=== Pairwise counting used in unorthodox contexts ===
== Election examples ==
Pairwise counting can be used to tally the results of [[Choose-one voting]], [[Approval voting]], and [[Score voting]]; in these methods, a voter is interpreted as giving a degree of support to each candidate in a matchup, which can be reflected either using margins or (in the case of Score) the voter's support for both candidates in the matchup. See [[rated pairwise preference ballot#Margins and winning votes approaches]] for an example.
 
=== Defunct sections ===
 
==== Election examples ====
See [[Pairwise preference#Election examples]]
 
====Terminology ====
See [[Pairwise preference#Definitions]].
 
====Condorcet====
See [[Pairwise preference#Condorcet]].
 
====Cardinal methods ====
See [[Pairwise preference#Strength of preference]] and [[rated pairwise preference ballot]].