Gerrymandering Simulator: How District Lines Change Election Outcomes

simulator intermediate ~10 min
Loading simulation...
Blue 2, Red 2 — fair districts split evenly with 50/50 voters

With default parameters (8x8 grid, 4 districts, 50% blue, fair strategy), districts split proportionally. Switch to pack-blue or pack-red to see how the same voters produce radically different outcomes.

Formula

Efficiency Gap = |wasted_blue - wasted_red| / total_votes
Wasted votes = losing_votes + (winning_votes - (total_in_district/2 + 1))
Seats-vote disparity = |seat_share - vote_share|

The Geometry of Power

Gerrymandering transforms the simple act of drawing lines on a map into a potent political weapon. In this simulation, a grid of voters — colored blue or red — represents a population with fixed preferences. The only variable is how we draw district boundaries. Watch as the same electorate produces completely different election outcomes depending on whether districts are drawn fairly, or strategically packed and cracked to favor one side.

Packing and Cracking

Two techniques drive gerrymandering. Packing concentrates opposition voters into a few districts they win overwhelmingly (say, 90-10), wasting their surplus votes. Cracking splits remaining opposition voters across many districts where they lose narrowly (say, 45-55). The combination means the gerrymandering party wins more districts with fewer total votes — a systematic inversion of democratic proportionality.

The Efficiency Gap

How do we detect gerrymandering mathematically? The efficiency gap, proposed by Stephanopoulos and McGhee, counts 'wasted votes' — votes cast for losing candidates or surplus votes beyond what winners needed. In a fair election, both sides waste roughly equal votes. A large efficiency gap signals that one party's voters are systematically more 'efficient' — the hallmark of gerrymandering. Courts have used this metric in landmark cases like Gill v. Whitford.

Experimenting with Democracy

Use the strategy slider to switch between fair districting, pack-blue, and pack-red configurations. Notice how a party with 50% of the vote can win anywhere from 0 to all seats depending on district lines. The seats-vote disparity quantifies this gap between popular support and political power. This simulation reveals why redistricting reform — through independent commissions, mathematical fairness criteria, or algorithmic approaches — has become one of the most important issues in democratic governance.

FAQ

What is gerrymandering?

Gerrymandering is the practice of drawing electoral district boundaries to give one party an unfair advantage. Named after Governor Elbridge Gerry in 1812, it uses two tactics: 'packing' (concentrating opponents into a few districts they win overwhelmingly) and 'cracking' (spreading opponents across districts so they lose narrowly everywhere).

What is the efficiency gap?

The efficiency gap measures wasted votes — votes for losing candidates or surplus votes beyond what the winner needs. It equals |wasted_blue - wasted_red| / total_votes. A gap above 7-8% is often considered evidence of partisan gerrymandering, as used in Gill v. Whitford (2018).

Can gerrymandering change election outcomes?

Yes. With strategic district drawing, a party with only 40% of the vote can win a majority of seats. This simulation demonstrates exactly this: the same grid of voters produces completely different seat allocations under different district boundaries.

How is gerrymandering detected mathematically?

Several mathematical measures exist: the efficiency gap, the mean-median difference, declination, and ensemble analysis (comparing actual maps to thousands of randomly drawn maps). If the actual map is a statistical outlier, it suggests intentional gerrymandering.

Sources

Embed

<iframe src="https://homo-deus.com/lab/voting-democracy/gerrymandering/embed" width="100%" height="400" frameborder="0"></iframe>
View source on GitHub