Download presentation
Presentation is loading. Please wait.
1
Lecture 6 CSE 331 Sep 12, 2011
2
Grading Rubric for HW 1
3
≤ n2 iterations of the while loop
Intially all men and women are free Each proposal is new 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 Each iteration has one proposal If m is free (m,w) get engaged Else (m,w’) are engaged # iterations ≤ # proposals # pairs (m,w) n2 If m prefers w’ to w w remains free Else (m,w) get engaged and w’ is free Output the engaged pairs as the final output
4
Why do all the formal progress stuff?
Notion of proof by progress will be useful later Example of writing a proof idea/ formal proof
5
≤ n2 iterations of the while loop
Intially 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 Can make GS execute very close to n2 iterations If m is free (m,w) get engaged Else (m,w’) are engaged If m prefers w’ to w w remains free Else (m,w) get engaged and w’ is free Output the engaged pairs as the final output
6
Today’s lecture Perfect Macthing No instability
GS algorithms always outputs a stable marriage Perfect Macthing No instability
7
Once a man gets engaged, he remains engaged (to “better” women)
Observation 1 Intially 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 Once a man gets engaged, he remains engaged (to “better” women) Else (m,w’) are engaged If m prefers w’ to w w remains free Else (m,w) get engaged and w’ is free Output the engaged pairs as the final output
8
If w proposes to m after m’, then she prefers m’ to m
Observation 2 Intially 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 If w proposes to m after m’, then she prefers m’ to m (m,w) get engaged Else (m,w’) are engaged If m prefers w’ to w w remains free Else (m,w) get engaged and w’ is free Output the engaged pairs as the final output
9
All engaged pairs form a matching
Observation 3 Intially 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 All engaged pairs form a matching Else (m,w’) are engaged If m prefers w’ to w w remains free Else (m,w) get engaged and w’ is free Output the engaged pairs as the final output
10
Questions/Comments?
11
Proof technique de jour
Proof by contradiction Assume the negation of what you want to prove After some reasoning Source: 4simpsons.wordpress.com
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.