STV (Single Transferable Vote) Demonstration

This demo simulates a Single Transferable Vote election on a simplified one-dimensional political spectrum (positions 1–100). Voters are modeled as two normal distributions along that spectrum; each voter ranks all candidates in order of proximity to their own position. STV then fills the available seats through successive rounds of quota-based election and elimination, transferring surplus votes and the votes of eliminated candidates until all seats are filled. There are no tie-break rules: any configuration that produces a tie (in a voter's ranking or in the count) is reported as invalid instead of being resolved. Adjust the distributions and candidate positions below and watch the results update in real time.

Voter Distribution

Combined histogram of all voters across the spectrum. Candidate positions are shown as vertical lines — green with a checkmark if elected, red with an ✗ if eliminated. The dashed purple line marks the median voter and the dashed orange line marks the mean. The numbered teal bands are the seat intervals: one per seat, each holding an equal share of the voters (a Hare quota). A proportional result has one winner in each interval. Drag the blue (D1) or red (D2) handle to adjust that distribution interactively.

Voter Distribution 1

A group of voters centered around a position on the spectrum, modeled as a normal distribution. Adjust the mean (center position), std dev (spread), and approximate number of voters (each position's count is rounded independently so that mirror-image distributions stay exactly symmetric). You can also drag the blue handle on the histogram — left/right changes the mean, up/down changes the spread.

30 12 1000

Voter Distribution 2

A second independent group of voters. Use this to model a bimodal electorate — for example, two ideological blocs of different sizes. Drag the red handle on the histogram to adjust interactively.

70 12 2000

Candidates

Set the number of candidates (up to 26, labeled A–Z) and their positions on the spectrum. Each voter ranks candidates from nearest to farthest. Candidate positions can be adjusted with the sliders or by dragging their vertical lines directly on the histogram. Candidates sit on a 2-unit grid (0.5, 2.5, 4.5, …, 100.5, symmetric about 50.5). Because every pair of candidates is an even distance apart, no voter (at an integer position) is ever exactly halfway between two candidates; two candidates at the same position make the configuration invalid.

4 0
(when unchecked and parties are assigned, voters rank all own-party candidates above any other-party candidate)
1255075100

Election Settings

The number of seats to be filled in this election. The Droop quota — the minimum votes a candidate needs to win a seat — is calculated automatically as ⌊votes / (seats + 1)⌋ + 1. More seats generally leads to more proportional representation.

2

Proportionality

How closely each group's share of the seats matches its share of the voters. Without parties, the groups are the two voter distributions, and each winner counts for the distribution with more voters at the candidate's position (an exact tie splits the seat). With parties, voters are grouped by the dividing lines and winners by their party label. The Gallagher index (√(½ Σ (vote % − seat %)²)) is the standard measure; Loosemore–Hanby (½ Σ |vote % − seat %|) is the percentage of seats held beyond vote share. 0 is perfectly proportional. With few seats some disproportionality is unavoidable, so each is shown against the best achievable with this many seats; the difference is what STV adds. A group is a solid coalition if all its voters rank the same candidates (in any order) above every other; STV guarantees such a group holding k Droop quotas at least k of those candidates.

STV Results

Round-by-round results of the STV count. The ballot progression table shows how each ballot group's votes are used or transferred across rounds. Each subsequent round shows either every candidate who has reached the Droop quota being elected together (their surpluses transferred fractionally and simultaneously) or the lowest candidate being eliminated (their votes redistributed to next preferences). The count uses exact fractions; if two or more candidates are tied for lowest, the configuration is invalid.

Ranked Ballot Distribution

Every distinct ballot ranking that appears in this election and the number of voters who hold it. Candidates a voter is equidistant from are shown joined by “=”; any such tie makes the configuration invalid.

Show ballots
Ranking Voters

Voter Counts by Position

The full breakdown of how many voters from each distribution fall at each integer position on the spectrum. Positions with zero voters are omitted.

Show voter counts
Position Dist 1 Dist 2 Total