Skip to content
Tutorials Center
My learning

Topics

Lesson 40 of 44 · Projects and Practice

Practice: The Electoral System Lab

Run the same hypothetical election under plurality, D'Hondt and Sainte-Laguë rules, measure disproportionality and effective parties, and test thresholds.

In this project you act as an election analyst. You are given one electorate, and you will run it through three sets of rules to see how much the rules matter. Nothing about the voters changes between runs, so every difference in the outcome is due to the rule alone.

Three cards: one electorate, three rules and three measures
The lab keeps the ballots fixed and changes only the rule, then compares seat shares, the Gallagher index and the effective number of parties.

What you will learn

  • How to implement plurality and divisor formulas in code.
  • How to compare outcomes with the Gallagher index and the effective number of parties.
  • How thresholds change who is represented.

Key terms

Plurality by district: each district elects one member, the candidate with the most votes.

List PR: seats are shared among party lists according to a formula.

Gallagher index: a measure of the gap between vote shares and seat shares.

Wasted votes: votes that do not help elect anyone.

The data

Six districts, 100 votes each (so numbers are also percentages), three parties. The data are invented for this exercise.

District A B C
1 52 33 15
2 48 30 22
3 45 35 20
4 38 40 22
5 30 20 50
6 36 24 40

Totals: A has 249 votes, B 182 and C 169, so the national vote shares are about 41.5, 30.3 and 28.2 percent. Under plurality, A wins districts 1 to 3, B wins district 4, and C wins districts 5 and 6, which is three, one and two seats.

Step 1: run the lab

The program applies three rules: plurality by district, D'Hondt with a single national list, and Sainte-Laguë with a single national list. Each has six seats in total. It then prints the seat shares and two measures.

Python Same votes, three rules

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Look at the output. With these invented numbers, plurality gives party A half the seats with 41.5 percent of the votes, while both proportional formulas give each party a third. The Gallagher index is higher for plurality, and the effective number of parties changes with the rule.

Step 2: test a threshold

Many list-PR systems exclude parties below a minimum national vote share. This calculator uses hypothetical shares to show how many votes end up unrepresented, a rough measure of wasted votes, as the threshold moves.

JS Thresholds and wasted votes

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Higher thresholds reduce fragmentation but increase the share of voters left unrepresented. The right balance is a value judgment, and many countries set thresholds somewhere between about 2 and 5 percent.

Step 3: your tasks

Change the data and the rules, and answer these questions in your own words.

  1. Edit the district numbers so that party A has the most votes nationally but wins fewer seats under plurality than party C. What pattern of districts makes this possible?
  2. Add a fourth party with 5 votes in every district. What happens to its seats under plurality and under PR? Does the effective number of parties change?
  3. Change seats_total for the PR rules to 12. Do D'Hondt and Sainte-Laguë still agree?
  4. Write a one-paragraph recommendation: for a country with deep regional divisions, which rule would you recommend and why? Name one cost of your choice.

Common misconceptions

"A rule that gives the 'right' seats exists." Each rule expresses a value: local accountability, proportionality, or stable majorities.

"Proportional rules always eliminate wasted votes." Thresholds and small districts still waste votes.

"This lab predicts real elections." Real voters change their behavior under different rules, so ballots would not stay fixed in practice.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. In this lab, what is deliberately held constant while rules change?

    Holding the ballots fixed isolates the effect of the rule.
  2. 2. What would a Gallagher index of zero mean for a rule?

    The index is zero only for perfect proportionality.
  3. 3. What is the trade-off of a high threshold?

    Thresholds keep tiny parties out but waste the votes cast for them.
  4. 4. Why is it risky to treat the lab as a forecast?

    Strategic voting and party strategy change under different rules, so fixed ballots are only a thought experiment.

Summary

  • Holding ballots fixed isolates the effect of electoral rules.
  • Plurality can favor the largest or best-distributed party; proportional formulas track vote shares more closely.
  • Thresholds trade fragmentation against representation.
  • Rule choice expresses values, and real behavior adapts to rules.

Next: Practice: designing a comparative case study