stable marriage - computer scienceresearch.cs.rutgers.edu/~troyjlee/marriage.pdfsuppose that alice...

87
Stable Marriage The mathematics of 1950’s dating

Upload: dodiep

Post on 25-Mar-2018

223 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Stable MarriageThe mathematics of 1950’s dating

Page 2: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Dating ScenarioA romantic candlelit dinner...

Page 3: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Dating ScenarioA romantic candlelit dinner... with n boys and n girls.

Page 4: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Dating ScenarioA romantic candlelit dinner... with n boys and n girls.

Boys want to pair with girls, and vice versa.

Page 5: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Dating ScenarioA romantic candlelit dinner... with n boys and n girls.

Boys want to pair with girls, and vice versa.

(This assumption will be crucial)

Page 6: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Dating ScenarioA romantic candlelit dinner... with n boys and n girls.

Boys want to pair with girls, and vice versa.

Each boy makes a (mental) ranking of all the girls.

(This assumption will be crucial)

Page 7: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Dating ScenarioA romantic candlelit dinner... with n boys and n girls.

Boys want to pair with girls, and vice versa.

Each boy makes a (mental) ranking of all the girls.

(This assumption will be crucial)

Each girl makes a ranking of all the boys.

Page 8: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

1,3,2

2,1,3

1,2,3

2,1,3

2,3,1

3,2,1

1

2

3

1

2

3

Boys Girls

Page 9: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Happily ever after...What matching metric should be used to maximize the happiness of the couples?

Page 10: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Happily ever after...What matching metric should be used to maximize the happiness of the couples?

On this we remain agnostic...

Page 11: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Happily ever after...What matching metric should be used to maximize the happiness of the couples?

On this we remain agnostic...

However, there is one situation which will clearly cause trouble...

Page 12: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Rogue CouplesSuppose that Alice prefers Bob to her current husband,and Bob prefers Alice to his current wife.

Page 13: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Rogue CouplesSuppose that Alice prefers Bob to her current husband,and Bob prefers Alice to his current wife.

Page 14: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Rogue CouplesSuppose that Alice prefers Bob to her current husband,and Bob prefers Alice to his current wife.

Call Alice and Bob a rogue couple.

Page 15: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Rogue CouplesSuppose that Alice prefers Bob to her current husband,and Bob prefers Alice to his current wife.

Call Alice and Bob a rogue couple.

Can we match everyone without any rogue couples?

Page 16: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Stable PairingA pairing is called stable if it contains no rogue couples.

1,3,2

2,1,3

1,2,3

2,1,3

2,3,1

3,2,1

1

2

3

1

2

3

Page 17: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Stable PairingA pairing is called stable if it contains no rogue couples.

3,2,1

1,2,3

3,2,1

3,2,1

2,1,3

3,1,2

1

2

3

1

2

3

Page 18: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Troubling Questions

• Does a stable pairing exist no matter what the rankings of the parties?

• Even it exists, can it be efficiently found?

• Are we doomed to inhabit a world with rogue couples?

Page 19: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Bisexual dating

1 2

2

4

2,3,4 3,1,4

3

1,2,4 *,*,*

Page 20: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Bisexual dating

1 2

4

2,3,4 3,1,4

3

1,2,4 *,*,*

Page 21: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Bisexual dating

1 2

4

2,3,4 3,1,4

3

1,2,4 *,*,*

Page 22: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Bisexual dating

1 2

4

2,3,4 3,1,4

3

1,2,4 *,*,*

Page 23: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Bisexual dating

1 2

4

2,3,4 3,1,4

3

1,2,4 *,*,*

No stable pairing!

Page 24: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

InsightAny proof a stable pairing always exists will have to use the difference between boys and girls.

If our proof does not break down in the bisexual case, it will not work.

Page 25: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

“Traditional” Marriage Algorithm

Page 26: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

“Traditional” Marriage Algorithm

For every day that some boy is rejected:

Morning: Every girl stands on her balcony

Every boy proposes under the balcony of the top girl remaining on his list.

Page 27: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

“Traditional” Marriage Algorithm

Afternoon: Girls to today’s best suitor “Maybe come back tomorrow.”

To any others “I will never marry you.”

For every day that some boy is rejected:

Say has boy “on a string.”

Page 28: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

“Traditional” Marriage Algorithm

Afternoon: Girls to today’s best suitor “Maybe come back tomorrow.”

To any others “I will never marry you.”

For every day that some boy is rejected:

Say has boy “on a string.”

Page 29: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

“Traditional” Marriage Algorithm

Afternoon: Girls to today’s best suitor “Maybe come back tomorrow.”

To any others “I will never marry you.”

For every day that some boy is rejected:

Say has boy “on a string.”

Page 30: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

“Traditional” Marriage Algorithm

Afternoon: Girls to today’s best suitor “Maybe come back tomorrow.”

To any others “I will never marry you.”

For every day that some boy is rejected:

Say has boy “on a string.”

Page 31: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

“Traditional” Marriage Algorithm

Evening: Rejected boys cross girl off their list.

For every day that some boy is rejected:

If no boy was rejected, each girl marries boy on her string.

Page 32: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

“Traditional” Marriage Algorithm

Does this algorithm always produce a stable pairing?

Page 33: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

“Traditional” Marriage Algorithm

Does this algorithm always produce a stable pairing?

Would it work for the bisexual variation?

Page 34: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

“Traditional” Marriage Algorithm

Does this algorithm always produce a stable pairing?

Would it work for the bisexual variation?

Wait! Even more basic question...Will it always terminate?

Page 35: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

“Traditional” Marriage Algorithm

Does this algorithm always produce a stable pairing?

Would it work for the bisexual variation?

Wait! Even more basic question...Will it always terminate?

What can go wrong? Might run for infinite number of days...Might encounter a situation where next move is not specified.

Page 36: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Try It!

Page 37: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Improvement LemmaIf a girl gets a boy b “on a string,” then in all laterdays she will have a boy at least as preferable as bon a string (or for a husband).

Page 38: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Improvement LemmaIf a girl gets a boy b “on a string,” then in all laterdays she will have a boy at least as preferable as bon a string (or for a husband).

If girl does not ever reject b, he will stay on her string.

Page 39: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Improvement LemmaIf a girl gets a boy b “on a string,” then in all laterdays she will have a boy at least as preferable as bon a string (or for a husband).

If girl does not ever reject b, he will stay on her string.

A girl will only reject b if a preferable boy b* proposes.

Page 40: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Improvement LemmaIf a girl gets a boy b “on a string,” then in all laterdays she will have a boy at least as preferable as bon a string (or for a husband).

If girl does not ever reject b, he will stay on her string.

A girl will only reject b if a preferable boy b* proposes.

A girl will only reject b* if a preferable boy b** proposes.

Page 41: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Improvement LemmaIf a girl gets a boy b “on a string,” then in all laterdays she will have a boy at least as preferable as bon a string (or for a husband).

If girl does not ever reject b, he will stay on her string.

A girl will only reject b if a preferable boy b* proposes.

A girl will only reject b* if a preferable boy b** proposes.

And so on...Formally, can show lemma by induction.

Page 42: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Improvement lemmaA corollary of the improvement lemma:

Each girl marries her absolute favorite of the boys who visit her during the algorithm.

Page 43: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

What about the boys?

Page 44: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

What about the boys?Lemma: No boy is rejected by all the girls.

Page 45: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

What about the boys?Lemma: No boy is rejected by all the girls.

Proof by contradiction: Suppose b is rejected by all the girls.

Page 46: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

What about the boys?Lemma: No boy is rejected by all the girls.

Proof by contradiction: Suppose b is rejected by all the girls.

At that point each girl will have a suitor. This follows from the improvement lemma: any boyis preferable to no boy.

Page 47: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

What about the boys?Lemma: No boy is rejected by all the girls.

Proof by contradiction: Suppose b is rejected by all the girls.

At that point each girl will have a suitor. This follows from the improvement lemma: any boyis preferable to no boy.

As there are n girls, this gives n boys with b not among them. Contradiction!

Page 48: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

TMA will terminateAnd it will take at most n2 days!

Page 49: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

TMA will terminateAnd it will take at most n2 days!

Consider the master list of all boys preferences.

Page 50: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

TMA will terminateAnd it will take at most n2 days!

Consider the master list of all boys preferences.

This has n2 entries.

Page 51: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

TMA will terminateAnd it will take at most n2 days!

Consider the master list of all boys preferences.

This has n2 entries.

If no boy is rejected, algorithm terminates. Otherwise,some boy is rejected and number of entries goes down.

Page 52: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

TMA will terminateAnd it will take at most n2 days!

Consider the master list of all boys preferences.

This has n2 entries.

If no boy is rejected, algorithm terminates. Otherwise,some boy is rejected and number of entries goes down.

Note that once boy has just one girl on his list, she musteventually marry him.

Page 53: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Recap

• We are now a long way towards our goal.

• We know that algorithm will halt and produce a pairing.

• We even know the running time of the algorithm!

• Now, will it produce a stable pairing?

Page 54: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

The pairing is stable

g g*b

If boy b prefers g* to g, then he proposed to her first, and was at some point rejected.

b*

Thus g* prefers b* to b, and (b,g*) is not a rogue couple.

Page 55: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

The pairing is stableg*, you are my true love

g g*b

If boy b prefers g* to g, then he proposed to her first, and was at some point rejected.

b*

Thus g* prefers b* to b, and (b,g*) is not a rogue couple.

Page 56: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

The pairing is stable

g g*b

If boy b prefers g* to g, then he proposed to her first, and was at some point rejected.

b*

Thus g* prefers b* to b, and (b,g*) is not a rogue couple.

Page 57: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

The pairing is stableI already rejected you!

g g*b

If boy b prefers g* to g, then he proposed to her first, and was at some point rejected.

b*

Thus g* prefers b* to b, and (b,g*) is not a rogue couple.

Page 58: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Opinion PollWho is better off in traditional dating?

Page 59: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Opinion PollWho is better off in traditional dating?

The boys?

Page 60: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Opinion PollWho is better off in traditional dating?

The boys? The girls?

Page 61: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

My best girlForget about TMA for a minute...

How can we define “the optimal girl” for a boy b?

Page 62: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

My best girlForget about TMA for a minute...

How can we define “the optimal girl” for a boy b?

First attempt: b’s favorite girl.

Page 63: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

My best girlForget about TMA for a minute...

How can we define “the optimal girl” for a boy b?

First attempt: b’s favorite girl.

This is unrealistic...in general b cannot hope to get his favorite girl in a stable world.

Page 64: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

The optimal girlLook at all possible stable pairings. Call a girl optimalfor a boy if she is the highest ranked girl he is paired with in some stable pairing.

Page 65: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

The optimal girlLook at all possible stable pairings. Call a girl optimalfor a boy if she is the highest ranked girl he is paired with in some stable pairing.

This is the best girl he can hope to get in a stable world.

Page 66: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

The optimal girlLook at all possible stable pairings. Call a girl optimalfor a boy if she is the highest ranked girl he is paired with in some stable pairing.

This is the best girl he can hope to get in a stable world.

Similarly, call the lowest ranked girl a boy can get in a stable pairing his pessimal girl.

Page 67: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Dating ups and downs

Call a pairing male-optimal if all males simultaneously are paired with their optimal girl.

The best stable world for all males.

Call a pairing male-pessimal if all males simultaneously are paired with their pessimal girl.

Page 68: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Dating ups and downs

Call a pairing female-optimal if all females simultaneously are paired with their optimal boy.

The best stable world for all females.

Call a pairing female-pessimal if all females simultaneously are paired with their pessimal boy.

Page 69: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

The Mathematical Truth

The traditional marriage algorithm always produces a male-optimal female-pessimal pairing.

Page 70: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Male OptimalProof by contradiction: Suppose the pairing produced isnot male optimal. Let t be the earliest a boy b is rejected by his optimal girl g.

Page 71: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Male OptimalProof by contradiction: Suppose the pairing produced isnot male optimal. Let t be the earliest a boy b is rejected by his optimal girl g.

At time t girl g rejects b for a preferable boy b*. By definition of t, boy b* has not been rejected by his optimal girl.

Page 72: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Male OptimalProof by contradiction: Suppose the pairing produced isnot male optimal. Let t be the earliest a boy b is rejected by his optimal girl g.

At time t girl g rejects b for a preferable boy b*. By definition of t, boy b* has not been rejected by his optimal girl.

Thus b* likes g at least as much as his optimal girl.

Page 73: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Male OptimalBy assumption that g is optimal for b, there is a stable pairing matching them together.

b g

b* g*...

...

But g prefers b* to b, and b* prefers g to g*.

b* and g form a rogue couple! Contradiction.

Page 74: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Female-Pessimal

Page 75: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Female-PessimalUnfortunately, male-optimal implies female pessimal!

Page 76: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Female-PessimalUnfortunately, male-optimal implies female pessimal!

Again we prove by contradiction.

Page 77: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Female-PessimalUnfortunately, male-optimal implies female pessimal!

Suppose in a male-optimal pairing boy b is with girl g, yet there is some stable pairing S in which g is with less preferable b*.

Again we prove by contradiction.

Page 78: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Female-PessimalUnfortunately, male-optimal implies female pessimal!

Suppose in a male-optimal pairing boy b is with girl g, yet there is some stable pairing S in which g is with less preferable b*.

Again we prove by contradiction.

b g

b* g*S

Page 79: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

Female-PessimalUnfortunately, male-optimal implies female pessimal!

Suppose in a male-optimal pairing boy b is with girl g, yet there is some stable pairing S in which g is with less preferable b*.

Again we prove by contradiction.

b g

b* g*S

But then b prefers g to g* (she is his optimal girl) andg prefers b to b*. Contradiction to stability of S.

Page 80: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

The MatchTMA is the algorithm used by one of the largest most successful dating services in the world.

Page 81: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

?

The MatchTMA is the algorithm used by one of the largest most successful dating services in the world.

Page 82: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

?

The MatchTMA is the algorithm used by one of the largest most successful dating services in the world.

?

Page 83: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

?

The MatchTMA is the algorithm used by one of the largest most successful dating services in the world.

? ?

Page 84: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

?

The MatchTMA is the algorithm used by one of the largest most successful dating services in the world.

? ?

No! By the National Residency Matching Program.

Page 85: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

?

The MatchTMA is the algorithm used by one of the largest most successful dating services in the world.

? ?

No! By the National Residency Matching Program.

This service pairs graduating medical students with hospitals.

Page 86: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

The Match

• Since 1952 residency matches have been made by a centralized service.

• Medical students rank hospitals.

• Hospitals rank graduating students

• They run the TMA (polygamous version).

• Until recently, pairings were hospital optimal.

Page 87: Stable Marriage - Computer Scienceresearch.cs.rutgers.edu/~troyjlee/Marriage.pdfSuppose that Alice prefers Bob to her current husband, ... “Traditional” Marriage Algorithm

History and BeyondThis algorithm was developed by Gale and Shapley back in 1962 in a paper “College Admissions and the stability of marriage.”

Math has much more to say about marriage!You can also check out the Marriage theorem,a.k.a Hall’s theorem.