13
Lecture 8 CSE 331 Sep 17, 2010

Lecture 8 CSE 331 Sep 17, 2010. HW 1 due today Place Q1 and Q2 in separate piles I will not accept HWs after 1:15pm

  • View
    214

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Lecture 8 CSE 331 Sep 17, 2010. HW 1 due today Place Q1 and Q2 in separate piles I will not accept HWs after 1:15pm

Lecture 8

CSE 331Sep 17, 2010

Page 2: Lecture 8 CSE 331 Sep 17, 2010. HW 1 due today Place Q1 and Q2 in separate piles I will not accept HWs after 1:15pm

HW 1 due today

Place Q1 and Q2 in separate piles

I will not accept HWs after 1:15pm

Page 3: Lecture 8 CSE 331 Sep 17, 2010. HW 1 due today Place Q1 and Q2 in separate piles I will not accept HWs after 1:15pm

HW 1 solutions

At the end of the lecture

Page 4: Lecture 8 CSE 331 Sep 17, 2010. HW 1 due today Place Q1 and Q2 in separate piles I will not accept HWs after 1:15pm

HW 2 has been posted

harder than HW 1, so start early!

Page 5: Lecture 8 CSE 331 Sep 17, 2010. HW 1 due today Place Q1 and Q2 in separate piles I will not accept HWs after 1:15pm

Return signed forms

I’ll need confirmation in writing. No graded material will be handed back tillI get this signed form from you!

Page 6: Lecture 8 CSE 331 Sep 17, 2010. HW 1 due today Place Q1 and Q2 in separate piles I will not accept HWs after 1:15pm

≤ n2 iterations of the while loopIntially all men and women are free

While there exists a free woman who can propose

Let w be such a woman and m be the best man she has not proposed to

w proposes to m

If m is free

(m,w) get engaged

Else (m,w’) are engaged

If m prefers w’ to w

w remains freeElse

(m,w) get engaged and w’ is free

Output the engaged pairs as the final output

Each iteration has one proposal

Each iteration has one proposal

Each proposal is newEach proposal is new

# iterations≤

# proposals≤

# pairs (m,w)≤n2

# iterations≤

# proposals≤

# pairs (m,w)≤n2

Page 7: Lecture 8 CSE 331 Sep 17, 2010. HW 1 due today Place Q1 and Q2 in separate piles I will not accept HWs after 1:15pm

Today’s lecture

GS algorithms always outputs a stable marriage

Page 8: Lecture 8 CSE 331 Sep 17, 2010. HW 1 due today Place Q1 and Q2 in separate piles I will not accept HWs after 1:15pm

Observation 1Intially all men and women are free

While there exists a free woman who can propose

Let w be such a woman and m be the best man she has not proposed to

w proposes to m

If m is free

(m,w) get engaged

Else (m,w’) are engaged

If m prefers w’ to w

w remains freeElse

(m,w) get engaged and w’ is free

Output the engaged pairs as the final output

Once a man gets engaged, he remains engaged (to “better”

women)

Once a man gets engaged, he remains engaged (to “better”

women)

Page 9: Lecture 8 CSE 331 Sep 17, 2010. HW 1 due today Place Q1 and Q2 in separate piles I will not accept HWs after 1:15pm

Observation 2Intially all men and women are free

While there exists a free woman who can propose

Let w be such a woman and m be the best man she has not proposed to

w proposes to m

If m is free

(m,w) get engaged

Else (m,w’) are engaged

If m prefers w’ to w

w remains freeElse

(m,w) get engaged and w’ is free

Output the engaged pairs as the final output

If w proposes to m after m’, then she prefers m’

to m

If w proposes to m after m’, then she prefers m’

to m

Page 10: Lecture 8 CSE 331 Sep 17, 2010. HW 1 due today Place Q1 and Q2 in separate piles I will not accept HWs after 1:15pm

Questions/Comments?

Page 11: Lecture 8 CSE 331 Sep 17, 2010. HW 1 due today Place Q1 and Q2 in separate piles I will not accept HWs after 1:15pm

HW 1 due today

Place Q1 and Q2 in separate piles

I will not accept HWs after 1:15pm

Page 12: Lecture 8 CSE 331 Sep 17, 2010. HW 1 due today Place Q1 and Q2 in separate piles I will not accept HWs after 1:15pm

Proof technique de jour

Source: 4simpsons.wordpress.com

Proof by contradiction

Assume the negation of what you want to proveAssume the negation of what you want to prove

After some reasoning

After some reasoning

Page 13: Lecture 8 CSE 331 Sep 17, 2010. HW 1 due today Place Q1 and Q2 in separate piles I will not accept HWs after 1:15pm

Claim: GS algo outputs a matching