In reply, the commission says that its main objective was to give Latinos and Native Americans the ability to elect representatives of their choice, a consequence of Sections 2 and 5 of the Voting Rights Act. These groups tilt Democratic, and in 2014 the resulting 10 districts elected Democrats in 29 out of 30 State Senate and House seats, an occurrence that the litigants cite as evidence of partisan injury. However, in 14 other districts at the other partisan extreme, Republicans were elected in 42 out of 42 races. How can the court decide if either party suffered an overall disadvantage?

Here’s where the average-median difference comes in. Across all 30 districts in Arizona State Senate races, the Democrats won an average of 46.1 percent of the vote. The median outcome was 42.8 percent. The median Democratic vote share was less than the average by 3.3 percentage points, a direction that slightly benefited Republicans — the opposite of the plaintiffs’ contention. By well-established statistical criteria, even this difference could have arisen by chance, rather than partisan intent. In State House races, the difference was an even smaller gap of 1.7 percentage points. Over all, Democrats won 39 percent of all state legislative seats. If the commission was trying to show special favor to Democrats, it did a poor job.

I have come up with additional tests to identify other consequences of gerrymandering. One is to ask whether one party’s winning margins are more lopsided than the other side’s. For example, in the Pennsylvania congressional election of 2012, Democrats won only 5 out of 18 congressional House seats, despite winning slightly more than half of the statewide vote. Democratic winners garnered an average of 76 percent of the vote, while Republican winners won 59 percent. Statistically speaking, this 17-point difference would arise by chance less than 1 percent of the time.

Simple criteria for identifying gerrymanders would be of great use. The Supreme Court has never rejected a voting district for giving a political party an advantage. Justice Antonin Scalia has previously attempted to shut the door on questions of partisan gerrymandering, pointing out that legal battles have “almost invariably produced the same result (except for the incurring of lawyers’ fees).”

A majority of the court, however, supports the idea of finding a test that measures partisan asymmetry. Justice Anthony M. Kennedy, who in the past has provided the deciding vote on this question, has stated his desire to find a workable means of identifying partisan gerrymanders. Either the average-median difference or the lopsided-margin test could serve such a function. Justice Kennedy can have them both.

Statistical tests can be used by courts to throw out meritless cases while freeing up time for investigation of true offenses. These tests can supplement other existing legal mandates, such as Ohio’s recently passed requirement for districts to be geographically compact. Conversely, the tests allow oddly shaped district boundaries, which are sometimes needed to comply with Voting Rights Act requirements. My tests can also be combined with sophisticated methods for examining single districts in detail. Finally, a statewide statistical approach might even be used to test proposed plans before they go into effect.

Although it seems unlikely that many jurists choose the law out of a love of mathematics, when it comes to redistricting they can still put the skills they have to good use. Lawsuits from the 2010 cycle are wending their way through the courts. If the Supreme Court can put a clear standard in place before 2020, maybe the next round of battles will be a little less painful.