Gerrymandering, Explained
After reading this you can measure how far a district map bends an election away from the popular vote, compute an efficiency gap by hand, and spot the two moves (packing and cracking) that every gerrymander is built from.
What the sandbox shows
Take a state where 60% of voters back party A and 40% back party B. Split it into 10 districts of equal size. A fair result would give A roughly 6 seats. But the seat count depends entirely on where you draw the lines, and the same voters can hand A anywhere from 4 seats to 10.
Here is the hook. Suppose party B's voters are spread evenly. Draw the map one way and B wins 4 of 10 seats, close to their 40% share. Draw it another way, cramming B's voters into 3 landslide districts and thinning them everywhere else, and B wins exactly 3 seats while A takes 7. Nobody moved. Nobody changed their mind. Only the pen moved.
The tool at /sim/gerrymandering/ lets you paint districts over a fixed electorate and watch the scoreboard react. It then draws three automatic maps for the same voters: compact districts, a pro-A gerrymander, and a pro-B gerrymander. The gap between them is the whole story.
When this model helps, and when it lies
Use the sandbox to build intuition about a real and well documented effect: single-member, winner-take-all districts translate vote shares into seat shares in a way that the map controls. That translation is where redistricting fights live.
Do not read the toy as a model of any actual state. Real maps obey rules the sandbox ignores: contiguity, equal population to within a fraction of a percent, respect for county and city lines, and the Voting Rights Act. Real voters are not a smooth field with one clustering knob. Turnout varies, candidates differ, and incumbency matters. The sandbox teaches the geometry of vote-to-seat conversion, nothing more.
The clustering effect is real outside the toy. When one party's voters pile into cities, even honest compact maps under-represent them, because their votes drown in a few overwhelming urban districts. Political scientists call this a natural gerrymander, and it is one reason a fair map need not be proportional.
Packing, cracking, and wasted votes
There are only two ways to hurt a party with district lines.
- Packing
- Concentrate the opponent into a few districts they win by huge margins. A district won 85 to 15 wastes 35 of those winning votes: every vote past the 50% threshold is surplus.
- Cracking
- Split the opponent thinly across many districts so they lose each one. A party that gets 45% in five districts wins none of them, and all 45% in each is wasted.
Both moves work by wasting the target's votes. A vote is wasted if it was cast for a loser, or if it was cast for a winner beyond the 50% needed to win. The efficiency gap turns that idea into a single number.
The efficiency gap formula
Here W_A is party A's total wasted votes summed over all districts, W_B is party B's total wasted votes, and V is the total number of votes cast. A positive gap favors A, because B is wasting more. A gap of zero means both parties waste equally.
Wasted votes for one party in one district follow two cases.
v is that party's votes in the district, and T is the total votes in the district. When a party wins, everything past half the turnout is surplus, so it subtracts \tfrac{1}{2}T. When a party loses, every vote it cast is wasted.
Courts have argued that a map holding a gap beyond roughly \pm 8\% across several elections signals intentional gerrymandering. The threshold is a rule of thumb, not a law of nature, and it is weakest when the statewide split is far from 50-50.
Working the demo numbers
Take the default electorate: 10 districts, 1000 voters each, 10000 in total, with A at 60% overall. Compare two maps.
- Compact map. A wins 6 districts 650 to 350, and loses 4 districts 450 to 550. In each A-won district A wastes
650 - 500 = 150and B wastes all350. In each B-won district A wastes all450and B wastes550 - 500 = 50. - Sum A's waste. Six won districts give
6 x 150 = 900. Four lost districts give4 x 450 = 1800. So W_A = 2700. - Sum B's waste. Six lost districts give
6 x 350 = 2100. Four won districts give4 x 50 = 200. So W_B = 2300. - Efficiency gap.
(2300 - 2700) / 10000 = -0.04, a 4% gap favoring B. A won 60% of seats on 60% of votes, but the small surplus tilt shows here as a mild edge to B. - Now pack B. Redraw so B wins 3 districts 900 to 100 and A wins 7 districts about 543 to 457. A's seat share jumps to 70% on the same 60% of votes.
In the packed map B wastes 3 x (900 - 500) = 1200 surplus plus 7 x 457 = 3199 losing votes, so W_B = 4399. A wastes 7 x (543 - 500) = 301 surplus plus 3 x 100 = 300 losing votes, so W_A = 601. The gap is (4399 - 601) / 10000 = 0.38, a 38% gap favoring A. That is far past the 8% line, and you built it on purpose without moving a single voter.
Reading the seats-versus-votes curve
The clearest picture is a plot of A's seat share against A's vote share for a fixed map. A proportional map would trace the diagonal. Real maps are steeper near 50% and flatter at the extremes, so a small vote swing flips many seats in the middle. The chart below shows the compact map above (mild tilt) against the pro-A packed map (steep A advantage).
Notice the pro-B map gives B 6 seats on 40% of the vote. That is the payoff of packing A into three 85% blowouts and cracking A thin everywhere else. The scoreboard in the tool reports seats, wasted ballots, and the gap side by side so you can watch all three move together.
Common mistakes when reading a map
Ugly shapes are not proof. A snake-like district can be a fair fix for scattered communities, and a tidy square can be a brutal crack. Judge maps by their vote-to-seat effect and their efficiency gap, not by how pretty the outlines look.
Three errors recur. First, expecting proportionality from a fair map: with clustering, an honest compact plan can still under-represent the packed party, and that is geometry, not fraud. Second, trusting one election: the efficiency gap can swing with turnout, so a single number proves little. Third, treating the 8% threshold as a bright line. At a lopsided statewide split, near 65% for one party, the winner-take-all math forces a large gap even without intent, so the threshold means less there.
The honest reading compares a proposed map against many alternative maps drawn under the same rules. If almost every neutral map gives party A 5 or 6 seats and the proposed one gives A 8, the proposed map is an outlier, and that is stronger evidence than any single statistic.
Related simulations
Gerrymandering is a rule that turns individual choices into a collective outcome. Several other sandboxes on this site do the same with different rules. Schelling's Segregation Model shows how mild individual preferences sort a mixed city into blocks, the same clustering that makes natural gerrymanders possible. Opinion Spread traces how views settle into consensus or polarised camps across a network. For a different kind of collective distortion, Wealth Inequality (Yard-Sale Model) shows fair coin flips concentrating all wealth in one agent, and Braess's Paradox shows a helpful-looking change making everyone worse off.
Frequently asked questions
Can a party win a majority of seats with a minority of votes?
Yes. In the pro-B demo map above, B takes 6 of 10 seats on 40% of the vote. That is exactly what cracking the majority party achieves: split A below the winning threshold in enough districts.
What efficiency gap counts as a gerrymander?
As a rough guide, a gap beyond about 8% that persists across elections has been argued in court as a sign of intent. The demo's packed map hits 38%, far past that. Treat the threshold as a flag for closer study, not a verdict, especially when the statewide split is lopsided.
Why is a proportional result sometimes impossible?
When one party's voters cluster tightly, any contiguous districting packs them into a few landslide districts, wasting their surplus. Even a neutral compact map then gives them fewer seats than their vote share. Geography, not malice, produces the shortfall.
Does the sandbox model real turnout and candidates?
No. It uses a fixed field of two-party voters with equal turnout and no candidate effects. It teaches the geometry of converting votes into seats. Real analysis adds population equality, contiguity, community lines, and legal constraints the toy omits.
Why do seats swing so fast near a 50% vote share?
Under winner-take-all districts, a district that is near 50-50 flips with a tiny vote change. When many districts sit near that margin, a small statewide swing flips many of them at once, so the seats-versus-votes curve is steepest in the middle.