Mechanism Design, Matching Theory and the Stable Roommates Problem
Presented to the Department of Economics in partial fulfillment of the degree of Bachelor of Arts with Honors in Economics
by
Yashaswi Mohanty
Advisor: Timothy Hubbard Second Reader: Dale Skrien
Department of Economics Colby College Abstract
This thesis consists of two independent albeit related chapters. The first chapter introduces concepts from mechanism design and matching theory, and discusses potential applications of this theory, particularly in relation to dorm allocations in colleges. The second chapter investigates a subset of the dorm allocation problem, namely that of matching roommates. In particular, the paper looks at the probability of solvability of random instances of the stable roommates game under the condition that preferences are not completely random and exogenous but endogenously determined through a dependence on room choice. These prob- abilities are estimated using Monte-Carlo simulations and then compared with probabilities of solving a completely random instance of the stable roommates game. Our results portray a complex relationship between the two probabilities, suggesting avenues for future research. Acknowledgements
While an honors thesis is ostensibly an individual endeavour, designed to help a student develop his or her ability to conduct independent research, this project has been far from an independent affair. Although I have spent several solitary hours embedded in academic limbo, struggling to figure out a concept or getting my code to work, many of my break- throughs have been facilitated by the supporters of this project. While a number of people have contributed to the end product that you see here, a few deserve special mention. First and foremost, I must thank my advisor Prof. Tim Hubbard, who first guided me towards matching theory and its various applications. He introduced me to the possibility of designing a mechanism for college room allotment. Pondering over this problem, I stum- bled across the question that I eventually attempt to answer in this thesis. Tim has been instrumental in helping me tackle broad problems in the goal and vision of the project while simultaneously assisting with me with the intricate details of the modeling process. Perhaps his greatest contribution to this project has been suggesting that I use Kendall’s tau when I was struggling to come up with a measure of rank correlation. Without this little insight, my project could have possibly collapsed! Next, I would like thank Prof. Samara Gunter, whose painstaking efforts to ensure that the entire thesis cohort was making consistent progress on their projects was an important motivating force for getting this thesis across the finish line. From making sure that my pre- sentations were not overly technical and opaque to providing critical feedback for my drafts to reassuring me of my abilities when I most doubted my capability to conduct research, Sam’s guidance and support has been indispensable. I am very much indebted to her for this finished product. Third, I must thank Dale Skrien for agreeing to read this paper in the capacity of a second reader and providing helpful suggestions regarding the Python implementation of Irving’s algorithm. I must also acknowledge the incredible debugging skills of Kyle McDonell who spent six hours neglecting his own honors thesis to fix my (rather poorly written) code. Kyle’s modifications to the Python implementation of Irving’s algorithm allowed me to finally generate the results I had been looking for. Finally, I would like to acknowledge my fellow honors students, who have shared this incredible experience with me and have experienced the peaks and nadirs of this rather tumultuous journey. This process wouldn’t have been half as fun without them.
i Contents
1 Matching and College Housing Allotment1 1.1 An Overview of Matching...... 1 1.2 Applications of Matching Theory...... 2 1.3 College Housing Allotment and Stable Roommates...... 3
2 Stable Roommates with Endogenous Preferences6 2.1 Introduction...... 6 2.1.1 Solvability of stable roommates instances...... 8 2.1.2 Partially endogenous preferences...... 9 2.2 Methods...... 10 2.2.1 Setting up the model...... 10 2.2.2 Adding exogenous room preferences...... 11 2.2.3 Endogenizing roommate preferences...... 11 2.2.4 Finding theoretical values for the solvability probability...... 13 2.2.5 Monte-Carlo methods...... 17 2.3 Results...... 18 2.4 Robustness Checks...... 21 2.4.1 Increasing the sample size...... 21 2.4.2 Looking at larger values of n ...... 23 2.4.3 Modifying the k-factor...... 25
ii 2.4.4 Trying a multiplicative model...... 27 2.5 Conclusion...... 29
3 Appendices 33 A Kendall’s Tau...... 33 B Irving’s Algorithm...... 36 C Bias and the Validity of Results...... 44 D Source Code...... 46
iii Chapter 1
Matching and College Housing Allotment
1.1 An Overview of Matching
While traditional economic theory is concerned with markets where prices play a key role in resource allocation, there exist markets in which there are no explicit prices that determine how agents are “matched” to these resources. This is particularly the case when the resources in question are other agents. Gale and Shapley (1962) provide the classic example of the marriage market, where men and women are matched to each other given that each group has preferences over the other. In such a market, there can be no explicit prices, although agents value other agents differently based on their preferences. Although a two-sided matching problem such as marriage serves as an excellent example of a market without prices, we can also have a one-sided matching market, where agents are matched to objects. Shapley and Scarf (1974) provide a model for such a market where agents are endowed with an indivisible good such as a house and have preferences over all the houses that are assigned to agents. In such a market, agents may have incentives to exchange houses in order to maximize utility. A real life example of such a situation occurs
1 on college campuses, where students change dorm rooms at the end of the year, but dorm rooms are usually not bought or sold with money. The key features which characterize a matching market include the lack of a pricing mechanism to clear the markets, the presence of heterogeneous agents and the problem of allocating indivisible resources to these agents. Economists who study these markets are often interested in designing an algorithm or a “mechanism” that generates allocations which satisfy certain important properties. This can be particularly challenging because of numerous theoretical constraints that prevent a mechanism from having all the desirable properties (see Roth and Sotomayor (1992), and Roth (1982)). We shall discuss the nature of some of these properties in section 1.3.
1.2 Applications of Matching Theory
Matching is not just a theoretical curiosity; while the game theoretical formulations of match- ing problems provide unique mathematical challenges and insights, economists are interested in the applications of the theory to market design. One of the first applications for matching was provided by Roth (1984) who looked into the problem of matching medical students to hospitals for internships. This problem can be classified as a two-sided, many-to-one matching problem. The problem is two-sided be- cause the agents can be split into distinct groups, in this case hospitals and medical students. It is also two-sided in the sense that both hospitals and doctors have preferences over each other. Since many doctors are matched to a single hospital, the problem is characterized as many-to-one matching problem. In the paper, Roth provided a history of the market and its idiosyncrasies while also presenting a game theoretic model that captures the essential elements of the market. Roth and Peranson (1999) actually presented a new mechanism for matching physicians to hospitals which was adopted by the National Resident Matching Program (NRMP).
2 Matching theory was also successfully applied in the context of school choice. In many U.S. school districts, children (and their parents) are often asked to submit the preferences over which school they would like to attend. Schools too have preferences over children, usually based on factors such as proximity, whether the child has siblings at the school, and his or her grades. Abdulkadiro˘gluand S¨onmez (2003) also formalized this problem as a two-sided, many-to-one matching problem. They they suggested that districts use a variant of the matching algorithm presented by Gale and Shapley (1962). New York and Boston are two cities which adopted these recommendations and recent empirical evidence suggests that the new mechanisms are effective in increasing the number of “good” matches.
1.3 College Housing Allotment and Stable Roommates
One interesting application of matching theory is in the context of assigning college students to dorm rooms. Interestingly, matching theory is applicable at two levels in this context. Firstly, the problem of students finding roommates is a two-sided, many-to-many (or one-to- one) matching problem: depending on the type of rooms available, students may be looking for many or just a single roommate. Ensuring optimal roommate matching is key to student happiness while also making sure that the administration is not burdened with mid-year room reassignments. Next, the student groups need to be assigned to dormitories. This is a one-sided matching problem as the students have preferences over rooms but the rooms do not have preferences over students. Most colleges have a process by which students get to pick rooms; these systems are usually designed to maximize fairness or some other objective. Abdulkadiro˘glu and S¨onmez(1999) look at some of the mechanisms utilized by colleges and evaluate them on their performance. Economists use a few typical metrics to evaluate such mechanisms. One is incentive compatibility or strategyproofness, which asks whether students have any incentive to misrepresent their preferences in order to “game” the system. The Colby
3 College housing allotment system, for example, is famously not incentive-compatible. The Colby dorms are stratified into various mutually exclusive housing types such as substance- free housing, quiet housing and traditional housing. Once students pick which type of housing they want, they can select rooms only from that housing type. However, students who do not intend to be quiet or substance free often opt into these specialty housing programs in order to get better rooms and flout the community rules. A mechanism designer could fix this problem by designing a system in which students have no incentive to lie about their preferences. Another metric for evaluating mechanisms is Pareto optimality or efficiency. Matches are not efficient when there exists another assignment of students to rooms where no student is worse off than in the current assignment and at least one student is strictly better off. In this situation, students may have incentive to exchange rooms until an efficient allocation is obtained. In order to avoid the administrative cost of supporting mid-year room re- allocations, colleges should strive to generate Pareto efficient room allocations. Efficiency is key in matching roommates to roommates as well. In the second chapter of this thesis, we examine a stronger version of Pareto efficiency in a specialized case of the roommate matching problem. In such a specialized (and somewhat unrealistic) setting, students can room with only one person and have preferences over all the other students who are looking for roommates. In this context, we can use stability as a metric to evaluate the quality of a matching. A matching (pairing) is unstable if two students who are not rooming with each other prefer each other as roommates to their actual roommates. Consequently, a matching is stable if no such two students exist. Abraham and Manlove (2004) proved that any stable matching is also Pareto optimal; the converse is not necessarily true. Gale and Shapley (1962) demonstrated that not every instance of the stable roommates problem admits a stable solution. In other words, for certain preference structures, no stable matching can be found. This fact naturally leads to some questions. What kind of preferences lead to a stable
4 matching? What is the proportion of stable roommates “games” that admit a solution? Or, equivalently, if students have arbitrary unspecified preferences over one another, what is the probability that a stable matching exists? This last question is important because it lends some insight into the nature of a roommate pairing. How likely are such pairings to fall apart? In an abstract mathematical setting, all preference structures are considered equally likely to occur. In real life however, students’ preferences over one another are guided by a variety of factors, and thus are not completely random. In particular, certain preference structures are more likely to occur than others. The goal of this thesis is to investigate whether the probability of finding a stable solution to the roommates game increases under more realistic settings. In the next chapter, we formalize the notion of a stable roommates game, restate the research question rigorously and lay out the methods and results of our analysis.
5 Chapter 2
Stable Roommates with Endogenous Preferences
2.1 Introduction
The stable marriage problem is a classic problem in matching theory which seeks to solve the problem of pairing men and women in a marriage market where each group has complete
and strict preferences over the other. Formally, the set of agents I = IM ∪ IW is partitioned
such that |IM | = |IW | and for any m ∈ IM there exists a preference relation m such that
for any w1, w2 ∈ IW : w1 m w2 or w2 m w1. The preference relation for any w ∈ IW is analogously defined. A solution to an instance of the stable marriage problem involves finding a stable matching. This is a matching in which no pair of men and women who are not matched to each other prefer each other to their partners under the matching. Gale and Shapley (1962) proved that any instance of the stable marriage problem (that is, a game with any set of complete and strict preferences) admits at least one stable matching and supplied an algorithm to find such a matching. In the same paper they discussed the stable roommates problem, a generalization of the marriage problem. In this problem agents are not divided into two groups like in the marriage problem. Instead agents have strict
6 preferences over every other agent. The differences between these two problems can be understood in graph theoretic terms. Figures 2.1a and 2.1b depict graph representations of the stable marriage and stable room- mates problems respectively. Notice how in the first figure, vertices can be partitioned into two sets such that edges from a vertex in one set can only map to vertices in the other set. This bipartite structure captures the nature of the stable marriage problem, where the vertices represent agents and the edges code preferences. In figure 2.1b, there is no such partitioning. In other words, a vertex is mapped to all other vertices through edges, repre- senting an agent’s preferences over all other agents. This captures the essence of the stable roommates problem. A real-world example of this problem occurs when college students attempt to find roommates to live in college dormitories.
(a) Complete bipartite graph representing the sta- (b) Complete graph representing stable room- ble marriage problem. The edges code preferences mates. The edges code preferences and the ver- and the vertices represent agents. tices represent agents.
Figure 2.1: Graphic theoretic interpretation of the stable marriage and roommate problems.
Unlike the stable marriage problem, the stable roommates problem does not automati- cally admit a solution. We construct a simple example below to demonstrate that solutions may not exist for instances of the problem. To make the analysis of the example more tractable, we can define the notion of a matching and a stable matching formally.
Definition 2.1.1. A matching µ : I → I is a symmetric 2-cycle permutation such that if µ(m) = w then µ(w) = m.
Definition 2.1.2. A matching µ is said to be unstable if and only if there exist i1, i2 ∈ I
such that µ(i1) 6= i2 and i2 i1 µ(i1) and i1 i2 µ(i2). A matching µ is said to be stable if it
7 is not unstable.
Example 2.1.1. (Gale-Shapley) Let A,B,C and D be agents with the following preferences-
ABCD
BCAA CABB DDDC
Proposition 2.1.1. There is no stable matching for this problem instance.