Gerrymandering is the drawing of electoral districts to benefit one political party over another. See how two mathematical tools reveal when this is very likely occurring. The Polsby-Popper score shows how close a given district is to the optimum compact shape—a circle. The efficiency gap measures the impact of “packing” and “cracking” in different districts, which has an outsize effect on party success.