Together with a collaborator named Elliott Peranson, Roth came up with a new, sophisticated algorithm to solve the problem of married couples. As it turned out, it worked beautifully, and when the new system was implemented in 1998, the lives of young doctors all over the country were significantly improved. The experience was as illuminating to Roth as it was to some of the doctors who had been skeptical that an economist would have any clue how to help them.

Better than anyone, Roth — who is now a professor in the Harvard economics department and at the Harvard Business School — was aware of how complicated the problem was. It was one thing to criticize what had been done, and another thing entirely to design a matchmaking system that would work smoothly in the real world, with all its messy details and practical constraints. He decided to do it anyway.

“I remember thinking, ‘Gee, I’m sorry I picked up the phone!’ ” Roth said last week. “My visceral reaction was, ‘This is going to be really hard, and there’s some chance we’re going to get egg on our faces.’ ”

Then came the phone call from the NRMP administrator, who wanted Roth to use his theories not to game the system, but to help save it from unraveling.

As a professor who specialized in game theory, Roth had been studying medical matching programs closely since the early 1980s, figuring out what worked and what didn’t, and what rules were required to make a system in which everyone — the hospitals, the doctors — ended up happiest. He had coauthored a book full of theories and equations related to the problem of matching in general. He was so well known for this, one colleague remembers, that medical students would call him every year for advice on how to game the system.

When it was introduced in the 1950s, the National Resident Matching Program was supposed to help doctors with the stressful and chaotic problem of finding their hospital internships. But after four decades, it was showing its age. Some medical students complained that the process was unfair, and that hospitals were being given too much power in determining where new doctors would live and work. Above all, the system was faltering because it was designed at a time when virtually no women became doctors, which meant it couldn’t handle married couples applying simultaneously. The result was that young doctors were passing up job opportunities for family reasons, and in some cases husbands and wives were assigned to distant cities and asked to choose their careers over each other.

One day in 1995, Alvin Roth picked up the phone to discover that someone had finally called his bluff. The economist had spent years writing academic papers about the medical job market — specifically, picking apart the national system that matched young doctors to their first hospital jobs out of medical school. Now the person who actually oversaw that process was suddenly on the other end of the receiver, telling Roth the system was in crisis and asking him to please fix it.

When most people think of economics, they think of money — the study of how much things cost and why. Roth distinguishes himself by being more interested in situations where money plays little or no role — for instance, the process that determines who among the thousands of patients awaiting kidney transplants nationwide should receive the small number of organs that are available. As a society, we’ve decided we’re not comfortable with people selling their organs, so some other system — some other kind of market — is required. And a market, in Roth’s view, does not necessarily come down to prices, nor is it always ruled by simple principles like supply and demand: As long as people are competing with each other to get what they want, then resources are being allocated, and that means economists should be thinking about it.

“We’re starting to know enough about how some of these things work,” Roth said, “that in some cases, when you’ve got a market in trouble, and you think, ‘Who’re you gonna call?’ you could call an economist.”

Sitting in his office last week, Roth talked about how it was time for economics, as a field, to turn a corner — how merely describing markets as they naturally occur was no longer enough. Instead, he said, economists have to make themselves useful by fixing broken systems in which people aren’t getting what they want.

Academically speaking, Roth is a pioneer of so-called market design: finding situations where a market is failing — often, a place that most people wouldn’t even recognize as a market — and making it work better. Roth has influenced a cadre of young, energetic market designers, many of whom have taken up prominent positions at top universities. Inspired by Roth’s work, these rising economists are also setting their sights on real-world problems. Some are looking at dating websites; others are interested in how universities could do better at scheduling their students’ classes. Like Roth, all of them envision a world in which economists, as unlikely as it may seem, are recognized as society’s mechanics.

In the years since, Roth has emerged as a rare figure in the academic world: a theorist willing to dive into real-world problems and fix them. After helping the med students, he designed a better way to assign children to public schools — the system now used by both Boston and New York. He also helped invent a system for matching kidney donors with patients, dramatically increasing the number of donations that take place each year. More recently, he and one of his students have been talking with Teach for America about improving the system it uses to deploy volunteers around the country.

“I don’t think people thought about the residency matching process as something an economist should think about,” said Robert Gibbons, an economist at the MIT Sloan School of Management. “Al sort of showed there was economics there.”

The trouble is that when you can’t rely on prices to stand in for value, things get complicated. In typical markets, “Money finds the matches,” said Utku Ünver, an associate professor of economics at Boston College who has collaborated with Roth on projects. “But when there’s no money, there’s lots of friction, and there are lots of things that may cause these markets to fail and not function efficiently.”

When you can’t use prices to express how much something’s worth, in other words, figuring out who should get what becomes a complicated business. “That’ll kill your economics 101 market real quick,” said Gibbons. “Al comes along to help you with situations where you’re not allowed to use the price mechanism.”

Roth has always been interested in the idea that sophisticated theories can be used to solve practical problems. As a graduate student at Stanford University, he earned a doctorate in operations research, which uses math to help organizations run more smoothly. Roth was just 19 when he started at Stanford, having quit high school without graduating at the age of 16 and finished Columbia University in three years. At just 22, he got a job as an assistant professor at the University of Illinois, and in 1977, at just 25, he was granted tenure there.

Roth met two people at the University of Illinois who had a profound influence on his work. Both of them were psychologists; one he wrote lots of papers with early in his career, and the other he married. Together, they taught Roth the pleasures of running laboratory experiments — something economists hardly ever did at that time. Roth loved the idea that he could challenge widely accepted theories about how markets worked by running experiments and producing data on how people actually behave when faced with certain choices. His enthusiasm for the practice, combined with his reputation as a rising star among theorists, made him a leader in the so-called experimental economics movement, which has transformed from the marginal backwater it was in those days to a robust discipline.

At first, though, Roth and his collaborator in the University of Illinois psychology department, Keith Murnighan, faced an uphill battle getting traditional economists to take the results of their experiments seriously. “There’s no question we were really working in an area where other economists were not at all supportive,” Murnighan said. The skepticism, he explained, was a response to the fact that he and Roth were challenging some basic assumptions of conventional economic theory — particularly the idea that people can be counted on to act rationally when their economic interests are at stake.