Skip to content
Tutorials Center
My learning

Topics

Lesson 39 of 44 ยท Projects and Practice

Practice: The Median Voter Simulation

Build and explore the median voter model of Hotelling, Black and Downs: simulate two candidates, play with an interactive slider and see where the model breaks.

One of the most famous ideas in political science is also one of the simplest: in a two-candidate race on a single left-right line, both candidates are pulled toward the median voter, the person in the middle of the distribution of opinion. The idea comes from Harold Hotelling's 1929 model of two sellers choosing locations on a beach, Duncan Black's 1948 work on committee decisions, and Anthony Downs's An Economic Theory of Democracy (1957).

In this project you will build the model, watch candidates converge, play with it interactively and then test its assumptions.

A bell curve of voters along a left to right line with a dashed line at the median voter and two candidates moving toward it
In the simplest model, both candidates move toward the median voter, because the middle decides who wins.

What you will learn

  • The assumptions behind the median voter theorem.
  • How to simulate competition between two candidates.
  • Why the median, not the average, is the key position.
  • Where the model breaks down.

Key terms

Median voter: the voter whose position has half of all voters on each side.

Single-peaked preferences: each voter has one most-preferred position, and likes positions less the farther they are from it.

Best response: the choice that gives a player the best result, given what the other does.

Equilibrium: a situation where no one wants to change their choice alone.

The setup

Voters are spread along a line from 0 (far left) to 1 (far right). Each voter votes for the candidate whose position is closer. Two candidates choose positions, and each wants the largest vote share. If candidate A is at a and candidate B at b, with a < b, the voters split at the midpoint (a + b) / 2: everyone to the left votes for A, everyone to the right for B. Moving toward the middle lets a candidate capture more of the other side without losing their own base, because voters on their own side have nowhere better to go. In equilibrium, both stand at the median.

Step 1: simulate best responses

The program below creates 20,000 simulated voters, starts the candidates far apart, and lets them take turns choosing the best position given the other's. It is a simulation with invented voters, so the numbers illustrate the logic only.

Python Candidates converge on the median

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.

Step 2: explore with sliders

Drag the sliders in the demo below to place the two candidates. The share of voters closer to each is computed from a bell-shaped distribution of opinion centered at 0.5. Try moving one candidate to the middle and the other away.

Interactive: place the candidates

Step 3: median versus mean

The theorem is about the median, not the average. When opinion is skewed, they differ. The snippet below shows that a few extreme voters pull the mean but not the median.

JS Median versus mean

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

No output.

Step 4: stress-test the assumptions

The model rests on strong assumptions, and each failure suggests an extension.

  • One dimension. With two or more issue dimensions, there is generally no stable median position. Charles Plott (1967) and Richard McKelvey (1976) showed that majority-rule outcomes can cycle or wander across the space.
  • Two candidates. With three or more, or with new entrants threatening, convergence breaks.
  • Sincere, fully informed voters who always vote. If voters abstain when no candidate is close to them, candidates have an incentive to keep distance from the center to mobilize their base.
  • Candidates only care about winning. Real candidates and parties often care about policy, and activists constrain them. In primary systems, candidates must first please their party's voters.
  • Valence. Voters also care about competence and character, not only position.

Empirical studies find some pulling toward the center in many systems, but not complete convergence, which is why the theorem is a baseline, not a forecast.

Common misconceptions

"The theorem says candidates always become identical." It predicts convergence under strict assumptions. Real parties differ for the reasons above.

"The median voter is the average voter." Not unless the distribution is symmetric.

"The median voter is a person." It is a position in a distribution that moves when opinion shifts.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. In the one-dimensional model, why do both candidates move toward the middle?

    Each candidate's own supporters have nowhere better to go, so moving toward the middle wins voters from the other side.
  2. 2. Which position do candidates converge on?

    The median voter is the point with half of voters on each side, so the candidate who holds it cannot lose a head-to-head vote.
  3. 3. What did Plott and McKelvey show about multi-dimensional issue spaces?

    With more than one dimension, majority preferences can cycle, so the median-voter equilibrium is generally lost.
  4. 4. Why might candidates avoid the center when turnout is voluntary?

    If voters stay home when they feel no candidate represents them, candidates must keep their distinctive supporters motivated.

Summary

  • With two candidates and one dimension, competition pulls both toward the median voter.
  • The median differs from the mean when opinion is skewed.
  • The model's assumptions fail in many real settings, which is why it is a baseline for thinking, not a prediction.
  • Extensions include more dimensions, abstention, primaries and valence.

Next: Practice: the electoral system lab