Introduction to Matching Theory E. Maskin Jerusalem Summer School in Economic Theory June 2014 • much of economics is about markets – exchanges between buyers and sellers • commonplace to suppose that sellers are heterogeneous – sell somewhat different goods – so buyers not indifferent between different sellers’ goods 2 distinctive feature of matching markets: in addition to buyers caring about which seller they buy from, sellers care which buyer they sell to • e.g., market for education: think of schools as sellers and prospective students as buyers • not only do students have preferences over schools • but typically, schools have preferences over students ‒ view some students as more desirable than others another (more technical) feature: indivisibilities (student will attend exactly one school - - or no school at all) 3 Matching Theory • which buyers are matched with which sellers in equilibrium? • what are equilibrium prices? – positive side • which matchings between buyers and sellers have desirable properties ? e.g., stability or fairness – normative side 4 • how can we find such desirable matchings? – i.e., can we construct algorithms or mechanisms that result in these matchings? – this is market design / implementation side • we’ll look at all 3 sides in summer school – particular emphasis on second and third sides – but tomorrow, will look at first side (positive) in order to study wage inequality 5 Model • n sellers, each with 1 indivisible good • m buyers, each wants to buy at most 1 good – one-to-one matching – in later lectures, will consider many-to-one matching (e.g. each student assigned to one school, but each school assigned many students) • buyer i (i=1,…,m) gets utility ui ( j ) from obtaining seller j’s good (being matched with j) – ui ( j ) could be positive or negative • seller j ( j=1,…,n) gets utility v j (i ) from selling good to buyer i (being matched with i) vi ( j ) could include cost of producing good • each buyer and seller gets 0 utility from remaining unmatched: notationally, ui (0) 0 (i matched with seller 0) v j (0) (j matched with buyer 0) • two-sided matching (buyers and sellers are different populations) – men matched with women to form marriages – violinists matched with pianists to form duos – will look at one-sided matching (single population) later in summer school roommate problem and house assignment problem 6 For now, assume there exists perfectly transferable good (money) • let pij = price that buyer i pays for seller j’s good (could be negative) • buyer i’s payoff = ui ( j ) pij + v j (i ) • sellers j’s payoff = pij • let matching be matrix xij such that 1, if j sells to i (j 0 if i unmatched; i 0 if j unmatched) xij 0, if j doesn't sell to i n x j 0 ij m xij 1 for all i 1,..., m, j 1,..., n i 0 7 • competitive equilibrium is xij* , pij with pi0 p0 j 0 such that ui ( j ) pij max ui ( k ) pik , if xij 1 k pij v j (i ) max pkj v j ( k ) , if xij 1 k • claim: competitive equilibrium exists and is (essentially) unique – despite nonconvexity created by indivisibilities 8 • to convexify, – let each buyer randomize over seller he buys from – let each seller randomize over buyer he sells to • then (random) demand and supply correspondences satisfy standard convexvaluedness and upper hemicontinuity properties • so equilibrium exists – with probability 1, no randomization in equilibrium (because equilibrium matching maximizes sum of utilities, and so is generically unique - - see below) – but even if there is randomization, can convert matching into no-randomization equilibrium 9 e.g., i 2 j 3 1 1 i 2 3 3 3 j can be converted to • each buyer and seller indifferent between randomized equilibrium and deterministic equilibrium 10 • for any matching xij , can obtain (by monetary transfers) any payoffs (1 , , m ) for buyers and ( 1 , , m ) for sellers such that (1) i j (ui ( j ) v j (i )) xij i j i j • hence, from first welfare theorem (equilibrium is Pareto optimal), equilibrium matching xij solves (2) (u ( j ) v (i )) x x arg max ij xij i j i j ij • generically, unique solution to (2) (and no random solutions) • so, generically, unique equilibrium matching xij – can be multiple prices supporting xij 11 matching xij together with monetary transfers ti , t j is in core if m n t t i 1 i j 1 j 0 there exist no coalitions C b and C s , matching xˆij tˆ ,tˆ such that and transfers - j j 0 tˆ tˆ i iC - i jC b jC s 0 s xˆij 1 and iC b 0 xˆij 1 for all i C b , j C s - for all i C b , if xˆij 1, then (3) ui ( j) tˆi ui ( j ) ti if xij 1 and if j C s (4) v j (i ) tˆj v j (i) t j if xij 1 - analogously for all j C s C b C s is blocking coalition core matchings are stable 12 claim: competitive equilibrium xij* pij in core, where for all i 1,..., m ti pij* , for xij* 1 and for all j 1,..., n t j pij , for xij* 1 13 suppose to contrary there exist C b and C s and xˆij , tˆi , tˆj that block xij* , pij - then for any i C b ,if xˆij 1 ui ( j) tˆi ui ( j ) pij 0, if xij* 1 if j 0 (i unmatched in blocking coalition) then tˆi > 0 - and so blocking coalition can do better by leaving out i so, can assume j C s , and hence (6) v j (i ) tˆj v j (i ) pi*j if xi*j 1 if tˆi tˆj 0, then rest of blocking coalition does even better by leaving out i, j so can assume tˆi tˆj 0, and thus adding (5) and (6), we have (5) (7) ui ( j) v j (i ) ui ( j ) pij + v j (i ) pi*j but from definition of equilibrium ui ( j) pij* (i ) ui ( j ) pij and v j (i ) pij* v j (i ) pi*j , which, when added together, give ui ( j) v j (i ) ui ( j ) pij + v j (i ) pi*j , contradicting (7) 14 claim: any point xij , ti , t j in core is competitive equilibrium if xij 1, then ti t j 0 if ti t j 0, then sum of i ' s and j ' s payoffs ui ( j )+ v j (i ) but i and j can form blocking coalition and get ui ( j )+ v j (i ) if ti t j 0, then beacuse sum of all transfers sum is 0, there exist i, j with ti t j <0, a contradiction of above if xij 1, let pij t j (so seller recieves pij and buyer pays pij ) for j such that xij 0, then being in the core implies (8) ui ( j) v j (i ) ui ( j ) pij + v j (i ) pij , where xij =1 from (8), we can choose pij such that (9) ui ( j) pij ui ( j ) pij and (10) v j (i ) pij v j (i) pij (9) and (10) imply that xij , ti , t j is a C.E. 15 Assortative Matching • for each i and j, let wij ui ( j ) v j (i ) • assume for all i, j (11) wi 1 j 1 wi j 1 wi 1 j wij • think of index i as positively correlated with buyer’s “productivity” (contribution to wij ) and j as correlated with seller’s productivity – then (11) says that buyer’s marginal productivity is increasing in seller’s productivity and vice versa – e.g., would hold if wij f (i ) g ( j ), where f and g increasing 16 (11) wi 1 j 1 wij 1 wi 1 j wij claim: given (11), there will be positive assortative matching in competitive equilibrium, i.e., for equilibrium matching xij if xij xij 1 and i i , then j j – i.e., more productive buyers will be matched with more productive sellers suppose to contrary that j j but from 11 wij* wi*j wij* wi*j implying that matching xij* xi*j 1 yields higher sum of payoffs 17 Now drop money from model – for some markets (e.g., public schools) buying and selling goods may be problematic • can no longer define competitive equilibrium • but can still speak of core 18 matching xij in core if there do not exist coalitions C b and C s and xˆij with xˆij xˆij 1 jC s 0 iC b 0 such that (12) for all i C b , if xˆij 1 ui ( j) u j (i ), for xij 1 and if j C s (13) v j (i ) v j (i), for xij 1 analogously for all j C s above simplifies to: xij in core if, for all i, j, xij 1 implies ui ( j ) 0 and v j (i ) 0 and there does not exist j satisfying (12) and (13) matching xij is called stable 19 claim: stable matching exists (Gale-Shapley) proof is constructive (algorithmic): • in each stage some buyer i, not currently matched, proposes match to favorite seller j (highest ui ( j) 0) among those who have not previously rejected him • if seller j prefers i to current match i ( v j (i ) v j (i)) rejects i and replaces him with i; otherwise rejects i and sticks with i • algorithm terminates when each unmatched buyer has been rejected by all sellers giving him positive utility • called deferred acceptance algorithm, because seller’s “acceptance” of i only provisional 20 finiteness ensures that algorithm terminates results in matching xij that is stable if not, then for some i, j with xij =1 there exists j with (12) ui ( j) ui ( j ) and (13) v j (i ) v j (i), where xij 1 but i must have proposed to j previously because from 12 he prefers j to j and from 13 j would have rejected i and replaced him with i so j can't wind up with only v j (i) (seller's utility can only rise over time), a contradiction 21 • have looked at stable matching when buyers make proposals • could do same for proposals by sellers • may get different matching – differs from transferable utility case, where stable matching generically unique 22 • for example: two buyersi, i, two sellers j, j i j j 0 i j j 0 j j i i i i 0 0 – if buyers propose, get xij xij 1 – if sellers propose, get xij xij 1 • henceforth, focus on strict preferences 23 claim: • order of buyers doesn’t matter when buyers make proposals • every buyer (weakly) prefers outcome of buyer-proposal algorithm to any other stable matching call seller j * possible for buyer i * if there exists stable matching xij in which xi* j* =1 fix order of buyers and assume that before stage s, no buyer is rejected by a seller who is possible for him suppose i rejected by j * at stage s but xˆi* j* =1 for some stable matching xˆij j * must have received proposal from i for whom (14) v j* (i) v j* (i * ) 0 by assumption about s (15) ui ( j * ) ui ( j) for all sellers j who are possible for i hence, (14) and (15) imply that (i, j * ) can block xˆij , a contradiction thus, no buyer ever rejected by a seller who is possible for him in (any) buyer-proposal algorithm, each buyer matched with his favorite possible seller, i.e. order doesn't matter 24 b let buyer-proposal stable matching x • be ij s x • symmetrically, each seller weakly prefers outcome ij of seller-proposal algorithm to any other stable matching 25 claim : in buyer-proposal algorithm, no buyer gains from misrepresenting his preferences • suppose, to contrary, that some buyer i * can submit false preferences and thereby induce xij* , which he prefers to xijb • by Gale-Shapley xij* is stable wrt false preferences for i * • but will show that xij* can be blocked by agents other than i * 26 • let B* buyers who prefer xij* to xijb * * * • let S sellers matched with B buyers in xij in xij* every buyer in B*matched with some S * seller, • S *b since each one strictly prefers xij* = sellers matched with B * buyers in xijb case I S * S *b choose j S such that j S *b assume j matched with i in xij* thus i prefers j to his match in xijb - to prevent (𝑖 ′ , 𝑗 ′ ) from blocking 𝑏 𝑥𝑖𝑗 (16) v j (i) v j (i) 0, where xibj 1 now, i B* (because j S *b ), and so (17) ui ( j) ui ( j) where xi*j 1 hence, (16) and (17) imply ( i, j) block xij* 27 B* buyers who prefer xij* to xijb S * sellers matched with B* buyers in xij* S *b sellers matched with B * buyers in xijb case II S * S *b • in buyer-optimal algorithm (with true preferences), each buyer in B* is rejected by seller he’s matched with in xij* • so because 1-to-1correspondence between B* and S *b , each seller in S *b must reject some buyer in B* in algorithm • let j ** be last seller in S *b to get proposal from buyer in B* say, i ** • i ** can’t be rejected by j ** ultimately matched with seller from S *b , so must make another proposal contradicts choice of j ** • since j ** rejected some other buyer in B* , j ** must have had matched iˆ that he rejects when i ** proposes, so (18) uiˆ ( j ** ) uiˆ ( ˆj ), where xiˆb ˆj 1 28 • iˆ B* because otherwise iˆ makes later proposal to seller in S *b , contradicting choice of j ** • hence, uiˆ ( ˆj ) uiˆ ( ˆj), where xi** ˆ ˆj 1 and so from (18) 19 uiˆ ( j ** ) uiˆ ( ˆj) • let iˆ** be buyer matched with j ** in xij* • then because iˆ** B* ** ** b ˆ 20 u ( j ) u ( j ), where x 1 iˆ** iˆ** iˆ** ˆj** • so iˆ** must propose to j ** before ˆj ** • because iˆ last buyer rejected by j ** 21 v j (iˆ) v j (iˆ** ) but 19 and 21 imply (iˆ, j ** ) block xij* ** • ** 29 summary of case II: • buyers B* who gain from xij* matched with same set of sellers S * in xij* as in xijb • consider last seller j ** S * to get proposal from any buyer in B ** let i ** be buyer in algorithm with true preferences • there must be buyer iˆ B* who proposes to j ** just before i ** • so iˆ prefers j ** to seller he's matched with in xijb and hence in xij* • j ** prefers iˆ to buyer matched with in xij* , who is rejected earlier • so (iˆ, j ** ) blocks xij* 30 • dominant strategy for buyers to be truthful in buyer-proposal algorithm • but sellers may not gain from true revealation of preferences • consider earlier example i j j 0 i j j 0 j j i i i i 0 0 if use buyer-proposal algorithm with true preferences, get xij xij 1 i but if j submits ranking 0 instead i then algorithm gives xij xij 1 , which j prefers 31 same example shows there is no algorithm guaranteeing stable matchings for which all players always have dominant strategies • suppose to contrary there is such a mechanism • consider preferences of example i j j 0 i j j 0 j j i i i i 0 0 • if dominant strategies lead to matching with xij xij 1 then j has incentive to act as though preferences i are 0 i only stable matching is xij xij 1 • if dominant strategies lead to matching with xij xij 1 j then i has incentive to play as though prefernces are 0 j 32