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

objec ves
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

1/11/18 1

Objec&ves

  • Analyzing proofs
  • Introduc&on to problem solving

Ø Our process, through an example

1 Jan 10, 2018 Sprenkle - CSCI211

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?

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

slide-2
SLIDE 2

1/11/18 2

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

INTRODUCTION TO PROBLEM SOLVING

Process, through example

Jan 10, 2018 Sprenkle - CSCI211 4

slide-3
SLIDE 3

1/11/18 3

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

5 Jan 10, 2018 Sprenkle - CSCI211

What details make this problem tricky? What info do we need to solve problem?

Stable 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

6

Zeus Amy Clare Bertha Yancey Bertha Clare Amy Xavier Amy Clare Bertha 1st 2nd 3rd Men’s Preference Profile favorite least favorite Clare Xavier Zeus Yancey Bertha Xavier Zeus Yancey Amy Yancey Zeus Xavier 1st 2nd 3rd Women’s Preference Profile favorite least favorite

Jan 10, 2018 Sprenkle - CSCI211

Simplified version of resident-matching problem

slide-4
SLIDE 4

1/11/18 4

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

7 Jan 10, 2018 Sprenkle - CSCI211

Stable matching problem: Given the preference lists of n men and n women, find a stable matching if one exists.

Analyzing Stability

  • Is pairing X-C, Y-B, Z-A stable?

8

Zeus Amy Clare Bertha Yancey Bertha Clare Amy Xavier Amy Clare Bertha 1st 2nd 3rd Men’s Preference Profile Clare Xavier Zeus Yancey Bertha Xavier Zeus Yancey Amy Yancey Zeus Xavier 1st 2nd 3rd Women’s Preference Profile favorite least favorite favorite least favorite

Jan 10, 2018 Sprenkle - CSCI211

Instable: m prefers w to his woman; w prefers m to her man

slide-5
SLIDE 5

1/11/18 5

Analyzing Stability

  • Is pairing X-C, Y-B, Z-A stable?
  • No. Bertha and Xavier prefer each other

9 Jan 10, 2018 Sprenkle - CSCI211

Zeus Amy Clare Bertha Yancey Bertha Clare Amy Xavier Amy Clare Bertha 1st 2nd 3rd Men’s Preference Profile Clare Xavier Zeus Yancey Bertha Xavier Zeus Yancey Amy Yancey Zeus Xavier 1st 2nd 3rd Women’s Preference Profile favorite least favorite favorite least favorite

Stable Matching Problem

  • Is pairing X-A, Y-B, Z-C stable?
  • Yes.

10 Jan 10, 2018 Sprenkle - CSCI211

Zeus Amy Clare Bertha Yancey Bertha Clare Amy Xavier Amy Clare Bertha 1st 2nd 3rd Men’s Preference Profile favorite least favorite Clare Xavier Zeus Yancey Bertha Xavier Zeus Yancey Amy Yancey Zeus Xavier 1st 2nd 3rd Women’s Preference Profile favorite least favorite

Instable: m prefers w to his woman; w prefers m to her man

slide-6
SLIDE 6

1/11/18 6

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

slide-7
SLIDE 7

1/11/18 7

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

slide-8
SLIDE 8

1/11/18 8

Propose-And-Reject Algorithm

  • Intui&ve method that guarantees finding a

stable matching

15

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 = 1st 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

[Gale-Shapley 1962]

Jan 10, 2018 Sprenkle - CSCI211

Applying the Algorithm

16 Jan 10, 2018 Sprenkle - CSCI211

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 = 1st 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 Zeus Amy Clare Bertha Yancey Bertha Clare Amy Xavier Amy Clare Bertha 1st 2nd 3rd Men’s Preference Profile

favorite least favorite

Clare Xavier Zeus Yancey Bertha Xavier Zeus Yancey Amy Yancey Zeus Xavier 1st 2nd 3rd Women’s Preference Profile

favorite least favorite

slide-9
SLIDE 9

1/11/18 9

Applying the Algorithm

17 Jan 10, 2018 Sprenkle - CSCI211

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 = 1st 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 Zeus Amy Clare Bertha Yancey Bertha Clare Amy Xavier Amy Clare Bertha 1st 2nd 3rd Men’s Preference Profile

favorite least favorite

Clare Xavier Zeus Yancey Bertha Xavier Zeus Yancey Amy Yancey Zeus Xavier 1st 2nd 3rd Women’s Preference Profile

favorite least favorite

Clare Bertha Amy Zeus Yancey Xavier

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

slide-10
SLIDE 10

1/11/18 10

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

  • ver 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

slide-11
SLIDE 11

1/11/18 11

1) Algorithm Termina&on

Jan 10, 2018 Sprenkle - CSCI211 21

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 = 1st

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 assign m and 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

[Gale-Shapley 1962]

Does algorithm terminate?

Proof of Correctness: Termina&on

  • Claim. Algorithm terminates aoer at most n2

itera&ons of while loop.

Ø Hint: How wouldn’t the algorithm terminate?

22 Jan 10, 2018 Sprenkle - CSCI211

slide-12
SLIDE 12

1/11/18 12

Proof of Correctness: Termina&on

  • Claim. Algorithm terminates aoer at most n2

itera&ons of while loop.

  • Pf. Each &me through the while loop, a man

proposes to a new woman. There are only n2 possible proposals.

23 Jan 10, 2018 Sprenkle - CSCI211

Number of proposals is a good measure for termination à strictly increases; limited

Proof of Correctness: Termina&on

  • Claim. Algorithm terminates aoer at most n2

itera&ons of while loop.

  • Pf. Each &me through the while loop, a man

proposes to a new woman. There are only n2 possible proposals.

24 Jan 10, 2018 Sprenkle - CSCI211

Note: not yet discussing the cost in the body of the while loop

slide-13
SLIDE 13

1/11/18 13

2) Algorithm Analysis: Perfect Matching

  • Perfect matching: everyone is matched

monogamously

  • Hint: in algorithm, we know if m is free at some

point in the execu&on of the algorithm, then there is a woman to whom he has not yet proposed.

Jan 10, 2018 Sprenkle - CSCI211 25

Prove that final matching is a perfect matching

Proof of Correctness: Perfec&on

  • Claim. All men and women get matched.
  • Pf. (by contradic&on)

Ø Where should we start?

Jan 10, 2018 Sprenkle - CSCI211 26

Suppose that some man m is not matched upon termination of algorithm

slide-14
SLIDE 14

1/11/18 14

Proof of Correctness: Perfec&on

  • Claim. All men and women get matched.
  • Pf. (by contradic&on)

Ø Suppose that m is not matched upon termina&on of algorithm Ø Then some woman, say w, is not matched upon termina&on. Ø By Observa&on 2, w was never proposed to. Ø But, last man proposed to everyone, since he ends up unmatched

  • (by the while loop’s condi&on)

Ø Contradic&on ▪

27 Jan 10, 2018 Sprenkle - CSCI211

Assignments

  • Review Chapter 1
  • Journal due Monday/Tuesday (because of MLK

day)

Ø Preface, Chapter 1.1 Ø Check out the content requirements for the journal entries

Jan 10, 2018 Sprenkle - CSCI211 28