Library · The Fiddler: Solutions · Chapter 3
Can You Gerrymander Like a Dummy?
Fiddler Nation’s election is a contest between two parties, the Suns and the Moons. You are drawing the new electoral map on behalf of the Moons, and you know exactly how every citizen will vote. There are seven districts of equal population, and the Moons win any district in which they take at least half the vote. What is the smallest fraction of the whole population that must vote Moon for it to be possible for the Moons to win a majority of the seven districts?
The Fiddler, Zach Wissner-Gross, October 16, 2026(original post)
The official solution appeared in the post of October 23, 2026 and gives for the main puzzle by the same count, and in the limit of many districts. The Extra Credit half of that post is paywalled, so is my own and has not been checked against it.
Solution
A majority of seven districts is four. The cheapest way to win a district is to take exactly half of its vote, and any Moon voter placed in a district the Moons lose is wasted. So the map that needs the fewest Moon voters packs them into four districts at exactly half each and puts none at all in the other three.
Each district holds of the population, so the Moons need half of in each of four districts: No smaller share can work, because any winning map has at least four districts each holding at least of the population in Moon voters.
With districts the same packing needs half the vote in of them, a share of . That falls towards as the number of districts grows: a majority of a majority is in the end half of a half.
The computation
The check places Moon voters every possible way. With four voters in each district, it tries all ways of choosing how many vote Moon in each, keeps the ways that win four or more districts, and reports the smallest total.
from fractions import Fraction
from itertools import product
# Seven districts of N voters; the Moons take a district
# with at least half its vote. Try every placement.
N = 4
fewest = min(sum(m) for m in product(range(N + 1), repeat=7)
if sum(2*x >= N for x in m) >= 4)
print("smallest Moon share:", Fraction(fewest, 7*N))
It prints
smallest Moon share: 2/7
Extra Credit
Next cycle you can draw a map giving any win probabilities for the seven districts, provided they average , so . The party bosses want the map that maximises the chance of winning at least five districts; with that map, the chance of losing the majority (winning three or fewer) is . You would rather maximise the chance of winning at least four; with that map, the chance of losing the majority is . How much greater than is ?
Solution
Treat the seven districts as independent, each won with its own probability. The question is then an optimisation over seven numbers between and with a fixed sum, and the whole difficulty is that there are infinitely many maps to compare. One observation about pairs of districts cuts them down to a short list.
Two districts at a time. Pick any two districts, and , and keep their total fixed while the other five stay as they are. Write for the chance of winning both, and for the number won among the other five. The pair wins both with probability , neither with probability , and exactly one with the remaining probability . So the chance of winning at least districts in all is Gather the terms in . Since , and similarly one step down, the coefficient of is and everything else depends only on . With the sum of the pair held fixed, the chance of success is a straight-line function of the product . The product is largest when the two probabilities are equal, and smallest when they are pushed as far apart as they will go, until one of them reaches or .
The short list. A best map exists, since the chance of success varies continuously over a closed and bounded set of maps. Among all the best maps, take one with as many probabilities equal to or as possible. Suppose two of its other probabilities, strictly between and , were unequal. If the coefficient of is positive, making them equal would strictly improve the map, which is impossible for a best map. If the coefficient is negative or zero, pushing them apart would lose nothing and send one of them to or , which is impossible for the best map with the most such entries. So every probability strictly between and takes one common value .
A best map can therefore be found among those with districts certain to be won, districts with the same chance , and the rest certain to be lost, where and . Because is not a whole number, is at least , and is fixed by and . Only sixteen maps qualify, listed below.
| sure | shared | chance | at least | at least | lose |
| four | five | majority | |||
| 0 | 4 | 0.5862 | 0 | 0.4138 | |
| 0 | 5 | 0.5282 | 0.1681 | 0.4718 | |
| 0 | 6 | 0.5098 | 0.2083 | 0.4902 | |
| 0 | 7 | 0.5000 | 0.2266 | 0.5000 | |
| 1 | 3 | 0.5787 | 0 | 0.4213 | |
| 1 | 4 | 0.5188 | 0.1526 | 0.4812 | |
| 1 | 5 | 0.5000 | 0.1875 | 0.5000 | |
| 1 | 6 | 0.4902 | 0.2030 | 0.5098 | |
| 2 | 2 | 0.5625 | 0 | 0.4375 | |
| 2 | 3 | 0.5000 | 0.1250 | 0.5000 | |
| 2 | 4 | 0.4812 | 0.1516 | 0.5188 | |
| 2 | 5 | 0.4718 | 0.1631 | 0.5282 | |
| 3 | 1 | 0.5000 | 0 | 0.5000 | |
| 3 | 2 | 0.4375 | 0.0625 | 0.5625 | |
| 3 | 3 | 0.4213 | 0.0741 | 0.5787 | |
| 3 | 4 | 0.4138 | 0.0789 | 0.5862 |
The bosses’ map. The best chance of five or more comes from giving every district a chance of exactly . Then each of the patterns of wins and losses is equally likely, and five, six or seven wins happen in of them, a chance of . Every other map on the list does worse. With fair coins in every district, winning three or fewer is exactly as likely as winning four or more, so
Your map. The best chance of four or more comes from putting everything into four districts, each won with chance , and conceding the other three. The majority then needs all four, a chance of , and the majority is lost otherwise:
The gap. Reaching for five districts costs the Moons about percentage points of safety in the majority. The greedy map has no safe seats at all, so its results scatter widely, and that scatter is exactly what gives it a chance at five; it also gives an even chance of falling short of four. The modest map stakes everything on four strong districts and wins the majority far more reliably, while never winning five.
The computation
The check does not use the pair argument or the short list. It searches every map whose seven probabilities are multiples of and add to , in any order, maps in all once order is ignored. For each it computes the exact chance of every number of wins by adding districts one at a time, keeps the best map for each goal, confirms that the best map is unique, and reads off the chance of losing the majority. Both optimal maps lie on this grid, so the search should find them, and it does.
def wins_distribution(p):
"""P(exactly j districts won), districts independent."""
d = [Fraction(1)] + [Fraction(0)]*len(p)
for q in p:
d = [d[0]*(1 - q)] + [d[j]*(1 - q) + d[j - 1]*q
for j in range(1, len(d))]
return d
def maps(total, slots, top):
"""Non-increasing tuples of whole numbers <= top, with
the given sum."""
if slots == 0:
if total == 0:
yield ()
return
for first in range(min(top, total), -1, -1):
if first*slots < total:
break
for rest in maps(total - first, slots - 1, first):
yield (first,) + rest
# Every map with probabilities in sixteenths, summing to 7/2.
G = 16
lose = {}
for k in (5, 4):
score = {}
for m in maps(7*G//2, 7, G):
d = wins_distribution([Fraction(x, G) for x in m])
score[m] = sum(d[k:])
top = max(score.values())
winners = [m for m in score if score[m] == top]
assert len(winners) == 1 # the best map is unique
best = [Fraction(x, G) for x in winners[0]]
d = wins_distribution(best)
lose[k] = sum(d[:4])
print(f"best for >= {k}:", " ".join(map(str, best)))
print(f" P(>= {k}) = {sum(d[k:])}, P(lose) = {lose[k]}")
print("maps searched:", len(score))
gap = lose[5] - lose[4]
print("LA - LB =", gap, "=", float(gap))
It prints
best for >= 5: 1/2 1/2 1/2 1/2 1/2 1/2 1/2
P(>= 5) = 29/128, P(lose) = 1/2
best for >= 4: 7/8 7/8 7/8 7/8 0 0 0
P(>= 4) = 2401/4096, P(lose) = 1695/4096
maps searched: 6375
LA - LB = 353/4096 = 0.086181640625