Economics●●●●●Difficulty 4 of 5

How do you pair up two sides of a market so that nobody wants to switch?

Doctors were matched to hospitals by an algorithm for a decade before mathematicians proved such a pairing always exists.

▶ Start the story

You pair them so that no two people on opposite sides would both rather have each other than the partners they got. That property is called stability, and it is the whole point: a matching is stable when there does not exist any pair where both prefer each other to their current partner. If an unstable pair existed, the two of them would have every reason to leave their matches and team up.

It is not obvious that such a pairing always exists. In 1962 David Gale and Lloyd Shapley proved that, for any equal number of participants of each type, it is always possible to find a matching in which all pairs are stable, and they presented an algorithm to do so. Picture it as a dance of proposals. In the first round each unengaged person on one side proposes to the person on the other side they prefer most, and each person who receives offers answers "maybe" to the best suitor and "no" to the rest. Engagements are provisional: someone engaged can trade up when a better offer arrives, and the dropped suitor proposes again to the next name on his list. The process repeats until everyone is engaged.

Deferred acceptance, round by round
  1. Step 1: Everyone single proposes

    To the favourite they have not tried yet

  2. Step 2: Receivers say maybe or no

    Keep the best offer so far

  3. Step 3: Trade up allowed

    A better offer replaces the old one

  4. Step 4: Stop when everyone is matched

    The result is stable

The algorithm is best known for assigning graduating medical students to their first hospital appointments. Odd twist: in 1984 Alvin Roth observed that essentially the same algorithm had already been in practical use since the early 1950s, as the "Boston Pool algorithm" used by the National Resident Matching Program. The theory had caught up with a working market, not the other way round. In 2012 the Nobel Memorial Prize in Economic Sciences went to Shapley and Roth for the theory of stable allocations and the practice of market design.

The story is often told as marriages between men and women, but that metaphor has been criticized as both sexist and unrealistic: the algorithm's steps do not reflect typical human behavior. It is a tool for markets, not for love.

Quiz me

0/3

  1. 1.What does it mean for a matching to be stable?
  2. 2.Who does the Gale–Shapley algorithm favour among all stable matchings, when men propose?
  3. 3.What made Alvin Roth's role in the history of the algorithm surprising?

Recap

Gale and Shapley's algorithm always finds a stable matching, and favours whoever proposes.

💡 A trick to remember it · Ask, maybe, trade up; nobody leaves when no pair would rather run off together.

Surprising fact · The method was in use for doctors from the early 1950s, about a decade before Gale and Shapley proved a stable matching always exists.

Sources (4)

No source, no claim. Every fact in this lesson (25 claims) cites at least one of these.

  1. [1]Stable marriage problem · Wikipedia
  2. [2]Gale–Shapley algorithm · Wikipedia
  3. [3]Alvin E. Roth · Wikipedia
  4. [4]Kidney paired donation · Wikipedia
More lessons in 💰 Economics (3) See all economics lessons →

One more light on your map.

Get one lesson like this every day, about the things you love. Free, in two or five minutes.

Get the share card for this lesson ↗