designing heaven’s will: lessons in market design … · highest governing positions in the...

22
DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN FROM THE CHINESE IMPERIAL CIVIL SERVANTS MATCH IN ´ ACIO B ´ O AND LI CHEN (Preliminary and Incomplete) Abstract. Many real-life random assignment problems rely on drawing lots publicly: sports competitions, public housing, etc. Such procedures are favored due to two im- portant characteristics, transparency and simplicity. In this paper, we describe one such mechanism, which was used for the assignment of civil servants from the late 16th century to early 20th century in China. Based on original documents and historical studies, we provide the first formal description of this procedure: candidates were assigned to jobs through a sequential lottery-based procedure, while at the same time they were prevented to be matched to incompatible jobs. We show that the procedure was inefficient, and document a change made in the 18th century that mitigated these inefficiencies. Based on what we determine to be the characteristics that were necessary for its success, we generalize the procedure used in China to a wider family of assignment problems where workers may have different sets of compatible jobs, and describe how to arrange the sets of urns and workers, so that the resulting random assignment mechanism produces matchings that are always efficient and satisfy equal treatment of equals. Keywords: Market design; Matching; Randomization; Sequential mechanism; Economic history In´ acio B´ o: WZB Berlin Social Science Center, Reichpietschufer 50, D-10785 Berlin, Germany; website: http://www.inaciobo.com; e-mail: [email protected]. Li Chen: University of Gothenburg, e-mail: [email protected]. We thank Umut Dur, Lars Ehlers, Rustamdjan Hakimov, Philipp Heller, and Utku ¨ Unver for helpful comments. We thank Rui Magone for assistance in our historical research of the Chinese civil servants system. 1

Upload: others

Post on 18-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGNFROM THE CHINESE IMPERIAL CIVIL SERVANTS MATCH

INACIO BO AND LI CHEN

(Preliminary and Incomplete)

Abstract. Many real-life random assignment problems rely on drawing lots publicly:

sports competitions, public housing, etc. Such procedures are favored due to two im-

portant characteristics, transparency and simplicity. In this paper, we describe one such

mechanism, which was used for the assignment of civil servants from the late 16th century

to early 20th century in China. Based on original documents and historical studies, we

provide the first formal description of this procedure: candidates were assigned to jobs

through a sequential lottery-based procedure, while at the same time they were prevented

to be matched to incompatible jobs. We show that the procedure was inefficient, and

document a change made in the 18th century that mitigated these inefficiencies. Based

on what we determine to be the characteristics that were necessary for its success, we

generalize the procedure used in China to a wider family of assignment problems where

workers may have different sets of compatible jobs, and describe how to arrange the

sets of urns and workers, so that the resulting random assignment mechanism produces

matchings that are always efficient and satisfy equal treatment of equals.

Keywords: Market design; Matching; Randomization; Sequential mechanism; Economic

history

Inacio Bo: WZB Berlin Social Science Center, Reichpietschufer 50, D-10785 Berlin, Germany; website:http://www.inaciobo.com; e-mail: [email protected] Chen: University of Gothenburg, e-mail: [email protected] thank Umut Dur, Lars Ehlers, Rustamdjan Hakimov, Philipp Heller, and Utku Unver for helpfulcomments. We thank Rui Magone for assistance in our historical research of the Chinese civil servantssystem.

1

Page 2: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 2

1. Introduction

Relying on randomness is common in real-life assignment and matching problems.

When it comes to how these allocations are determined, very often, the procedure in-

volves drawing matchings from urns. For example, public housing allocations in Brazil,

lotteries for automobile licenses in China, and FIFA group draws. Even though alterna-

tive computing methods are always available these days, urn-based methods are clearly

favored.

This paper documents, based on archived documents and historical studies, the urn-

based procedure that was used to assign selected individuals to governmental jobs. It

worked in a similar way to the contemporary cases mentioned above: names of candidates

and their assigned jobs were drawn randomly from urns in public. The procedure was

used for over 300 years, and only ended when the empire itself collapsed. Our historical

analysis indicates that two aspects of the lots-drawing procedure are of vital importance

for its longevity: the use of urns with contents filled in a clear and transparent way before

the matches are drawn, and simplicity in that compatible matches are final and not revised

afterwards. We take these two lessons and propose a procedure that generalizes the one

used in China while preserving these two properties, but extend its applications.

China has used, since as early as the 6th century, a merit-based and centralized sys-

tem for selecting, from the overall population, those who would work in the imperial

bureaucracy. While this selection, commonly referred to as the Civil Servants Exami-

nation System, determines who would be eligible for government jobs, the decisions of

who should go where were not institutionalized until the late 16th century, when the

lots-drawing procedure was introduced.

Under the lots-drawing procedure, every month, qualified candidates who passed the

examination system would go to the imperial palace, and their names would be written

on bamboo sticks that were then put into an urn. The jobs to be filled would also be

written on bamboo sticks and put into another urn. A supervisor would, one by one,

randomly drew a candidate and a job determining his match.

Not every candidate could be matched to every job, however. More specifically, candi-

dates could not be matched to jobs from their home regions. The way that this constraint

was accounted for was also simple: whenever job that is incompatible with the worker

being considered was drawn, a new one would be drawn until a compatible match was

found for the candidate, if any.

Although this procedure would produce assignments that satisfy this constraint, some

of them did not match as many candidates to jobs as possible, given the constraints. We

document the discussion of changes to the assignment procedure that took place not long

after the lots-drawing procedure was introduced. These changes could have reduced this

type of inefficiency. Nevertheless, these proposals involved candidates exchanging jobs

Page 3: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 3

that were already assigned and were not implemented. The only change documented in

the archives, took place in 1824. It consisted of separating the candidates into two urns.

One would have those who have incompatible jobs. Only after these prioritized candidates

finished, the rest of candidates could proceed.

We construct a theoretical model of the lots-drawing procedure, and show that the

change unambiguously improves the number of the resulting assignments. We also show,

however, that the change doesn’t guarantee that assignments will be maximum. By

keeping the two characteristics that we identify as being important for its success and

transparency, we extend the procedure to allow for sequences of urns of workers and of

jobs, and for arbitrary compatibilities between workers and jobs, in what we denote the

generalized lots-drawing procedure.

We show that, for any market, there is a sequence of urns of workers and jobs such

that every time the lots-drawing procedure is used, efficient (or maximum) assignments

are produced. Moreover, this can be done while satisfying a fairness condition: two

candidates who have the same set of compatible jobs have the same probability of being

matched to each job.

For the specific case of the Chinese civil servants match, We show that, if there is

no region with more jobs than candidates (when both are strictly positive), there is

an arrangement of only two urns of workers and two urns of jobs which always yields

maximum matchings.

We also provide a series of results which tell, for certain families of constrained assign-

ment problems, how to arrange urns of workers and jobs (or agents and object, etc) so

that the lots-drawing procedure can be used in the same simple and transparent way, but

always resulting in maximum matchings. We provide examples of real life assignment

problems, such as matching refugee families with different needs to hosting families, doc-

tors with different specializations to hospitals, and individuals to nearby public housing

developments. One way to see these results is that we are providing a “toolkit” for using

lots-drawing procedures in random assignment problems with constraints.

Finally, we show how workers’ preferences can be accommodated into lots-drawing

procedures, by allowing workers who are drawn from urns of workers to choose their jobs

(often from pre-determined constrained menus of jobs).

The remainder of the paper is as follows. Section 2 reviews the historical background

and describes the origins and details of the lots-drawing procedure. In section 3 we

introduce the the theoretical model and analysis of the original version of the lots-drawing

procedure used in China. In section 4 we introduce the generalized lots-drawing procedure,

its properties, and the solution for the Chinese civil servants problem. In section 5 we

present the family of multi-hierarchical constraints, and an efficient solution in terms of

sequences of urns for these problems. In section 6 we present another family of constraints,

denoted joint 2-constraints, as well as an efficient solution and examples of its applications.

In section 7 we show how preferences can be incorporated into a lots-drawing procedure.

Page 4: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 4

2. Historical Background

China has a long continuing history of state bureaucracy, starting as early as the 3rd

century BC (Creel, 1964). The vast bureaucracy needed to manage the empire relied

on the recruitment of professional functionaries. The way in which these functionaries

were selected changed multiple times in history. Initially, the positions in the adminis-

tration were given to aristocrats and passed on to their heirs. This was changed later

to a more merit-based system, in which aristocrats and local officials could recommend

talented people for the administration. Although at first this recommendation system led

to an improvement in the adequacy of the officials, its effectiveness was gradually eroded

as the recommended candidates were mostly descendants or relatives of aristocrats and

established officials. In response to that, a centralized procedure for selecting talents was

introduced in 587, known as the Civil Servants Examination System. This system was

based on a series of standardized written tests evaluated anonymously.1

The examination system and its various aspects have been extensively studied (Weber,

1951; Elman, 2000; Bai and Jia, 2016). This, however, is not the case for the proce-

dure that was used to determine the specific job to which the candidates were assigned.

Watt (1972) documents the practices related with the jobs of district magistrates, one

of the most common jobs given to those who passed the examinations. While Watt

(1972) provides an overview on the first-time appointments, promotions, demotions and

re-appointments of the district magistrates, it does not give details on the specific proce-

dure that was used to assign jobs to candidates.

Will (2002) is, to the best of our knowledge, the only study which offers details on the

origins and evolution of the assignment procedure, known as the lots-drawing procedure.

By the late 16th century, political clans controlled heavily who could be appointed where,

fragmenting power from the imperial government. To combat the situation, the imperial

government introduced in 1594 an appointment system via lotteries instead of personal

decisions. The new system hindered the possibility of these political clans to advance

their private interests through the appointments. Moreover, it established a reputation of

impartiality, as indicated by the following quote taken from the Biography of Sun Peiyang,

the minister of the Ministry of Civil Appoints who oversaw the reform:

He [the minister] was only annoyed by the demands of powerful courtiers.

Therefore he instituted the method of drawing lots (...) Candidates were

allowed to draw a lot in person; it was forbidden to ask for a replacement.

At once the selection of official enjoyed a considerable reputation for im-

partiality (...)

This lots-drawing procedure was initially used for low and middle rank positions, but

was also applied to high rank positions later. Indeed, in 1628, Emperor Chongzhen

resorted to the lots-drawing procedure when appointing the Grand Secretaries, the six

1See Appendix A for more details about the changes in the selection system.

Page 5: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 5

highest governing positions in the imperial government. Court bulletins edited by Sun

(1777) recorded that Emperor Chongzhen discussed why he resorted to this procedure in

a debate with ministers:

“Finding the right men for the grand secretariat benefits greatly the empire.

I do not dare to make the decision myself, therefore I ask the Heaven’s

will...”2

One important constraint of the appointments is what is called the rule of avoidance.

This rule, dating back to the 2nd century BC, aimed at preventing factionalism and

strengthening central control. Despite of various forms it took over time, for the period

that we consider, avoidance of localities is the most fundamental one. Specifically, it stated

that a candidate was prohibited to be appointed to his native province. The appointment

procedure therefore needed to take this into account.

The lots-drawing procedure took place every month. On even months, new appoint-

ments and promotions were made, and on odd months, replacements and reappointments.

The lot-drawing lasted usually for a day. Jobs were written on bamboo sticks and were

put into one urn. Similarly, the names of candidates were written on bamboo sticks and

put into another urn. From various sources including both the official guidelines for civil

appointments (zel) and the widely circulated handbook among candidates (Huang, 1694),

we know that the procedure worked as follows:

• The official in charge of the appointment first drew a stick from the urn of candi-

dates’ names, then drew a stick from the urn of jobs.3

• If the pair of candidate and job did not violate the rule of avoidance, then the

official would declare the match.

• If the pair did violate the rule of avoidance, then the stick of the job was put aside,

and the official would keep drawing a new job until the candidate did not need

to avoid it. After the match, the incompatible job(s) would be put back into the

urn, and the appointment resumed until all jobs or candidates were assigned or

the only left jobs and candidates were incompatible.

Although the procedure remained essentially the same for a long while, some changes

were considered.4 In particular, a solution for situations in which incompatible candi-

dates and jobs remained unmatched in the end was discussed in 1602, shortly after the

introduction of the procedure. The suggestion was that a candidate who either draws an

incompatible job or ends up with no compatible jobs left would be able to exchange his

assignment with some candidate matched with a compatible job in a mutually acceptable

way (Wu, 1609a). There is, however, no indication that such an exchange was carried out.

2In Imperial China, the emperor was regarded as the Mandate of the Heaven to rule “all under theHeaven”, therefore the emperor asked the Heaven’s will.3The procedure we described here was for a given type of job and its eligible candidates. The jobs werepartitioned into different types, and for each type a list of the names from the eligible candidates wereprepared, known as the monthly lists. See Appendix B for more details.4Zhang (2010) compiles descriptions of the procedure from the 17th century to early 20th century

Page 6: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 6

The only documented change to the entire procedure happened in 1824. Instead of all

candidates being matched at the same time, those who have incompatible jobs would draw

first. Only after these prioritized candidates finished drawing, the rest of the candidates

could proceed to draw a job, as described in DQHD (1886 edition), vol. 44:

“1824, it was approved after discussions, for the people who draw lots in

the monthly appointment, those who have home provinces to avoid draw

first. If they still draw a job that needs to be avoided, remove this job and

ask [the candidates] to draw another job. Until a [compatible] lot is drawn,

let those who do not need to avoid home provinces to draw.”

The lots-drawing procedure was used for over 300 years before its end in 1906, 6 years

before the demise of the 2000-year Chinese imperial history.

3. Theoretical Analysis

In this section, we introduce a theoretical model to analyze the lots-drawing procedure.

For convenience, we use the terminology of workers when referring to candidates. The lots-

drawing problem contains the following ingredients: a set of workers W = {w1, . . . , wn},a set of jobs J = {j1, . . . , jm}, and a compatibility correspondence C : W � J . We

abuse notation and denote the inverse correspondence also by C when the argument is a

job: C (j) = {w ∈ W : j ∈ C (w)}.For the specific case of the matching of civil servants in imperial China, the compatibil-

ity between jobs and workers is determined by the home region of a worker and the region

of the job. Let R = {r1, r2, . . . , r`} be the set of regions, and τ : W ∪J → R be a function

that determines the region a worker or job is from. The compatibility correspondence Cτ

that is induced by τ is, therefore:

Cτ (w) = {j ∈ J : τ(j) 6= τ(w)}

A market is a tuple 〈W,J, C〉. A matching is a function µ : W ∪ J → W ∪ J ∪ {∅},where for all w ∈ W , µ (w) ∈ J ∪ {w}, for all j ∈ J , µ (j) ∈ W ∪ {j}, and j ∈ J ,

µ (w) = j ⇐⇒ µ (j) = w. We may abuse notation and denote, for I ⊆ W ∪ J ,

µ (I) =⋃i∈I µ(i). The set of matchings is denoted by M. Let |µ| be the cardinality of

the matching, that is, |µ| = |{w ∈ W : µ(w) 6= ∅}|. We say that a matching µ is efficient

if for all µ′ ∈M, |µ| ≥ |µ′|.

3.1. The basic lots-drawing procedure. In the basic lots-drawing procedure, all work-

ers are put into one urn, and all jobs are put into another urn. Workers are drawn uni-

formly random from the urn of workers and matched with the first compatible job (if any)

drawn uniformly random from the urn of jobs. We can represent this by a realization

of chance P =(PW ,

(P J1 , P

J2 , . . . , P

Jn

)), where PW is a sequence including all workers

PW = (w1P , w

2P , . . . , w

nP ) and each P J

i a sequence including all jobs P Ji = (j1i , j

2i , . . . , j

ni ).

In the basic lots-drawing procedure, the set of possible realizations of chance include

Page 7: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 7

all permutations of n workers and all n-permutations of m jobs, each drawn uniformly

random.

The matching that is produced results from the following procedure:

• Round 1 ≤ t ≤ n: Worker wtP is drawn from the urn of workers. His match is the

the highest-ranked (with respect to its position in P Jt ) job in C (wtP ) which is not

yet matched. If, on the other hand, C (wtP ) is empty or contains only jobs that are

already matched, wtP is left unmatched.

Example 1. Consider a market of three workers {w1, w2, w3} and three jobs {j1, j2, j3}.Region r1 has one job (j1), r2 has one job (j2), r3 has one worker (w3) and one job (j3),

and region r4 has two workers (w1 and w2). Each worker is incompatible with his native

region.

Consider the following realization of chance: PW = (w1, w2, w3), P J1 = (j1, j2, j3),

P J2 = (j1, j2, j3), and P J

3 = (j1, j2, j3). This realization of chance results in the following

sequence of event. Worker w1 is picked first from the urn, and draws j1. Since he is

compatible with j1, he is matched. Next, worker w2 is drawn from the urn of jobs, and

draws job j2, which is also compatible with him. Finally, worker w3 is drawn, but the

only job left is j3, which is not compatible with him. Therefore, both worker w3 and job

j3 are left unmatched. Figure 1 illustrates this problem, where the dashed line indicates a

compatible pair, and the solid line indicates the realized match.

Workers Jobs

w3

w2

w1

j3

j2

j1

(a) Inefficient outcome

Workers Jobs

w1

w2

w3

j3

j2

j1

(b) Efficient outcome

Figure 1. Efficient or inefficient outcomes, depending on the realizationof chance.

Consider instead the following realization of chance: PW = (w3, w2, w1), P J1 = (j1, j2, j3),

P J2 = (j1, j2, j3), and P J

3 = (j1, j2, j3). When that’s the case, all workers are matched.

Worker w3 draws first, and draws j1, which is a compatible job, and is matched. Next, w2

draws j2 and is matched, and w1 draws j3 and is matched.

Page 8: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 8

The inefficiency illustrated above is a result that for a given order of drawing, a worker

who draws first could take away a job that is the only compatible job of the worker who

draws after him, while the current worker can be matched to other compatible job. In

this example, when it is the turn for w2 to draw a job, among the available jobs he is

compatible with both j1 and j3. If he picks j1, then w3 will be unassigned. However, as

we see, if he picks j3, then w3 can be still assigned.

One might wonder how bad the inefficiency deriving from the use of the lots-drawing

procedure could be. We show next that it can be quite extensive.

Proposition 1 (Upper bonds of inefficiency). For any market, the maximum loss of

efficiency in a lots-drawing procedure is 50% with respect to efficient matchings.

Example 1 suggests that one possible way to reduce inefficiency is to first match workers

with incompatible jobs. Indeed, w3 is the only worker with incompatible jobs, and if w3 is

guaranteed to draw first, then he is guaranteed to be matched to a compatible job. The

priority for workers w1 and w2 does not matter here, since they can always be matched to

a job regardless of who draws before them. In this market, if w3 is the first to draw, all

workers will be matched to jobs, for any outcome generated by the lots-drawing procedure.

3.2. Prioritizing “hard to match” workers. The only change made to the drawing

lots procedure in all of its history, which took place in 1824, determined that workers

who had incompatible jobs among the jobs in J would be drawn first. That is, two urns

would be used: one containing only workers who have incompatible jobs in J (if any),

and another urn with the remaining workers. Denote those in the first urn by WA and in

the second by WB. The modified procedure can be described, as follows:

• Round 1 ≤ t ≤∣∣WA

∣∣: Worker wiP , where i is the lowest value of i such that

wiP ∈ WA and wiP was not yet drawn, is drawn from the urn of workers. His

match is the the highest-ranked (with respect to its position in P Jt ) job in C (wiP )

which is not yet matched. If, on the other hand, C (wiP ) is empty or contains only

jobs that are already matched, wiP is left unmatched.

• Round∣∣WA

∣∣ ≤ t ≤ n: Worker wiP , where i is the lowest value of i such that

wiP ∈ WB and wiP was not yet drawn, is drawn from the urn of workers. His

match is the the highest-ranked (with respect to its position in P Jt ) job in C (wiP )

which is not yet matched. If, on the other hand, C (wiP ) is empty or contains only

jobs that are already matched, wiP is left unmatched.

Notice that, given a realization of chance P =(PW ,

(P J1 , . . .

)), this procedure is equiva-

lent to the basic lots-drawing procedure in which all workers inWA are shifted to the top in

PW , while keeping their relative order constant. For example, if PW = (w1, w2, w3, w4, w5)

and WA = {w2, w4}, the procedure that prioritizes “hard to match” workers is equiva-

lent to the basic one in which the realization of chance is P ′ =(PW ′,

(P J1 , . . .

)), where

PW ′ = (w2, w4, w1, w3, w5).

Page 9: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 9

We show below that, for every realization of chance, prioritizing “hard to match” work-

ers never leaves more workers unmatched, and may leave less workers unmatched.

Proposition 2. For every realization of chance P , prioritizing “hard to match” work-

ers never leaves more workers unmatched than using the basic lots-drawing procedure,

and there are markets and realizations of chance where it leaves strictly less workers un-

matched.

Proof. First, notice that since workers in WB are compatible with every job in J , the

only way that some worker in WB is left unmatched, in both procedures, is if all jobs are

matched. Next, we show that, for a given realization fo chance P , if a worker in WA is

matched under the basic lots-drawing procedure, it will also be matched when prioritizing

“hard to match” workers.

Consider any realization of chance P =(PW ,

(P J1 , . . .

)), and the realization of chance

P ′ =(PW ′,

(P J1 , . . .

))that is equivalent to prioritizing “hard to match” workers. Let

w ∈ WA be a worker who is matched under P . Notice that for every worker in WA, the

set of workers who are drawn from the urn of workers before him under P ′ is a subset of

those who are drawn under P .

Since the values of(P J1 , . . .

)remain the same, the set of jobs that are matched before

some worker from WA is drawn under P ′ is also a subset of the jobs that are matched

under P ′. This is the case since the job that is matched to a worker wiP only has a

lower rank in P Ji when all higher-ranked jobs were already matched. As a result, the jobs

matched to workers in WA are weakly higher-ranked in P J and therfore a subset of those

when the workers in WA are not matched first.

Finally, consider Example 1 and the first realization of chance that is considered. There

the basic lots-drawing procedure left one worker unmatched. The second realization of

chance considered is in fact the one that is equivalent to prioritizing the “hard to match”

worker w3, and there no worker is left unmatched. �

4. The generalized lots-drawing procedure

In this section we generalize the lots-drawing procedure to allow for sequences of urns

of both workers and jobs. It has as special cases both the basic lots-drawing procedure

and the one in which “hard to match” workers are prioritized, and also preserves the two

characteristics that we inferred were important for this family of assignment procedures:

it is based on drawing matches from urns, and not revising matches once a compatible

match was drawn.

In the generalized lots-drawing procedure, workers are split into a sequence of urns

ϕW =(ϕW1 , ϕ

W2 , . . . , ϕ

Wp

), and jobs into a sequence of urns ϕJ =

(ϕJ1 , ϕ

J2 , . . . , ϕ

Jq

).

The procedure then goes as follows:

• Draw randomly a worker from the first urn, ϕW1 , and then draw randomly a job

from the first urn of jobs, ϕJ1 .

Page 10: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 10

– If the worker is compatible with the job, then match the worker to the job.

– Otherwise, draw another job until a compatible one is found. If all jobs in

ϕJ1 were considered, pick jobs at random from the second urn ϕJ2 , and so on,

until a compatible job is found. If no such job is found after going all the way

to urn ϕJq , then the worker is left unmatched.

• Repeat this procedure until all workers in ϕW1 were drawn. Then proceed to pick

workers from the second urn of workers, ϕW2 , and proceed as above. The process

ends whenever all jobs were matched or all workers are drawn.

For a given realization of chance P =((w1

P , w2P , . . . , w

nP ) ,(P J1 , P

J2 , . . . , P

Jn

)), where

P Ji = (j1i , j

2i , . . . , j

ni ), a pair of sequences of urns ϕW =

(ϕW1 , ϕ

W2 , . . . , ϕ

Wp

)and ϕJ =(

ϕJ1 , ϕJ2 , . . . , ϕ

Jq

)have a realization of chance P ′ =

(PW ′,

(P J1′, P J

2′, . . . , P J

n′)) that, under

the basic lots-drawing procedure, equivalent, and can be constructed as follows:

• Under PW ′, all workers in ϕWk precede all workers in ϕWk+1. The order between the

workers in each urn, however, is the same as in PW .

• For each worker wi, the sequence P Ji′ is such that all jobs in ϕJk precede all jobs

in ϕWk+1. The order between the jobs in each urn, however, is the same as in P Ji .

Now, we can define an efficient sequence of urns.

Definition 1. A sequence of urns (ϕW , ϕJ) is efficient if for every realization of chance,

the outcome of the generalized lots-drawing procedure using this sequence is efficient.

In the example below, we show that, even for simple problems, splitting only workers

in multiple urns or only jobs in multiple urns may not be enough to guarantee efficiency.

Example 2 (Prioritizing one side is not sufficient). Consider a Chinese civil servants

market in which there are three workers and three jobs. Worker w1 and job j1 belong to

r1, w2 and j2 belong to r2, and w3 and j3 belong to r3. Here, therefore, every worker has

one incompatible job. Clearly, there are matchings in which all workers are matched to a

job. Therefore, for a sequence of urns to be efficient, then in every realization of chance

it should match all workers and jobs. We will show, however, that if ϕW has only one urn

or if ϕJ has only one urn, then there’s always a realization of chance that will leave one

worker unmatched.

First, consider the case in which there is only one urn of jobs. That is, ϕJ = ({w1, w2, w3})and ϕW is some sequence of urns partitioning W . Let PW be any realization of chance

and PW ′ be the realization of chance that is equivalent to PW under the basic drawing lots

procedure. Let w∗ be the last worker in PW ′, that is, the last worker to be drawn from an

urn under the sequence of urns (ϕW , ϕJ) under the realization of chance PW , and let j∗

be the job that is incompatible with w∗.

Let P J1 = P J

2 = P J3 = (. . . , j∗). That is, the last job that is drawn, regardless of the

worker, is j∗. Then, under this arbitrary sequence of urns, this realization of chance is

such that the last worker drawn from the urns of workers is w∗, and the last job drawn

Page 11: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 11

from the urn of jobs is j∗. Since they are incompatible, they can’t be matched, and both

will remain unmatched.

Similarly, consider now the case in which there is only one urn of workers, and some

arbitrary sequence of urns of jobs. Let j∗ be a job in the last urn in ϕJ , and w∗ be the

worker incompatible with j∗. Let P be a realization of chance in which j∗ is the last job

in P J1 , P J

2 and P J3 , and w∗ is the last worker in PW . By definition, P ′, which is the

equivalent realization of chance of P under the basic drawing lots procedure, j∗ is also the

last job in P J1′, P J

2′ and P J

3′, and w∗ the last worker in PW ′. So here, once again, w∗ will

be the last worker to be drawn, and j∗ the last job to be drawn, being both left unmatched.

We can conclude, therefore, that in general, efficient sequences of urns involve multiple

urns of workers and multiple urns of jobs. One question one may have next is whether,

for every market, there is an efficient sequence of urns. The answer is yes, as we show

below.

Proposition 3. For every market, there exists an efficient sequence of urns.

Proof. Let 〈W,J, C〉, where W be any given market, and µ∗ be an efficient matching in

that market. Since efficiency depends on the cardinality of the matching, an efficient

matching always exists. Let W ∗ be the set of workers in W who are matched to some job

under µ∗. That is, w ∈ W ∗ ⇐⇒ µ∗(w) 6= ∅. Let W ∗ = {w∗1, w∗2, . . . , w∗k}.Consider now the sequence of urns (ϕW∗, ϕJ∗), where ϕW∗ = ({w∗1} , {w∗2} , . . . , {w∗k} ,W\W ∗)

and ϕJ∗ = ({µ∗ (w∗1)} , {µ∗ (w∗2)} , . . . , µ∗ (w∗k) , J\µ∗ (W ∗)). That is, the first urn of work-

ers has only worker w∗1 and the first urn of jobs only job µ∗ (w∗1), the second urn of workers

has only worker w∗2 and the second urn of jobs only job µ∗ (w∗1), etc. The last urn of work-

ers has all workers in W\W ∗, that is, the workers who are left unmatched under µ∗, and

the last urn of jobs has all the jobs in J\µ∗ (W ∗), that is, the jobs that are left unmatched

under µ∗. Clearly, this sequence of urns will, for any realization of chance, match all

workers in W ∗ to their jobs in µ∗ and, since we assumed that µ∗ is efficient, will also leave

all workers in W\W ∗ and jobs in J\µ∗ (W ∗) unmatched. �

Proposition 3 doesn’t provide a useful solution for the problem at hand, but simply

shows that a solution always exists. The main problem with this solution is that it is

absolutely deterministic: the matching produced is always µ∗, with no role for randomness.

There are two ways in which we can formalize the problem with this solution. One is that

it is “not random enough”, in that workers are always matched to the same job, if any.

The second one is that it is “unfair” in that the workers who are left unmatched under µ∗

are always left unmatched, even if there are other efficient matchings in which they are

not left unmatched.

We will approach these problems in the following way. In the lots-drawing procedure,

randomness is “increased” when more workers are combined into the same urn. And a

lots-drawing procedure satisfies “equal treatment of equals” if, for any two workers who

Page 12: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 12

have the same set of compatible jobs, the probability of being matched to each job is the

same.

Before we proceed into these issues, however, a more fundamental question should be

answered: does the generalized lots-drawing procedure limits our ability to satisfy some

reasonable conditions on the distributions of matchings in the random distribution that

results from its use? In other words, by using the generalized lots-drawing, are we limiting

our ability to generate certain random outcomes? The answer is, unsurprisingly, yes, as

shown in the example below.

Example 3 (lots-drawing procedure limits outcomes). Let W = {w1, w2, w3} and J =

{j1, j2}. Worker w1 is only compatible with job j1, worker w2 is compatible with both j1

and j2, and worker w3 is compatible only with job j2. There are, therefore, three efficient

matchings: µ1, µ2, and µ3:

µ1 =

(w1 w2 w3

j1 j2 ∅

)µ1 =

(w1 w2 w3

∅ j1 j2

)µ1 =

(w1 w2 w3

j1 ∅ j2

)One simple notion of fairness that a designer might want to obtain is that every efficient

matching is obtained with the same probability. That implies that worker w1 must be

matched to j1 with probability 2/3 and be left unmatched with probability 1/3. Worker

w2 must be matched to j1 with probability 1/3, to job j2 with probability 1/3 and be left

unmatched with probability 1/3. Finally, worker w3 must be matched to j2 with probability

2/3 and be left unmatched with probability 1/3. These are, of course, not independent

probabilities, but are the ex-ante values that the procedure must have if it is randomizing

uniformly among the three efficient matchings.

First, let’s try putting all workers into the same urn. Then, worker w2 will be drawn

with probability 1/3. It must then be that he will be matched to j1, j2 or be left unmatched

with the same probabilities. This is, of course, impossible regardless of the sequence of

urns of jobs, since w2 is compatible with both jobs and will always be matched. So all

workers in the same urn cannot result in the desired distribution. A similar reasoning

holds for any sequence of urns that put worker w2 in the first urn. Since he is compatible

with all jobs, he will be matched to some job with probability one.

Next, let’s try putting just worker w1 into the first urn of workers. Then w1 will be the

first worker to be drawn with probability one, and must be matched to job j1 with probability

2/3. Clearly, there’s no sequence of urns for the jobs that results in that probability, so

putting just worker w1 into the first urn doesn’t result in the desired distribution. By

symmetry, putting only worker w3 into the first urn gives the same negative result. The

last possibility is to put workers w1 and w3 into the first urn and w2 into the last urn.

Since w1 and w3 are compatible with a disjoint set of jobs, regardless of the sequence

of urns of jobs, they will both be matched, and w2 will never be matched, which again

contradicts the desired distribution.

Page 13: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 13

Example 3 shows, therefore, that there is a cost associated with the use of lots-drawing

procedures when compared with the use of, for example, computer algorithms. This

shouldn’t come as a surprise, given the simplicity of the mechanics involved and the

limitation of not revising matchings during the draws. As we will show, however, the

generalized lots-drawing procedure is still able to satisfy a natural fairness condition,

and result in efficient matchings for a wide class of problems. First, we show that the

generalized lots-drawing procedure is not only able to always generate efficient matchings

(as shown in Proposition 3, but also do that while satisfying equal treatment of equals.

First, let’s define the property.

Definition 2. A sequence of urns satisfies equal treatment of equals if for any pair

of workers w,w′ ∈ W where C (w) = C (w′), and any job j ∈ J , w and w′ have the same

probability of being matched to j, when using the generalized lots-drawing procedure.

Before we proceed to the next result, we derive the following lemma, which gives the

essential ingredient for evaluating and designing sequences of urns.

Lemma 1. If the outcome of a lots-drawing procedure was inefficient, then there are two

workers w,w′ and two jobs j, j′ where (i) w ∈ C(j) ∩ C(j′), w′ ∈ C(j)\C(j′), and w was

matched to j before w′ was drawn.

Proof. Sketch: By Berge’s lemma (Berge, 1957), a matching is maximum if and only if

there is no augmenting path in it. Therefore, the matching at issue has an augmenting

path, and the statement above is a consequence of that fact. �

Lemma 1 points to the essential source of inefficiency in the drawing lots procedure:

sometimes a worker can be matched to multiple jobs, but by being matched to some of

them will leave no compatible jobs for a worker who draws later, while if she was matched

to some other job, that worker would have a job available and would then be matched.

Definition 3. Given a sequence of urns(ϕW , ϕJ

)and a realization of chance P =(

PW ,(P J1 , . . . , P

Jn

)), we say that a worker wi exerts negative externality if there

are j, j′ ∈ J such that:

• When using the sequence of urns(ϕW , ϕJ

), the realization of chance

(PW , P J

)results in the matching µ, where µ(w) = j.

• When using the sequence of urns(ϕW , ϕJ

), the realization of chance

(PW , P J ′,

),

where P J ′ is the same as P J , but with the positions of j and j′ switched in P Ji′,

results in the matching µ′, where µ(w) = j′.

• |µ| > |µ′|.

That is, a worker w exerts negative externality when, fixing the realization of chance

in every aspect except for the job to which w is matched to j′ instead of j, the resulting

matching has a lower cardinality. Clearly, by definition, if a sequence of urns is efficient,

then no worker can exert a negative externality, for any realization of chance. One may

Page 14: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 14

have, however, inefficient sequences of urns in which no worker ever exerts negative ex-

ternality. So although no worker exerting negative externality is necessary for efficiency,

it is not sufficient.

The proposition below shows that, in addition to always being able to produce effi-

cient matchings, the generalized lots-drawing procedure can do so while satisfying equal

treatment of equals.

Proposition 4. Let (ϕW , ϕJ) be an efficient sequence of urns that doesn’t satisfy equal

treatment of equals. There is another sequence of urns (ϕW ′, ϕJ ′) that uses no more urns

than (ϕW , ϕJ), is efficient, and satisfies equal treatment of equals.

Proof. The proof works as follows. We take any given efficient sequence of urns and a type

of workers which is split into two or more urns, and focus on any two of these urns. We

then show that, starting from the assumption that no worker exerts externalities under

the urn we start from, this will also be true when either we combine the workers of that

time in the urn above with the one below or from the urn below with the urn above,

without creating any possible negative externality.

This implies that we can combine 2 by two, which then implies that everything can be

combined. �

Proposition 4 shows not only that under the generalized lots-drawing procedure effi-

ciency doesn’t come at the cost of fairness (in the sense of the definition considered), but

that it also doesn’t come at a cost of a “reduction in the randomization”: for any sequence

of urns that is efficient, there is a sequence of urns, with the same number of urns, that is

not only efficient but that also satisfies equal treatment of equals.

4.1. A solution to the Chinese civil servants match. We now show that, whenever

the market satisfies a relatively mild condition, there exists an efficient sequence of urns

involving only two urns of workers and two urns of jobs. First, we introduce some notation

that will be necessary. Let W i be the set of workers from region ri, and J i the set of jobs

from region ri. We also denote by R+ ⊆ R the set of regions for which there are both

workers and jobs from it. That is, for every r ∈ R+, there are w ∈ W and j ∈ J such

that τ(w) = τ(j) = r. We also denote by W+ and J+ the sets of workers and jobs from

regions in R+, respectively, J− = J\J+, and W− = W\W+.

The condition for which our solution is efficient is the one that follows.

Definition 4. A market is over-demanded if for all ri ∈ R+ , |W i| ≥ |J i|. That is,

there is no region in R+ with more jobs than workers.

Without loss of generality, let R+ = {r1, r2, . . . , rk}, and |W 1| ≥ |W 2| ≥ · · · ≥∣∣W k

∣∣.That is, the regions with both jobs and workers in the market are regions r1 to rk, and

these regions are also in weakly decreasing number in number of workers in the market.

Consider the following sequence of urns:

Page 15: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 15

ϕW∗ =(W 1,

{W 2 ∪ · · · ∪W k ∪W−}) and ϕJ∗ =

({J2 ∪ · · · ∪ Jk ∪ J−

}, J1)

Theorem 1. If the market is over-demanded, the sequence of urns (ϕW∗, ϕJ∗) is efficient.

Moreover, if |J1| ≤∑k

i=2 |W i| then every job is matched in every realization of chance.

Proof. We first show that all jobs in{J2, . . . , Jk

}will be matched. If there is an un-

matched job in that set, then it must be that all workers compatible with that job

are matched to jobs in{J2, . . . , Jk

}, with at least one left empty. That is, for any

J t ∈{J2, . . . , Jk

}, where the unmatched job is in J t, the following must hold:

∣∣J2∣∣+∣∣J3∣∣+ · · ·+

∣∣Jk∣∣ > ∣∣W 1∣∣+∣∣W 2

∣∣+ · · ·+∣∣W t−1∣∣+

∣∣W t+1∣∣+ · · ·+

∣∣W k∣∣

Since the market is over-demanded, the right hand side is smallest when t = 2:

∣∣J2∣∣+∣∣J3∣∣+ · · ·+

∣∣Jk∣∣ > ∣∣W 1∣∣+∣∣W 3

∣∣+∣∣W 4

∣∣+ · · ·+∣∣W k

∣∣Rearranging, we have:

(∣∣J2∣∣− ∣∣W 1

∣∣)+(∣∣J3

∣∣− ∣∣W 3∣∣)+ · · ·+

(∣∣Jk∣∣− ∣∣W k∣∣) > 0

Which is a contradiction. Finally, let’s consider the jobs in J1. First, if no job in J1 is left

unmatched, then all jobs are matched to workers and the matching is maximal. Suppose

then that some job in J1 is left unmatched. The first thing to notice is that it must be the

case that all workers in{W 2, . . . ,W k

}are matched. Otherwise, there would be no job

left unmatched in J1. There are two cases to consider. First, there is no worker in W 1 left

unmatched. If that’s the case, then all workers are matched and therefore the matching

is maximal. Second, there is some worker in W 1 left unmatched. Since these are at the

top of the prioritization of workers, it must be that workers in W 1 completely matched

all jobs in{J2, . . . , Jk

}. In that case, however, by the time the workers in

{W 2, . . . ,W k

}are matched, all jobs available (those in J1) are compatible. Here if |J1| ≤

∑ki=2 |W i|, we

have a contradiction with some job in J1 being left unmatched, in which case all jobs are

matched.

Finally, if |J1| >∑k

i=2 |W i| then it is still possible that some job in J1 may be left

unmatched. By Berge’s lemma (Berge, 1957), a matching is maximum if and only if there

is no augmenting path in it. An augmenting path is a path with an odd number of edges

in which both ends are unmatched vertices and the edges alternate between edges inside

and outside the matching. For this problem, this implies that the resulting matching is

not maximum if and only if there is an augmenting path connecting an unmatched worker

in W 1 and an unmatched job in J1 . An alternating path that starts at a worker in W 1,

however, never includes an element of J1. To see this, consider an unmatched worker in

W 1. That worker is connected to the jobs in{J2, . . . , Jk

}. Since the next edge in the

augmenting path must be in the matching, it connect next to a worker in W 1 (since all

Page 16: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 16

τ1

τ1, τ2 τ1, τ3

τ1, τ2, τ4 τ1, τ3, τ5 τ1, τ3, τ6

τ7

τ7, τ8, τ9

τ7, τ8, τ9, τ10

ϕW1

ϕW2

ϕW3

Figure 2. Example of Multi-Hierarchical constraints

jobs in{J2, . . . , Jk

}are matched to workers in W 1). Therefore, if we keep adding edges to

the augmenting path we will always alternate between vertices in W 1 and{J2, . . . , Jk

}.

Therefore, there is no augmenting path connecting an unmatched worker in W 1 and an

unmatched job in J1, a contradiction with the matching not being maximal. �

Theorem 1 shows that an efficient priority mechanism exists for a relatively large set

of problems, involving only two urns for each side of the market. While the application

of this result for other contemporary assignment problems may be limited, we believe

that it represents an instructive example of how lots-drawing procedures provide enough

flexibility for generating efficient outcomes under relatively complex constraints, and that

solutions involving a small number of urns may be among these solutions.

5. Multi-Hierarchical constraints

In this section we provide efficient sequence of urns for a large family of markets,

which we denote by markets with multi-hierarchical constraints. Below we define what

hierarchical constraints are.

Definition 5. A market 〈W,J, C〉 has multi-hierarchical constraints if there exists a

partitioning of the workers in W{W 1,W 2, . . . ,W k

}, where each element of the partition

is a node of a forest, and for every pair W i and W j, if W i is the parent of W j, then for

every wi ∈ W i and wj ∈ W j, C (wi) ⊆ C (wj).

That is, a market has multi-hierarchical constraints if we can put the workers in a forest

in which every worker at some node is compatible with all the jobs that all workers up the

path to the root are compatible with. Notice that, by the definition of the partitioning

of W that results in the forest, if two workers have the same set of compatible jobs, they

are in the same element of the partition.

Figure 2 shows an example of multi-hierarchical constraints.

These markets have efficient sequences of urns involving multiple urns of workers and

a single urn of jobs, as shown below.

Let 〈W,J, C〉 be a market with multi-hierarchical constraints, and{W 1,W 2, . . . ,W k

}be the partitioning of workers that results in the tree in the definition above. We can

construct a sequence of urns of workers ϕW by using the follwowing procedure:

• Let ϕJ = (J), and ϕW1 have all workers at the roots of the forest.

Page 17: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 17

• For t = 2, . . ., let ϕWt have all workers in nodes that are children of the nodes in

ϕWt−1.

As we show below, the sequence of urns above is efficient.

Theorem 2. If a market has multi-hierarchical constraints, the sequence of urns(ϕJ , ϕW

)above is efficient, and satisfies equal treatment of equals.

Proof. Sketch: Inefficiency comes from a worker, at some point, being compatible with

two jobs, one of them blocking a future draw, and another not blocking. This is never

the case: current matches always block future draws. �

One family of allocation problems that has multi-hierarchical constraints are those

in which the jobs provides certain numbers of different resources and the workers have

different requirements in terms of number of resouces.

Example 4. Consider a problem in which there is a list of resources A = {a1, a2, . . . , ak},each job j has a vector of resource availabilities

(aj1, a

j2, . . . , a

jk

)and each worker w

has a vector of resource demands (aw1 , aw2 , . . . , a

wk ). A job is compatible with a worker

if, for every resource, demands are not larger than the availabilities.

Clearly, this market has multi-hierarchical constraints, in which a pair of workers w,w′

where (aw1 , aw2 , . . . , a

wk ) ≥

(aw

′1 , a

w′2 , . . . , a

w′

k

)implies that w is in an ancestral node to w′ in

a forest.

6. Joint 2-constraints

Another family of markets for which we can describe efficient sequences of urns is what

we call joint 2-constraints markets.

Definition 6. A market 〈W,J, C〉 has joint 2-constraints if there exists a partitioning

of the jobs{J1, J2, . . . , Jk

}, such that for every worker w ∈ W , either (i) there is an i

such that C (w) = J i or (ii) there are j, ` such that C (w) = J j ∪ J `.

When markets have joint 2-constraints, one can easily check that in general sequences

of urns involving only one urn of workers or only one urn of jobs may not be efficient. In

fact, the solution that we give below involves multiple urns on both sides.

Proposition 5. Let 〈W,J, C〉 be a market with joint 2-constraints, and{J1, J2, . . . , Jk

}be

the associated partition of jobs, and let τi = {w ∈ W : C(w) = J i} and τi∪j = {w ∈ W : C(w) = J i ∪ J j}.Then the following sequence of urns is efficient:

ϕW1 =k⋃i=1

τi and ϕWj =k⋃

i=j+1

τj∪i for j = 2, . . . , k

ϕJi = J i for i = 1, . . . , k

Proof. Take the figure in Example 5 as an example. The first urn of workers is straight-

forward: none of them is compatible with each other, and they are strictly more restricted

Page 18: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 18

τO τN τF τS

τO∪N τO∪F τO∪S

τN∪F τN∪S

τF∪S

ϕW1

ϕW2

ϕW3

ϕW4

JOϕJ1

JNϕJ2

JFϕJ3

JSϕJ4

Figure 3. Efficient sequence of urns for market with joint 2-constraints(Example 5)

than later urns. For the other ones, the order of urns of jobs makes such that a worker can

only block a job in a later urn after all the jobs ”for that urn of workers” are gone. But

when that’s the case, these workers are equivalent to those with only one set of compatible

jobs, so there’s no negative externality. �

One practical example of a market with joint 2-constraints is one in which jobs have

some skills requirements, and workers may have one or two skills, as shown in the example

below.

Example 5. Let doctors have specializations in either Orthopedics (τO), or Neurology

(τN). In addition to that, some doctors may also have a certificate in Family Medicine

(τF ) or Surgery ((τS). Hospitals have jobs for Orthopedics (JO), Neurology (JN), and

also positions that require only a certificate in Family Medicine (JF ) or Surgery (JS).

Figure 3 shows the structure of an efficient sequence of urns for this problem.

Other assignment problems can also be modeled as markets with joint 2-constraints.

The example below shows one in which public housing is assigned taking distance from

the current residence into consideration.

Example 6. Consider a problem in which public houses are to be awarded to individ-

uals. There is a set H of houses, and a set I of individuals. Individuals can only be

awarded a house if he/she currently lives within 1km of the new development. Houses

and individuals are distributed such that every individual lives within 1km of at most two

house developments. This is a market with joint 2-constraints. Figure 4 shows an ex-

ample. The set of houses is partitioned as I = H1 ∪ H2 ∪ H3 ∪ H4, and individuals are

I = I1 ∪ I2 ∪ I3 ∪ I4 ∪ I5 ∪ I6∪, where I1 = τ2, I2 = τ1∪2, I3 = τ1, I4 = τ1∪4, I5 = τ4,

I6 = τ3, and I7 = τ2∪3.

Figure 4 shows an efficient sequence of urns for that market.

7. Incorporating preferences

For some problems, one could think about extensions of the lots based procedure that

allow for the workers to express their preferences, while still satisfying efficiency objectives.

More specifically, when a problem has multi-hierarchical constraints, there’s a natural

Page 19: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 19

H1 H2

H3H4

I1I2I3

I4

I5

I6

I7

Figure 4. Market with joint 2-constraints: Public Housing

I1 I3 I5 I6

I2 I4

I7

ϕW1

ϕW2

ϕW3

H1ϕJ1

H2ϕJ2

H3ϕJ3

H4ϕJ4

Figure 5. Efficient sequence of urns for a Public Housing market (Example 6)

method to implement assignments that are maximal, Pareto efficient and that satisfies no

ex-ante envy among equals.

Here we will assume that each worker w has strict preference �w over the set of jobs J .

Definition 7. Let(ϕW , ϕJ

)be a sequence of urns. The draw-a-worker-pick-a-job

procedure works as follows.

• Pick a worker w from the urn of workers ϕWi with the lowest value of i such that

ϕWi is not empty.

• Let w choose any job from the urn of jobs ϕJj , where j is the lowest value of j such

that ϕJj still has jobs in C(w), if any.

Since matches are not revised, it is always in the best interest of a worker to be truthful

about the job that they pick.

Lemma 2. Workers have a dominant strategy to choose truthfully their jobs under the

draw-a-worker-pick-a-job procedure.

When workers follow this simple and predictable behavior, the matching is maximal.

Moreover,

Page 20: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 20

Proposition 6. Let(ϕW , ϕJ

)be an efficient sequence of urns, where

∣∣ϕJ ∣∣ = 1. If workers

follow the dominant strategy of choosing truthfully their jobs, the draw-a-worker-pick-a-job

yields matchings that are maximum and Pareto efficient.

References

Qin ding li bu quan xuan ze li (Rules and Regulations for the Appointments by the Ministry

of Civil Appointments), author=QDLBQXZL, volume=43, Year=1886 edition,. 2

Ying Bai and Ruixue Jia. Elite recruitment and political stability: The impact of the

abolition of china’s civil service exam. Econometrica, 84(2):677–733, 2016. 2

Claude Berge. Two theorems in graph theory. Proceedings of the National Academy of

Sciences, 43(9):842–844, 1957. 4, 1

Ding Chen. Donglin liezhuan. Zhongguo shudian, 1991. C

Herrlee G Creel. The beginnings of bureaucracy in china: The origin of the hsien. The

Journal of Asian Studies, 23(2):155–184, 1964. 2

DQHD. Da qing hui dian (The Collected Institutes), volume 44. 1886 edition. 2

Benjamin A Elman. A cultural history of civil examinations in late imperial China.

University of California Press, 2000. 2

Liuhong Huang. Fu hui quan shu (A Complete Book Concerning Happiness and Benevo-

lence). reprint of Japanese 1850 edition, Kyuko shoin, Tokyo, 1694. 2

Defu Shen. Wanli ye huo bian. Zhonghua shuju, 1997. C

Chengze Sun. Chun ming meng yu lu. Siku quanshu (Complete Library in Four Treasures),

Vol. 24, 1777. 2

John Robertson Watt. The district magistrate in late imperial China. Columbia University

Press, 1972. 2, B

M. Weber. The religion of China: Confucianism and Taoism. Free Press paperback. Free

Press, 1951. 2

Pierre-Etienne Will. Creation, conflict, and routinization: The appointment of officials

by drawing lots, 1594–1700. Ming Qing Yanjiu, pages 73–121, 2002. 2

Liang Wu. Wanli shuchao (Memorials of Wanli Court), volume 59. 1609a. 2

Liang Wu. Wanli shuchao (Memorials of Wanli Court). Vol. 21, 1609b. C

Zhenguo Zhang. A study on the Civil Appointments System in Qing Dynasty. PhD thesis,

Nankai University, 2010. 4

Page 21: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 21

Appendix

Appendix A. Selection systems before the Civil Servants Examination

System

Appendix B. The Monthly Lists

Apart from passing the imperial examinations, there were other channels through which

candidates could qualify for the appointment. There were in total six categories of candi-

dates by their exam degrees and means of qualification. Within each category, candidates

were ranked by ability, for example exam grades. The official regulations for civil servants

appointment specified for each type of posts, which categories of candidates were eligible

(could be multiple), and how many for each category. The Ministry of Personnel then

prepared a list for each type of vacant posts. Only the candidates on the list would be

called to the forbidden city to attend the appointment, while the candidates not on the

list waited in the province of residence.

Take for example the post of district magistrates, which offered the largest number of

positions(Watt, 1972). The monthly list in the even months contained five metropolitan

graduates, five provincial graduates, four who qualified by financial contributions, and

three serving officials who qualified for promotions, making the list in total seventeen

candidates. All candidates would be chosen by their order within the category to which

they belong. After one monthly list, two new metropolitan graduates and two local

educational officials who had completed a six-year term of office would be added to the list.

After two monthly lists, one provincial graduate instructor would be added. After three

monthly lists, one provincial graduate who was Han banner-man, one palace instructor

and some other categories would also be added. Thus, the district magistrate’s list for

even months were often around twenty candidates.

The district magistrate’s list in the odd months consisted of four officials who had

completed mourning and reapplied for substantive appointment, two officials who had

been impeached but were qualified for substantive reappointment, four who qualified

financial contributions, four metropolitan graduates, two new metropolitan graduates,

four provincial graduates, two local educational officials who had completed six years’

service, and one salt-administration official who had completed five year’s service, in total

twenty three.

Appendix C. Early Challenges in the lots-drawing procedure

Rule of Avoidance. One challenge was how to implement the rule of avoidance. Soon

after the new procedure became effective, it became clear that the random procedure

could assign a candidate to a position that violates the rule of avoidance. However,

no amendment was made until the next dynasty, Qing Dynasty, about two centuries

later. In fact, Li Dai, the president of the Ministry of Personnel succeeding Sun Peiyang,

commented that it would be a pain to follow the rule of avoidance. When there were

Page 22: DESIGNING HEAVEN’S WILL: LESSONS IN MARKET DESIGN … · highest governing positions in the imperial government. Court bulletins edited bySun (1777) recorded that Emperor Chongzhen

DESIGNING HEAVEN’S WILL 22

candidates who were allocated to regions they did not suit, but they were willing to

exchange, then the involved candidates and regions needed to be notified and evaluated,

which required a tremendous amount of coordination.

Preferences. The second challenge comes from the fact the preferences of candidates

were ignored. A candidate could draw a post in a location that he knew nothing about

the local customs, and had difficulty even in understanding the local dialects. Yet, he

was obliged to take up the post if he wanted to remain a civil servant (Shen, 1997).

However, allowing for preferences was considered to cause undesirable consequences. In

general, candidates from one region would prefer posts in their own region, respecting

preferences would breed factionalism and cronyism. On the other hand, with the growing

concerns over the difficulty in governing a randomly allocated positions, compromises had

been made in the procedure. Positions were divided by locations into “Four Corners”,

northeast, northwest, southeast and southwest, which were then put into four separate

tubes. Candidates from each corner would draw a post from the tube of their region

(Chen, 1991). With the posts being differentiated among regions, further complications

arrived. One issue was how to balance the undersupply or oversupply of positions across

regions. Every month, vacancies in one region might not match the candidates from that

region, given that in general people from the north prefer positions in the north, and

people from the south prefer positions in the south, then if there were fewer posts than

candidates in northeast, additional posts would be borrowed from northwest (Wu, 1609b).

Li Dai suggested the procedures should give priorities to the regions that do not need to

borrow extra posts from other, and then the regions that need to borrow extra posts,

though it was unclear if the suggestion was finally adopted (Wu, 1609b).

Mismatch. The third challenge was that the random procedure destroyed the tradition

of finding the right man for the right position. While there was an order of drawing

lots by the candidates, but the random procedure certainly could assign a higher ability

candidate to a position of simpler tasks, and assign another lower ability candidate to a

more complicated job. As Yu Shenxing, a prominent official, argued, “as far as the grater

or lesser talents of men are concerned, there is in each case an appropriate post...When

one considers the difficulty of a place, there is in each case the right man... But now all

of this is left to drawing lots....

Finally, despite of the seemingly fairness, it was reported that the clerks in charge of

the appointment selected the best posts to be filled up and interfered in the process by

selling them, which raised concerns over corruption (Guo que, 1594 - 1658)