Lecture 6 CSE 331 Sep 12, 2011
Grading Rubric for HW 1
≤ 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
Why do all the formal progress stuff? Notion of proof by progress will be useful later Example of writing a proof idea/ formal proof
≤ 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
Today’s lecture Perfect Macthing No instability GS algorithms always outputs a stable marriage Perfect Macthing No instability
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
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
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
Questions/Comments?
Proof technique de jour Proof by contradiction Assume the negation of what you want to prove After some reasoning Source: 4simpsons.wordpress.com