A separate study in the Quarterly Journal of Economics showed that while the cash-bail system penalizes poor people, it also discriminates against African-Americans, who tend to be treated more severely than white people by judges who set bail, regardless of the judge’s race.

Two scholars — Will Dobbie, an economist at Princeton, and Crystal Yang, a law professor and economist at Harvard — were co-authors of both studies. Jacob Goldin, a law professor and economist at Stanford, was also a co-author of the first study, “The Effects of Pretrial Detention on Conviction, Future Crime and Employment: Evidence from Randomly Assigned Judges.” David Arnold, a graduate student in economics at Princeton, was a co-author of the second, “Racial Bias in Bail Decisions.”

Both studies analyzed the bail system in two counties, Miami-Dade in Florida and Philadelphia in Pennsylvania. By subjecting judicial bail-setting decisions to statistical analysis, the first study found that some judges tended to be stricter in their bail rulings, and some more lenient. Which judge a defendant was assigned to was, for the most part, a matter of luck.

In most court cases, judges, whether lenient or strict, made the same decision as their peers, the study found. All of them set bail high for violent felonies, for example. But in about one-seventh of the cases, whether the defendant ended up detained or released hinged on which judge made the bail determination. Zeroing in on this group of “close-call” cases — in which the leniency of the judge was the decisive factor — enabled the researchers to go a long way in establishing causation in the effects of cash bail on a person’s future.

Consider two defendants with similar backgrounds who were accused of a nonviolent property crime or misdemeanor. By the luck of the draw, one faced a lenient judge and was released, and the other got a different judge who set an unaffordable bail amount. Such an unlucky defendant was detained until trial, typically for about two weeks, the study found.