Professional Documents
Culture Documents
CV Benjamin Doerr
born in Munich
Diploma 1998 (Kiel): Group theory
PhD 2000 (Kiel): Combinatorics
Habilitation 2005 (Kiel): Algorithms
INF421 Team:
Marie Albenque:
coordinator of the quizzes, PC groups in French/English
Karthikeyan Bhargavan:
coordinator of the programming homeworks, PC groups in English
Luca Castelli:
coordinator of the programming project, PC groups in French
Philippe Jacquet:
PC groups in French, various internal jobs
Maks Ovsjanikov:
coordinator of the PC, PC groups in English
Coordinator: The person organizing this task by distributing the work in
the team and overlooking that everything works
the first person to ask questions, complain if things dont work, etc.
INF421 (X'14), 1st Lecture: Stable Marriages
Course Organization
8 amphis (today, Nov 13 to Dec 18, Jan 8), Friday, 10:30-12:00
8 PC (Friday afternoon): practice the lecture content, training for the exam
4 homeworks (DM): practice programming, understand lecture material
also via programming
voluntary quizzes:
test if you understood the previous lecture
chance to think about the next topic
possibly (your choice) a programming project (PI)
Exam, Grading
Most of these course ingredients aim at making you learn something new
and useful use this opportunity!
Note classante (note chiffre) [0, 20]: fully determined by the contrle
classante (CC)
Note de module (note littrale) {, , }: also influenced by PI and DM
DM [2, +2], PI [0,20]
no PI: CC + DM
with PI: max{CC, (2*CC+PI)/3} + DM
the PI can only increase your grade (and often it does)
all computations done in [0,20], then transformed into {, , }
INF421 (X'14), 1st Lecture: Stable Marriages
Project (PI)
Rules (for all courses):
Each course INF4, 2, offers a programming project (PI).
It is recommended that each student does one project;
a project is a prerequisite for doing a PA in informatique.
workload: programming (~20 hours / ~500 lines of code), write a report,
20min defense (10min presentation, 10min questions)
A project is a cool experience (very different from the more narrow,
more guided homeworks)
Rough plan for INF421 (details to be fixed very soon):
choice of ~5 different topics, you choose one by 11.11.
deadline for program and report: early January
defense: mid-January
INF421 (X'14), 1st Lecture: Stable Marriages
Course Language
General rule: English is the course language, but no-one should suffer
from knowing English less than French.
everything graded can be done in both languages
Amphis, poly, sujet/corrig of PC and DM: English
PC classes: groups in both languages offered, you choose
Exam:
sujet given in both languages
your answers can be in either language (including a reasonable mix)
Feedback
This is the 2nd edition of INF421. The first one went very well: we did not
mess up something, friendly evaluation comments, ranked 3rd out of 12
courses of the 2nd quarter (unofficial), 23% more students this year
Our plan for this year: Improve further!
You can help us: Let us know about anything youre not happy with or
where you see room for improvement
Feedback:
Easiest and fastest: Send an email to me and/or the right coordinator
Talk to your dlgu(e)s: Each PC group has a dlgu(e), two of
them are the course dlgu(e)s
Take part in the survey(s) / evaluations
Should be elected today at
Attendance (Absentisme)
Last year: INF421 had very high attendance in the amphis and average
attendance in the PC (Friday afternoon?)
Personally, I think youre old enough to know what you do (attend or stay
away). Im happy if you come, because its more fun to teach a large class.
The official rule is that you have to attend all amphis and PCs. Excessive
absence can lead to a grade of F. Absentisme is monitored and
discussed in the end-of-quarter meeting of DE and professors.
Attendance-Grade Correlation
Data from the last course (all grades before harmonization, pre-literal =
before translation into A, , E):
Absences in PC
0
1
2
3
4
Grand total
Count
84
59
27
6
5
181
Bottom line:
You seem to learn more and do better in the exam if you attend.
try to attend the PC despite the unlucky Friday afternoon slot!
10
11
12
13
14
men
women
each one has a clear order of preference of the other side
task: find a stable marriage one, where no two people can both improve
their situation by breaking up and forming a new couple
?
1.
2.
1.
2.
1.
2.
?
1.
2.
INF421 (X'14), 1st Lecture: Stable Marriages
15
men
women
each one has a clear order of preference of the other side
task: find a stable marriage one, where no two people can both improve
their situation by breaking up and forming a new couple
Stable, because no
unmarried pair
wants to get married
1.
2.
1.
2.
1.
2.
1.
2.
INF421 (X'14), 1st Lecture: Stable Marriages
16
17
18
A First Algorithm
Start with all people being single
While there is a single man do
Let be the most attractive woman (for ) that is either single or
engaged with another man less attractive to her than
if is engaged to , they split up and both become single
and become engaged
Key ideas:
Greedy approach: asks the most attractive woman he can get at that
time (tries to avoid instable pairs)
Ordered progress: Always take a single man and look for a partner for
him (tries to avoid cycles, hope that this makes analyzing the algorithm
easier)
19
Disclaimer!
We use the traditional/antique language of men, women, marrying etc.
because it is convenient and
because this is the classic way to present this material.
We do not intend to make any statement on the relation of men and
women (or men and men or women and women) in the real life.
If there are asymmetries in how our algorithms treat men and women, then
this is purely for algorithmic reasons
We do not suggest to use any of our algorithms for real-world dating
problems
20
21
22
23
Rough Pseudocode
Start with all people being single
While there is a single man do
Let be the most attractive woman (for ) that is either single or
engaged with another man less attractive to her than
if is engaged to , they split up and both become single
and become engaged
24
25
26
Question Zero
Start with all people being single
While there is a single man do
Let be the most attractive woman (for ) that is either single or
engaged with another man less attractive to her than
if is engaged to , they split up and both become single
and become engaged
27
28
Solution: Find simple statements that are true all the time (invariants)
Each womans situation improves (see disclaimer!) over time
single some guy better guy final partner
As a man, you never ask a women twice
INF421 (X'14), 1st Lecture: Stable Marriages
29
Invariant 1: Each womans partners improve over time. Proof: Look at algo.
Invariant 2: Each man asks each woman at most once
Proof: Assume asks at least once. At the first time, they become
engaged (because men [in this algo.] only ask when they have a
chance). To ask a second time, and must split up before. This only
happens if is asked by a more attractive man 1 . From that point on,
by Invariant 1, is always married to a man at least as attractive as 1 .
Hence will never ask again.
INF421 (X'14), 1st Lecture: Stable Marriages
30
Invariant Termination/Complexity
Start with all people being single
While there is a single man do
Let be the most attractive woman (for ) that is either single or
engaged with another man less attractive to her than
if is engaged to , they split up and both become single
and become engaged
Invariant 2: Each man asks each woman at most once.
31
32
33
Invariant 4: If and are engaged, then all women more attractive for
than are engaged with a man they find more attractive than .
Proof: Let with > . When and became engaged, was
engaged to a man with > (otherwise would have asked
instead of , see algo.). By Invariant 1, remains engaged with men more
attractive than .
INF421 (X'14), 1st Lecture: Stable Marriages
34
Invariant 4: If and are engaged, then all women more attractive for
than are engaged with a man they find more attractive than .
Theorem: Our algorithm terminates with the engaged couples forming a
stable matching.
Proof: Lemma 2 shows perfect matching. We show stability:
Let (, ) and ( , ) be engaged. If finds more attractive than , then
by Invariant 4, prefers over . Hence forming a new couple (, ) is
not interesting for .
INF421 (X'14), 1st Lecture: Stable Marriages
35
Stronger Invariants
Start with all people being single
While there is a single man do
Let be the most attractive woman (for ) that is either single or
engaged with another man less attractive to her than
if is engaged to , they split up and both become single
and become engaged
Proof: Let 1 , 2 be two women last asked by in that order. When asked 1 , he
did not ask 2 either because 1 is more attractive (that is what we want to show),
or because 2 was married to a cooler guy than him. By Invariant 1, 2 remains
married to cooler guys, contradicting our assumption that asked her later.
37
Invariant 2+: The women asked by man over time are sorted in strictly
decreasing order of preference
We can use Invariant 2+ to simplify our algorithm:
currently: line 3 is costly, we have to check all women
new: we let ask all women in decreasing order (possibly getting a
negative answer).
INF421 (X'14), 1st Lecture: Stable Marriages
38
Gale-Shapley Algorithm
Start
[pretty much the same as before, except that men now ask all women and possibly
are rejected (which is good, because we do not need to check this relation again)]
INF421 (X'14), 1st Lecture: Stable Marriages
39
40
41
42
43
44
100
101
100
45
Price of Anarchy
Set-up: men, women, but now each pair has a weight (happiness)
Classic algorithmics: Maximum weight matching = a matching maximizing
the sum of the happiness values
social optimum (here: 100+100)
Observation: This is not stable, the 101-pair wants to form a couple.
GT: Stable matching = no pair wants to form a new couple (Nash eq.)
100
101
100
Truthfulness
Set-up: men, women, but now each pair has a weight (happiness)
Classic algorithmics: Maximum weight matching = a matching maximizing
the sum of the happiness values
social optimum (here: 100+100)
Observation: This is not stable, the 101-pair wants to form a couple.
GT: Stable matching = no pair wants to form a new couple (Nash eq.)
Players might have an incentive to
not reveal the true problem data.
100
101
200
100
Braesss Paradox
100 people want to drive from A to B in this network. Travel times are
constant or depend on the number of people using the edge. We
assume that repeated play lets us end up in a stable solution.
A
A
100
100
100
0
100
49
What Next?
Lunch
PC today 13:30-15:30 or 15:45-17:45
Read the poly (everything we did today precisely written up, Gale-Shapley
is good for men and unfair to women, truthful auctions: pay only the
second-highest bid).
Homework (DM): Implement the Gale-Shapley algorithm in Java. Details on
the Moodle. Deadline 11.11.
Watch out for infos (mail/Moodle) on the programming project. Again, no
action required before 11.11.
See you Friday in 3 weeks with Divide and Conquer: computing the
median without sorting, finding closest points in the plane,
INF421 (X'14), 1st Lecture: Stable Marriages
50