Tuesday was the deadline for eighth graders in New York City to submit applications to secure a spot at one of 426 public high schools. After months of school tours and tests, auditions and interviews, 75,000 students have entrusted their choices to a computer program that will arrange their school assignments for the coming year. The weeks of research and deliberation will be reduced to a fraction of a second of mathematical calculation: In just a couple of hours, all the sorting for the Class of 2019 will be finished.

To middle-school students and their parents, the high-school admissions process is a grueling and universally loathed rite of passage. But as awful as it can be, it used to be much worse. In the late 1990s, for instance, tens of thousands of children were shunted off to schools that had nothing going for them, it seemed, beyond empty desks. The process was so byzantine it appeared nothing short of a Nobel Prize-worthy algorithm could fix it.

Which is essentially what happened.

About a decade ago, three economists — Atila Abdulkadiroglu (Duke), Parag Pathak (M.I.T.) and Alvin E. Roth (Stanford), all experts in game theory and market design — were invited to attack the sorting problem together. Their solution was a model of mathematical efficiency and elegance, and it helped earn Professor Roth a Nobel Memorial Prize in Economic Science in 2012.

Image Alvin E. Roth at Stanford University in 2012. Credit... Norbert Von Der Groeben/Reuters

Before the redesign, the application process was a mess. Or, as an economist might say, it was an example of a congested market. Each student submitted a wish list of five schools. Some of them would be matched with one of their choices, and thousands — usually the higher-performing ones — would be matched with more than one school, giving them the luxury of choosing. Nearly half of the city’s eighth graders — many of them lower-performing students from poor families — got no match at all. That some received surplus offers while others got none illustrated the market’s fundamental inefficiency.