objec ves
play

Objec&ves Analyzing proofs Introduc&on to problem solving - PDF document

1/11/18 Objec&ves Analyzing proofs Introduc&on to problem solving Our process, through an example 4 p.m. Alicia Grubb, faculty candidate talk, P405 3:30 p.m. reception Wiki: Everyone log in okay? Decide on either


  1. 1/11/18 Objec&ves • Analyzing proofs • Introduc&on to problem solving Ø Our process, through an example 4 p.m. – Alicia Grubb, faculty candidate talk, P405 3:30 p.m. reception Wiki: • Everyone log in okay? • Decide on either using a blog or wiki-style journal? Jan 10, 2018 Sprenkle - CSCI211 1 Review • What are our goals in solving problems? • How do we show that our solu&ons are correct and efficient? • What proof techniques did we discuss? Jan 10, 2018 Sprenkle - CSCI211 2 1

  2. 1/11/18 Proof Summary • Need to prove conjectures • Common types of proofs Ø Direct proofs Ø Contradic&on Ø Induc&on • Common error: not checking/proving assump&ons Ø “Jumps” in logic Jan 10, 2018 Sprenkle - CSCI211 3 Process, through example INTRODUCTION TO PROBLEM SOLVING Jan 10, 2018 Sprenkle - CSCI211 4 2

  3. 1/11/18 Matching Residents to Hospitals • Goal : Given a set of preferences among hospitals and medical school students, design a self-reinforcing admissions process. • Applicant a and hospital h are unstable if Ø a prefers h to its assigned hospital Ø h prefers a to one of its admi[ed students • Stable assignment : Assignment with no unstable pairs Ø No incen&ve for some pair of par&cipants to undermine assignment by joint ac&on • Unstable pair could each improve their situa&on by swapping with current assignment • Self-reinforcing What details make this problem tricky? What info do we need to solve problem? Jan 10, 2018 Sprenkle - CSCI211 5 Stable Matching Problem Simplified version of resident-matching problem • Goal : Given n men and n women, find a “suitable” matching Ø Par&cipants rank members of opposite sex Ø Each man ranks women in order of preference Ø Each woman ranks men in order of preference favorite least favorite favorite least favorite 1 st 2 nd 3 rd 1 st 2 nd 3 rd Xavier Amy Bertha Clare Amy Yancey Xavier Zeus Yancey Bertha Amy Clare Bertha Xavier Yancey Zeus Zeus Amy Bertha Clare Clare Xavier Yancey Zeus Men’s Preference Profile Women’s Preference Profile Jan 10, 2018 Sprenkle - CSCI211 6 3

  4. 1/11/18 Stable Matching Goals • Perfect matching : everyone is matched monogamously Ø Each man is paired with exactly one woman Ø Each woman is paired with exactly one man • Stability : no incen&ve for some pair of par&cipants to undermine assignment by joint ac&on Ø An unmatched pair m-w is unstable if man m and woman w prefer each other to current partners Ø Unstable pair m-w could each improve by eloping • Stable matching : perfect matching with no unstable pairs Stable matching problem: Given the preference lists of n men and n women, � find a stable matching if one exists. Jan 10, 2018 Sprenkle - CSCI211 7 Analyzing Stability Instable : m prefers w to his woman; w prefers m to her man • Is pairing X-C, Y-B, Z-A stable? least favorite favorite least favorite favorite 1 st 2 nd 3 rd 1 st 2 nd 3 rd Xavier Amy Bertha Clare Amy Yancey Xavier Zeus Yancey Bertha Amy Clare Bertha Xavier Yancey Zeus Zeus Amy Bertha Clare Clare Xavier Yancey Zeus Men’s Preference Profile Women’s Preference Profile Jan 10, 2018 Sprenkle - CSCI211 8 4

  5. 1/11/18 Analyzing Stability • Is pairing X-C, Y-B, Z-A stable? • No. Bertha and Xavier prefer each other favorite least favorite favorite least favorite 1 st 2 nd 3 rd 1 st 2 nd 3 rd Xavier Amy Bertha Clare Amy Yancey Xavier Zeus Yancey Bertha Amy Clare Bertha Xavier Yancey Zeus Zeus Amy Bertha Clare Clare Xavier Yancey Zeus Men’s Preference Profile Women’s Preference Profile Jan 10, 2018 Sprenkle - CSCI211 9 Stable Matching Problem Instable : m prefers w to his woman; w prefers m to her man • Is pairing X-A, Y-B, Z-C stable? • Yes. favorite least favorite favorite least favorite 1 st 2 nd 3 rd 1 st 2 nd 3 rd Xavier Amy Bertha Clare Amy Yancey Xavier Zeus Yancey Bertha Amy Clare Bertha Xavier Yancey Zeus Zeus Amy Bertha Clare Clare Xavier Yancey Zeus Men’s Preference Profile Women’s Preference Profile Jan 10, 2018 Sprenkle - CSCI211 10 5

  6. 1/11/18 Any Ques&ons? • What are you wondering about this problem/its solu&on at this point? Jan 10, 2018 Sprenkle - CSCI211 11 Any Ques&ons? • What are you wondering about this problem/its solu&on at this point? • Hopefully: Ø Is there a stable matching for every pair of preference lists? Ø If so, is there an algorithm to find the stable matching? Ø Can we be fair in the matching? (preferences) Ø Will the matching always be the same? Jan 10, 2018 Sprenkle - CSCI211 12 6

  7. 1/11/18 Thoughts on Solving Problem • What do we need to solve the problem? • What do we know? • Where should the state start? • What are some ini&al ideas about approaches? Jan 10, 2018 Sprenkle - CSCI211 13 Thoughts on Solving Problem • Ini&ally, no one is matched • Pick an arbitrary man and have him match with his favorite woman. Ø Are we guaranteed that pair will be part of a stable matching? • Should a woman accept her first offer? If not, what should she do? • When are we done? Do we need to consider all combina&ons? Jan 10, 2018 Sprenkle - CSCI211 14 7

  8. 1/11/18 Propose-And-Reject Algorithm [Gale-Shapley 1962] • Intui&ve method that guarantees finding a stable matching Initialize each person to be free while while some man is free and hasn't proposed to every woman Choose such a man m w = 1 st woman on m's list to whom m has not yet proposed if if w is free assign m and w to be engaged else else if if w prefers m to her fiancé m' assign m and w to be engaged and m' to be free else else w rejects m Jan 10, 2018 Sprenkle - CSCI211 15 Applying the Algorithm favorite least favorite favorite least favorite 1 st 2 nd 3 rd 1 st 2 nd 3 rd Xavier Amy Bertha Clare Amy Yancey Xavier Zeus Yancey Bertha Amy Clare Bertha Xavier Yancey Zeus Zeus Amy Bertha Clare Clare Xavier Yancey Zeus Men’s Preference Profile Women’s Preference Profile Initialize each person to be free while while some man is free and hasn't proposed to every woman Choose such a man m w = 1 st woman on m's list to whom m has not yet proposed if if w is free assign m and w to be engaged else else if if w prefers m to her fiancé m' assign m and w to be engaged and m' to be free else else w rejects m Jan 10, 2018 Sprenkle - CSCI211 16 8

  9. 1/11/18 Applying the Algorithm favorite least favorite favorite least favorite 1 st 2 nd 3 rd 1 st 2 nd 3 rd Xavier Amy Amy Bertha Clare Amy Yancey Xavier Xavier Zeus Yancey Bertha Bertha Amy Clare Bertha Xavier Yancey Yancey Zeus Zeus Amy Bertha Clare Clare Clare Xavier Yancey Zeus Zeus Men’s Preference Profile Women’s Preference Profile Initialize each person to be free while some man is free and hasn't proposed to every woman while Choose such a man m w = 1 st woman on m's list to whom m has not yet proposed if if w is free assign m and w to be engaged else else if if w prefers m to her fiancé m' assign m and w to be engaged and m' to be free else else w rejects m Jan 10, 2018 Sprenkle - CSCI211 17 Observa&ons about the Algorithm • What can we say about any woman’s partner during the execu&on of the algorithm? • How does a woman’s state change over the execu&on of the algorithm? • What can we say about a man’s partner? Jan 10, 2018 Sprenkle - CSCI211 18 9

  10. 1/11/18 Observa&ons about the Algorithm • What can we say about any woman’s partner during the execu&on of the algorithm? Ø Observa&on 1. He gets “be[er” à she prefers him over her last partner • How does a woman’s state change over the execu&on of the algorithm? Ø Observa&on 2. Once a woman is matched, she never becomes unmatched; she only "trades up” • What can we say about a man’s partner? Ø Observa&on 3. She gets “worse” Jan 10, 2018 Sprenkle - CSCI211 19 Proving Correctness • Need to show Ø Algorithm terminates Ø Result is a perfect matching Ø Result is a stable matching Jan 10, 2018 Sprenkle - CSCI211 20 10

  11. 1/11/18 1) Algorithm Termina&on [Gale-Shapley 1962] Does algorithm terminate? Initialize each person to be free Initialize each person to be free while while (some man is free and hasn't proposed to every woman) (some man is free and hasn't proposed to every woman) Choose such a man Choose such a man m w = 1 = 1 st st woman on m's list to whom woman on m's list to whom m has not yet proposed has not yet proposed if if w is free w is free assign m and assign and w to be engaged to be engaged else else if if w prefers m to her fiancé m' w prefers m to her fiancé m' assign assign m and and w to be engaged and to be engaged and m' to be free ' to be free else else w rejects rejects m Jan 10, 2018 Sprenkle - CSCI211 21 Proof of Correctness: Termina&on • Claim. Algorithm terminates aoer at most n 2 itera&ons of while loop. Ø Hint: How wouldn’t the algorithm terminate? Jan 10, 2018 Sprenkle - CSCI211 22 11

Recommend


More recommend