The Mathematics of Voting Systems
Different voting rules extract and weigh information from a ranked ballot in fundamentally different ways. When voters submit a ranked ballot, they provide a complete preference order from first to last choice. However, traditional voting systems often discard most of this information.
By analyzing a single set of preferences through multiple mathematical lenses, we can observe how different aggregation rules alter the collective choice. The five methods compared here represent distinct philosophies of social choice theory:
- Plurality: This method looks exclusively at the top preference of each ballot. It ignores all lower-ranking preferences, meaning a candidate can win even if they are deeply disliked by a majority of the electorate, provided they hold the largest single bloc of first-choice votes.
- Instant Runoff (IRV): This system processes ballots in sequential rounds. If no candidate holds an absolute majority of active first-choice votes, the candidate with the fewest top-preference votes is eliminated. Their votes are then transferred to the next active candidate listed on those ballots. This process repeats until a candidate achieves a majority.
- Borda Count: A positional voting method that assigns a graduated point value to every position on a ballot. For m candidates, a first-choice vote receives m - 1 points, a second-choice receives m - 2 points, and so on, down to 0 points for the last choice. The candidate with the highest cumulative point total wins.
- Approval: This method measures broad acceptability by counting how many times a candidate appears within a voter's top tier of preferences. It treats all candidates ranked above a specific cutoff as approved, and all those below it as disapproved.
- Copeland / Pairwise: A round-robin tournament approach that evaluates candidates in head-to-head matchups. For every possible pair of candidates, the method counts how many voters ranked one above the other. The candidate who wins the matchup receives 1 point, while a tie yields 0.5 points.
Input Specifications and Validation Rules
To ensure mathematical consistency and computational stability, the comparator enforces strict validation rules on all inputs. The tool processes two primary inputs: a candidate list and a set of grouped ranked ballots.
Candidate Constraints
The candidate input field requires between 2 and 8 candidates, entered with one unique candidate per line. Each candidate name must be 40 characters or fewer and cannot contain a colon (:) or a greater-than sign (>). Names must be unique, including differences in capitalization. If these rules are violated, the tool displays specific errors:
- "Use between 2 and 8 candidates."
- "Keep each candidate name to 40 characters or fewer."
- "Candidate names cannot contain a colon or greater-than sign."
- "Candidate names must be unique, including differences in capitalization."
Ballot Formatting
Ballots must be entered as grouped lines to represent identical voting patterns efficiently. The input is limited to a maximum of 200 grouped ballot lines, and the combined vote count across all ballots must be 10,000,000 or fewer. Each line must follow the format of a vote count, a colon, and then every candidate ranked from first to last choice, separated by a greater-than sign. For example, a valid line is "45: Cedar > Harbor > Summit".
Every ballot line must rank every candidate exactly once; incomplete rankings, skipped ranks, or ranking the same candidate more than once on a single line are not permitted. The tool validates these inputs using the following error messages:
- "Enter at least two candidates before adding ballots."
- "Enter at least one grouped ranked ballot."
- "Use no more than 200 grouped ballot lines."
- "Line
1must look like “45: Cedar > Harbor > Summit”." - "Line
1needs a whole-number vote count before the colon." - "Line
1must contain between 1 and 1,000,000 votes." - "Line
1contains a name that is not in the candidate list." - "Line
1ranks the same candidate more than once." - "Line
1must rank every candidate exactly once." - "Keep the combined vote count at or below 10,000,000."
Defining Approval in a Ranked System
Approval voting does not natively use ranked ballots; instead, it asks voters to select which candidates they find acceptable. To compare approval voting alongside ranked methods, the tool translates ranked preferences into approval data using an arbitrary cutoff.
The user selects an approval cutoff, which must be a value between 1 and the total number of candidates. If the cutoff is set to "Top 2", any candidate ranked at or above that position on a ballot receives one approval vote from that ballot. If the selection is invalid, the tool displays the error: "Choose an approval cutoff between 1 and the number of candidates."
Anatomy of an IRV Elimination and Tie-Breaking
The instant runoff (IRV) method operates through sequential rounds of elimination. In each round, the tool calculates the active first-choice votes for all remaining candidates. If a candidate reaches an absolute majority of the active votes, they are declared the winner.
If no candidate has a majority, the tool identifies the candidate with the unique lowest number of first-choice votes and eliminates them. Their votes are then transferred to the next-ranked active candidate on those ballots.
A critical edge case occurs when there is an unresolved tie for the lowest-place candidate during an elimination round. Because the tool uses a strict stop-on-tie IRV rule, it does not attempt to break ties using secondary metrics. Instead, the elimination process stops immediately, and the tool displays the error: "Unresolved elimination tie: Cedar, Harbor".
The Condorcet Criterion and Pairwise Matchups
A central concept in voting theory is the Condorcet criterion, which states that if a candidate wins a head-to-head matchup against every other candidate, that candidate should win the election. Such a candidate is called a Condorcet winner.
The head-to-head matrix displays the pairwise counts, showing the number of voters who rank the row candidate above the column candidate. Below the matrix, a note indicates whether a Condorcet winner exists:
- If a candidate beats every opponent head to head, the tool displays: "Also beats every opponent head to head".
- If preferences form a cycle (for example, Candidate A beats B, B beats C, and C beats A), no Condorcet winner exists. In this case, the tool displays: "No candidate beats every opponent head to head."
The Copeland method resolves these scenarios by assigning points based on these pairwise matchups, ensuring a structured score even when a pure Condorcet winner is absent.
Formulas and Variables
The mathematical calculations for each method are defined by the following formulas and variables:
Variables
- c — the candidate being counted
- b — one grouped ballot; count_b is its number of voters
- m — number of candidates
- rank_b(c) — candidate c’s position on ballot b, starting at 1
- k — the approval cutoff selected
- V — active votes in the current IRV round; $V(c)$ is candidate c’s active total
- $W(c)$ and $T(c)$ — candidate c’s pairwise wins and ties
Formulas
- Plurality: P(c) = Σ count_b · 1[first_b = c]
- Borda count: B(c) = Σ count_b · (m - rank_b(c))
- Approval: A(c) = Σ count_b · 1[rank_b(c) ≤ k]
- Copeland: C(c) = W(c) + 0.5 × T(c)
- Instant runoff (IRV) majority threshold: V(c) > V ÷ 2
Local Processing and Privacy
All calculations are performed locally within the user's web browser. Candidate names, ballot counts, and rankings are processed entirely on your local device. No input data is uploaded to an external server, transmitted over the network, or saved.
Frequently Asked Questions
Can the same ranked ballots really produce different winners? Yes. Each rule uses different information: plurality keeps only first choices, Borda uses every rank, IRV transfers votes after eliminations, and pairwise counting compares candidates two at a time. The worked example is designed so those differences are visible and traceable.
How can approval voting be compared with ranked ballots? A ranked ballot does not say where approval ends. This tool therefore uses the cutoff you choose: top 1, top 2, and so on. That assumption applies only to the approval column and is printed beside its result.
Is the Copeland winner always a Condorcet winner? No. A Condorcet winner must beat every opponent head to head, and one may not exist because preferences can form a cycle. Copeland still assigns points for pairwise wins and ties; its highest score is reported separately and may be tied.
Can I use this to certify an official election result? No. This comparator uses complete strict rankings, one seat, and a stop-on-tie IRV rule. Election laws and organization rules may define overvotes, skipped ranks, write-ins, tie-breaking, audits and multi-seat transfers differently.