Matching Markets
How to pair students with schools, doctors with hospitals and kidney donors with patients when prices cannot do the sorting.
Key takeaways
- In a matching market, both sides have preferences, and goods are assigned by a rule rather than by price.
- A matching is stable if no two people would both prefer each other to the partners they were given.
- The deferred acceptance procedure always finds a stable matching, one step at a time.
- Which side proposes matters: the proposing side gets its best stable result.
- Well-designed matching rules let people state their true preferences without being punished for it.
Most markets sort people with prices. If you want a sandwich, you pay the price and you get the sandwich. But try that for a seat in a public school, a residency at a hospital, or a kidney from a donor. The price system does not decide who gets what. Instead, each side ranks the other, and someone has to design a way to pair them up.
These are matching markets, and the pairing rule is a mechanism of the kind in Mechanism Design: Building the Rules. A good rule gives every family a fair shot and no reason to play games. A bad rule makes people lie about what they want. This lesson shows what a good rule looks like, and it begins with a very small town.
Why stability matters
Picture two applicants, Ana and Ben, and two schools, Xavier and Yale Street. (We will call the schools X and Y.) Each school has one seat. Their rankings, best first, are:
| Who | First choice | Second choice |
|---|---|---|
| Ana | X | Y |
| Ben | Y | X |
| School X | Ben | Ana |
| School Y | Ana | Ben |
Suppose a clerk assigns Ana to Y and Ben to X, and then someone checks whether anyone is unhappy enough to complain. Ana is at her second choice, and she would prefer X. But X prefers Ben to Ana, and Ben is already there, so X has no reason to want her. Ben is at X, his second choice, and he would prefer Y. But Y prefers Ana to Ben, and Ana is already there. So nobody who is unhappy can find a partner who wants them. Now check each matching carefully.
Matching 1: Ana-X, Ben-Y.
Ana and Ben each got their first choice, so neither wants to leave.
Stable.
Matching 2: Ana-Y, Ben-X.
X has its first choice (Ben) and Y has its first choice (Ana).
Neither school wants to switch. Stable too. Both are stable. In Matching 1 the applicants get their favorites. In Matching 2 the schools do. A blocking pair is a school and an applicant who are not matched but would both prefer each other to their current partners. A matching with no blocking pair is called stable. Stability matters because an unstable match unravels: the blocking pair slips out of the arrangement, makes a side deal, and the whole system breaks down. Real markets for new doctors once did exactly that, with offers made earlier and earlier each year to beat rivals, which is part of why a central system was introduced.
The deferred acceptance procedure
In 1962, the mathematicians David Gale and Lloyd Shapley described a way to find a stable matching for any set of rankings. It is called deferred acceptance. Alvin Roth later showed that real medical matching programs worked by the same idea, and Shapley and Roth shared the 2012 Nobel Prize in economics for this line of work.
The word "deferred" matters. A school never says a final yes in the early rounds. It only holds its favorite, because someone better might apply later. That keeps schools from being locked into poor choices.
Worked example: three applicants, three schools
Now a larger case. Applicants Ana (A), Ben (B) and Cy (C) apply to schools X, Y and Z, each with one seat. Rankings, best first:
Applicants: A: X, Y, Z B: X, Z, Y C: Y, X, Z
Schools: X: B, A, C Y: A, C, B Z: A, B, C Run the procedure with applicants proposing:
Is this matching stable? Check each unmatched pair for a blocking pair.
- Ana prefers X to Y (her match). But X prefers Ben, whom it has, to Ana. Not blocking.
- Cy prefers Y and X to Z (his match). Y prefers Ana, whom it has, to Cy. X prefers Ben to Cy. Not blocking.
- Ben has his first choice, X. Nothing to check.
No blocking pairs, so it is stable. Now see what an unstable matching looks like. Suppose we had put Ana at X and Ben at Z. Ben prefers X to Z, and X prefers Ben to Ana. So Ben and X would both prefer to be together: a blocking pair. That matching would fall apart.
Ana got her second choice, Ben his first, and Cy his third. Not everyone is happy, but no two people can both do better by going around the system.
Who proposes matters
Back in the small town of Ana, Ben, X and Y, there were two stable matchings. The applicants-proposing procedure gives Matching 1, where applicants get their first choices. If schools proposed instead, the result would be Matching 2, where the schools get theirs. The general fact, proven by Gale and Shapley, is that the proposing side gets the best stable matching it could hope for, and the other side gets the worst stable one. So choosing who proposes is a design decision with real winners and losers. Most school systems and the national residency match let the applicants propose.
Truth-telling and the matching rule
Is it safe for an applicant to list their real favorites in order? Under applicant-proposing deferred acceptance, yes: it is a result of the theory that no applicant can do better by misreporting their ranking. That is incentive compatibility, as in Mechanism Design: Building the Rules. There is no "safe" school to apply to as a trick, because a school only holds your offer, and your application to a less-liked school never hurts your chances at a better one.
Contrast that with an older method used in some school systems, including Boston before 2005. Families were assigned, round by round, to a school ranked first by them, as long as seats remained. A family that listed a popular school first and missed out found the seats at its second choice already gone. Smart families learned to rank a school they could actually get first, even if they loved another more. Families that did not know the trick were hurt. Boston changed to a deferred acceptance rule that year, and similar changes followed elsewhere. Game theory was not just a description; it fixed a real problem.
A common mistake: confusing stable with best
Stable does not mean "everyone gets their first choice." In our 3-person example, Cy gets his third choice. It means that no pair would walk away together. Another mistake is to think the matching is fair simply because the algorithm is neutral. As the example showed, the choice of who proposes gives one side the advantage. A third mistake is to treat the result as the answer. A market can have several stable matchings, and the rule picks among them.
Matching without prices
Kidney exchange is a vivid case. A patient needs a kidney, and a relative is willing to donate but is the wrong blood type. In the United States it is illegal to sell organs, so no market with prices is allowed. Instead, a program finds a cycle: patient 1's donor gives to patient 2, whose donor gives to patient 3, whose donor gives to patient 1. Everyone in the cycle gets a compatible kidney. Careful design lets these swaps and chains reach more patients, though real programs also deal with medical, legal and ethical limits the model leaves out. For current rules, check the organizations that run them.
Not every matching problem needs a central rule. Job markets, marriage and housing mix matching with prices and search. Still, the lesson holds: when you cannot use prices, the rules decide who wins, so the rules deserve care. Many job and housing searches also depend on what players know about each other, as in Games With Incomplete Information. And the game-theory ideas of strategy and equilibrium continue to show up in Evolutionary Games and What Experiments Show.
Words to know
Matching market a market in which both sides have preferences and an assignment rule, not prices, pairs them up.
Stable matching a matching with no two people who would both rather be with each other than with their assigned partners.
Blocking pair a pair who are not matched but would both prefer each other to their current partners.
Deferred acceptance a procedure in which one side proposes, the other holds its best offer tentatively, and the process repeats until no one is rejected.
Proposing side the side that makes offers, which gets its best stable outcome.
Strategy-proof describing a rule where reporting your true ranking is always your best choice.
Kidney exchange a program that swaps donors among incompatible patient-donor pairs.
Check yourself
- What makes a matching stable?
- In the two-applicant, two-school town, name the two stable matchings and say who prefers each.
- In Round 1 of the three-person example, why does X reject Ana?
- In the final matching, which choice number did each of Ana, Ben and Cy get?
- Explain why putting Ana at X and Ben at Z would not be stable.
- Why was Boston's older method hard on families who ranked honestly?
Show the answers
- No applicant and school who are not matched to each other would both prefer to be together; there is no blocking pair.
- Ana-X with Ben-Y (applicants get their first choices) and Ana-Y with Ben-X (schools get their first choices).
- X holds Ben because it ranks Ben above Ana, so Ana is rejected and tries Y next.
- Ana got her second choice (Y), Ben his first (X), and Cy his third (Z).
- Ben prefers X to Z and X prefers Ben to Ana, so Ben and X both gain by pairing up, a blocking pair.
- A family ranking a crowded school first could lose its seat at its second choice, so honest families were hurt while those who gamed the list did better.