Pairwise Contests
How Voting Systems Work
Chapter 4 ยท Pairwise Contests
How Voting Systems Work 3 ended with a centre squeeze: Bo, whom most voters preferred to both rivals, was knocked out first because only 32 of 100 ranked Bo first. Both runoff methods looked only at first choices and then at a shrinking field. A different idea is to hold a miniature election for every pair of candidates and look for someone who wins them all. That idea is usually credited to the Marquis de Condorcet, an eighteenth-century French mathematician, and the candidate it describes is called the Condorcet winner. This chapter builds the table of all the pairwise results in Python, shows how the idea can break in a circle, and then looks at two ways of picking a winner anyway: Copeland and Minimax. The maths is counting and comparing two numbers.
Head-to-Head Contests
Suppose every voter has ranked all the candidates. For any two candidates, say Ana and Bo, you can count how many ballots put Ana above Bo and how many put Bo above Ana. Whoever has more wins that pair. Do this for every pair and you have a pairwise matrix: a grid whose entry in row X and column Y is the number of ballots ranking X above Y. A candidate who wins against every other candidate, by more than half the ballots, is the Condorcet winner. If the ballots are complete and there are no ties, the entry in row X column Y and the entry in row Y column X add up to the number of ballots, so you only ever need to compare one of the two to half the total.
Here is the centre-squeeze profile from the last chapter, with the matrix built from scratch. Each cell is one line of counting, which is the whole method; everything else in this chapter is about what to do with the grid.
Read row Bo: 65 ballots rank Bo above Ana and 67 rank Bo above Cy, both more than half of 100. Bo wins both pairs and is the Condorcet winner, though Bo came second on first choices. Neither runoff rule found Bo. A rule that always elects the Condorcet winner when one exists is called a Condorcet method (the term appears in the sources I found, which also use “Condorcet-consistent” for the same idea: check the exact wording before relying on either).
When There Is No Winner
Now the awkward part. Majorities between pairs need not line up. Take three equal groups of voters whose rankings are rotations of each other: one group says Ann, then Ben, then Cat; the next says Ben, then Cat, then Ann; the last says Cat, then Ann, then Ben. Every pair has a two-thirds majority in favour of one candidate, and yet the candidates beat one another in a circle.
Ann beats Ben 20 to 10, Ben beats Cat 20 to 10, and Cat beats Ann 20 to 10. No candidate wins all their contests, so there is no Condorcet winner. This is the Condorcet paradox, also called a Condorcet cycle: each individual voter has a sensible ranking, but the majority taken as a whole does not. The sources I found all describe cycles as the reason a Condorcet method needs a fallback rule for when none exists.
| Feature | Plurality or runoff counts | Pairwise matrix |
|---|---|---|
| Looks at | first choices, then a shrinking field | every pair of candidates, using the whole ranking |
| Always gives a winner | yes (apart from ties) | no, a cycle can leave nobody undefeated |
| Finds the centre-squeeze winner | no (How Voting Systems Work 3) | yes, if that candidate beats everyone |
| Work to count | one pass over the ballots | one pass per pair: with k candidates, k(k-1)/2 pairs |
Two Ways to Break a Cycle
The sources I found list many ways to choose a winner when there is a cycle, including Schulze, Ranked Pairs, Kemeny-Young, Copeland and Minimax. We take the two simplest to code.
Copeland scores each candidate by pairwise wins minus pairwise losses and elects the highest score. The summaries I read say it often ends in a tie when there is a cycle, and that critics object that it counts the number of wins and losses without looking at how big the margins were. Minimax (the sources also call it Simpson or Simpson-Kramer) looks at each candidate’s worst defeat and elects the candidate whose worst defeat is smallest. One page lists several Minimax variants (winning votes, margins, opposition) and says the opposition variant is not a Condorcet method; the pages disagree on whether “Minimax” as a whole is Condorcet-consistent, so the variant matters (conflict between sources: I did not resolve it). The code below uses the winning-votes version, and I have not proved here that it always elects a Condorcet winner when there is one.
The profile below is invented, found by a seeded random search for a case where the two methods disagree. Ana and Cy tie 12 to 12, and everyone else is in a loop of results.
Ana beats Bo, Bo beats Di, Di beats Ana: a cycle, and Cy ties with Ana. Copeland gives Bo +1 (two wins, one loss), Ana 0, Cy 0 and Di -1, so Bo wins. Minimax asks about worst defeats: Bo’s worst is the 17 to 7 loss to Ana, which is larger than Ana’s worst, a 14 to 10 loss to Di, so Ana wins. Two reasonable pairwise rules, two different winners, from the same twenty-four ballots. The honest summary is that when there is a cycle there is no single correct answer: the rule is a choice about what to value, in this case a count of victories against the size of the worst loss.
How common are cycles?
Cycles sound exotic. Whether they matter depends on how voters are spread. The simulation below uses two assumed models, with 101 voters and 2,000 elections per row. In the “line” model, used in the last two chapters, voters and candidates sit at random points on a line and rank by distance. In the “random ballots” model every ballot is an independent random ranking, which has no political structure at all.
On the line there are no cycles in these runs. That fits the earlier claim that a Condorcet winner exists with an odd number of voters on a line (I did not look up a proof). With random ballots cycles grow quickly with the field: 8.5%, 17.7% and 25.9% for three, four and five candidates. Neither model is real. The first has too little disagreement and the second too much, so real cycles are somewhere in between, and how often is a question for data, not for this simulation. A commonly quoted limit of about 8.8% for three candidates under random ballots is from memory (check).
Twenty-five members rank five candidates (assumed numbers). Build and print the pairwise matrix, say whether a Condorcet winner exists, and compare that winner with the candidate who has the most first choices.
๐ View solutionThree groups of 12, 9 and 6 voters have rotated rankings of Ann, Ben and Cat (assumed numbers). Print every pairwise result, then compute the Copeland scores and the Minimax worst defeats. What does each method do with the cycle?
๐ View solutionGenerate 5,000 seeded random profiles of four candidates (five groups of two to eight voters each). Count how many have no Condorcet winner and, among those, how many give a single Copeland winner that differs from the single Minimax winner.
๐ View solutionQuick Reference
- Pairwise matrix: entry (X, Y) = number of ballots ranking X above Y
- Condorcet winner: beats every other candidate head to head by more than half the ballots
- Condorcet cycle: A beats B, B beats C, C beats A, so there may be no Condorcet winner
- Copeland: score = pairwise wins minus losses; highest score wins; ties are common in cycles
- Minimax: smallest worst defeat wins; say which version (winning votes, margins, opposition)
- Python habit: build the pairwise dictionary once, then compute every method from it
- Always state: how pairwise ties are scored, and which variant of a method you used