Pairwise counting: Difference between revisions

Content added Content deleted
No edit summary
(Cleanup (remove duplicate references). Also clarify write-in handling.)
Line 228: Line 228:
These approaches collect all of the pairwise information for write-in candidates i.e. there would be no change in vote totals if the write-in candidate suddenly became one of the on-ballot candidates.
These approaches collect all of the pairwise information for write-in candidates i.e. there would be no change in vote totals if the write-in candidate suddenly became one of the on-ballot candidates.


* 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).
* 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, give each non-write-in candidate a number of votes against the write-in equal to the number of ballots where that non-write-in candidate was explicitly ranked. Then count the ballot and treat the write-in candidate as a non-write-in candidate from that point onwards (from the perspective of this algorithm).
**When creating a precinct subtotal, also record, for each candidate, how many ballots that candidate was explicitly ranked on.
**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>
**When combining the pairwise vote totals 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 treat all the ballots from the first precinct to rank every explicitly ranked candidate above the write-in: for each candidate in the first precinct, against the write-in in the second, add the number of voters in the first precinct who explicitly ranked that non-write-in candidate. <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 [[Negative vote-counting approach for pairwise counting]] automatically handles write-ins, and requires less markings than the above-mentioned approach when explicit equal-rankings are counted as a vote for both candidates in a matchup.
* The [[Pairwise counting#Negative vote-counting approach|negative vote-counting approach]] automatically handles write-ins, and requires less markings than the above-mentioned approach when explicit equal-rankings are counted as a vote for both candidates in a matchup. However, it requires a post-processing stage to convert the Condorcet matrix into the more familiar form before usage by Condorcet methods.


==Count complexity==
==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).]]
[[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).]]

=== Quicker ways to do pairwise counting ===
Also see the [[Negative vote-counting approach for pairwise counting]].


==== Sequentially examining each rank on a voter's ballot ====
==== Sequentially examining each rank on a voter's ballot ====
Line 248: Line 246:
and so on. In other words, a ballot can be more quickly counted by examining candidates in each of its ranks sequentially from the highest rank on downward. The pairwise 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.
and so on. In other words, a ballot can be more quickly counted by examining candidates in each of its ranks sequentially from the highest rank on downward. The pairwise 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.


A special case of this speedup is to separately record the first preferences of each ballot, as in a [[First_past_the_post]] count. A voter who ranks a candidate X uniquely first must rank X above every other candidate and no other candidate above X, so there's no need to look at Y>X preferences at all.
==== Counting first choices separately ====
For every voter who ranks a candidate as their only 1st choice, because it is known they prefer this candidate over all others, it is possible to speed up the usual pairwise counting procedure by modifying it in the following way:

* Information collected by vote-counters:
*# Count the '''['''number of voters who rank a candidate as their only 1st choice''']'''
*# For those voters' ballots, don't count any preferences in head-to-head matchups involving their unique 1st choice candidate
* Math: Each candidate has as many votes added in favor of them as the '''['''number of ballots that ranked them uniquely 1st''']'''

This can be further generalized to handle ballots that equally rank multiple candidates 1st, but with a caveat; see [[Negative vote-counting approach for pairwise counting#Dealing with equal-ranking]].


===== Uses for first choice information =====
===== Uses for first choice information =====
(This actually collects more information than the usual pairwise approach; specifically, if no voters equally rank candidates 1st, then it is possible to determine who the [[FPTP]] winner is, and further, if it can be determined that there is only one candidate in the [[Dominant mutual third set]], then that candidate is the [[IRV]] winner.)
(This actually collects more information than the usual pairwise approach; specifically, if no voters equally rank candidates 1st, then it is possible to determine who the [[FPTP]] winner is, and further, if it can be determined that there is only one candidate in the [[Dominant mutual third set]], then that candidate is the [[IRV]] winner.)


=== Techniques for when one is collecting both rated and pairwise information ===
== 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:
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"
{| class="wikitable"
Line 310: Line 300:
==References==
==References==
<references />
<references />

==Notes==
<references group="nb" />


[[Category:Majority-related concepts]]
[[Category:Majority-related concepts]]
[[Category:Condorcet-related concepts]]
[[Category:Condorcet-related concepts]]

<references group="nb" />