Few economists could honestly describe themselves as life-savers. Professor Al Roth from Stanford University in the United States doesn't describe himself that way either. But he is.

His application of a kind of mathematics developed as a thought-experiment 50 years ago is keeping hundreds - perhaps thousands - of people alive.

Al Roth was awarded the 2012 Nobel Memorial Prize in Economic Sciences this week. He shared it with Lloyd Shapley, the man behind that half-a-century-old thought experiment.

The story starts in 1962 when Lloyd Shapley and the late David Gale published a paper in which they demonstrated how an algorithm - a step-by-step calculation - could solve what they described as the "stable marriage problem".

The question, in short, was this. If you have a group of men, and a group of women, could an algorithm be designed which would pair everyone up with a stable match?

Shapley and Gale's marriage solution Each man proposes to his highest ranked woman

If a woman is not engaged she automatically accepts

If she is engaged, she picks her preferred man

engaged, she picks her preferred man The rejected man moves on to his next highest ranked woman

Once each man is engaged the problem is solved The resulting marriages are stable because: If a man prefers another woman, she has already rejected him

If a woman prefers another man, he could not have proposed and so must be with his higher preference Source: University of California, Berkeley See UC Berkeley's step-by-step explanation

Stable here means that that no two people would prefer to be together rather than in their respective "marriages".

"Their idea was that the men would all start by proposing to their first-choice women, and the women would reject all but the offer they most preferred. But they wouldn't immediately accept that offer," says Professor Roth.

"All the acceptances would be deferred to the end. So it's called a deferred-acceptance algorithm."

The women would "hold" the best offer they'd received at any point and reject the rest. Men who had been rejected would then make a proposal to their next choice. At each stage, a woman receiving a new proposal would compare it to the proposal that she was already holding.

"She'd choose the best of those and reject the others. So someone she'd held after round one, she might reject after round two," says Roth.

"And that would proceed until no men wanted to make any more offers and no more rejections were issued - which would happen soon enough because no man would propose twice to the same woman. And at that point those offered acceptances could turn into real acceptances."

More or Less: Behind the stats Listen to More or Less on BBC Radio 4 and the World Service, or download the free podcast Download the More or Less podcast More stories from More or Less

If you are confused by all that, you are probably not alone. It is not a simple exercise. But it works. And it is "stable" in that there are no two people who would each prefer to be with the other, rather than the person the algorithm has dealt them.

"If a man prefers a woman to someone who he's been matched to, he's proposed to her and been rejected already," says Roth.

What sounds a little like a slightly out-of-control economists' party, with a bit of the swinging 60s about it, has turned out to be astonishingly useful. This idea of a "matching algorithm" is the mathematical underpinning of Al Roth's later, life-saving work.

"I started to think about how it might be applied to actual marketplaces," he says. Among his ideas was the thought that perhaps he could create an exchange for one unusual but important product - human kidneys.

Image caption Dialysis saves lives but does only 10% the work of functioning kidneys, resulting in long waiting lists for kidney transplants

Although there are plenty of people who really need a new kidney, and although most of us have one more kidney than we need, and could use a little extra cash, we're collectively rather squeamish about the idea of human organs being bought and sold.

The deferred-acceptance formula in use Kidneys - matches incompatible patient-donor pairs with others, in as wide a network as possible

- matches incompatible patient-donor pairs with others, in as wide a network as possible Public schools - matches students to high schools based on preferences, simplifying a previously-flawed system in New York and Boston

- matches students to high schools based on preferences, simplifying a previously-flawed system in New York and Boston Medical students - matches medics to hospitals where they complete residency programmes

Roth, unlike many economists, accepts that for most of the world a conventional market in kidneys is a non-starter. So he began to use his matching algorithm to design a kidney exchange, where money wouldn't come into it.

"The issue is if someone's kidneys have failed they can live for a while on dialysis but they really need a kidney transplant," he explains.

"There's a vast shortage of kidneys from deceased donors, and it's better for you in any event to get a kidney from a living donor."

People are often willing to give a kidney to someone they love. But donors and recipients are sometimes incompatible, so that is where kidney exchanges come in.

Image caption Roth's exchange system maximises the number of kidney transplants from a given pool of patient-donor pairs

"You could get together with another incompatible patient-donor pair and, if things worked out right, then each patient could get a compatible kidney from the other patient's donor," says Roth.

A couple of thousand transplants have been done this way Al Roth

"A simple exchange like that has two pairs. But now we're able to help organise more complicated chains of exchange that allow more people to receive live kidneys.

"The question is to figure out how many transplants can you get out of a given pool of patient-donor pairs.

"Supposing there are two incompatible patient-donor pairs at a given hospital who could exchange with each other, that would be a great thing. We'd get two transplants that we otherwise wouldn't get. But it might be that each of those pairs could also each do a simple two-way exchange with a different pair. So then we'd get four transplants.

"In a sense it would be a waste to do one exchange that would exhaust all the possibilities and just yield two transplants when we could be a little cleverer and get four transplants."

Unlike the stable marriage problem, this is not a theoretical exercise. Kidney exchanges are up and running. "It's proceeding slower than you'd like," says Roth, "but a couple of thousand transplants have been done this way."

There's no question that Roth's work - based on Shapley's and Gale's insights - is saving lives. But economists, it seems, are not used to taking that kind of credit. Al Roth, at any rate, prefers to focus on the life-saving role of the medics.

"Well, you know," says Roth, "market design is a helping profession, we help our surgical colleagues to save some people's lives."

Professor Al Roth was speaking to Tim Harford for More or Less on the BBC World Service.