{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# Sol1 - CS 577 Introduction to Algorithms Homework Solution...

This preview shows pages 1–2. Sign up to view the full content.

CS 577: Introduction to Algorithms 9/26/06 Homework Solution: 01 Instructor: Shuchi Chawla TA: Siddharth Barman Question 1 1a First we prove that the matching R is a pairing then we show that it is in fact stable. The proof for both is by contradiction. First, it is obvious that no boy is matched to more than one girl, and every boy gets matched So we only need to show that no girl gets paired with more than one boy. Assume that in R both b 1 and b 2 are matched with the same girl g . So w.l.o.g. we can say that in P , b 1 is paired with g and b 2 is paired with g 1 . On the other hand in Q , b 1 is with say g 2 and b 2 is paired with g . From the fact that both b 1 and b 2 chose g in R we have b 1 prefers g to g 2 and b 2 prefers g to g 1 . Assume w.l.o.g that g prefers b 1 to b 2 . But with the current setting this would imply that Q is not stable (instability between g and b 1 ), leading to a contradiction the assumption that R is not a pairing. Likewise if g prefers b 2 to b 1 , this would imply an instability in P . The stability proof follows closely. We assume that R is not stable, hence in R we have pairs say b - g and b - g , with the instability between b and g . Let us say b is paired with g in P . Then in P , b is paired with g or with some other girl g ′′ . Both of them would imply that P is not stable: In the first case the setting is exactly the same as R hence instability follows. For the second case note that by our construction of R we know the b prefers g to g ′′ ; since b prefers g over g the instability of b and g still exists, which is a contradiction. 1b Let R be the pairing obtained by picking every boy’s favorite girl, and R be the pairing obtained by picking every boy’s least favorite. In the last part we showed that R is a stable matching. We will now show that so is R . First, we argue that R is a matching. This follows very easily from the fact that R is a matching. Let G X denote the multiset of girls in some pairing X (that is, if some girl appears twice in X , we include her in the multiset also twice and not just once). So, for example, G P and G Q are the entire set of n girls, because both P and Q are matchings. Likewise, G R is the entire set of all girls. But G R G R = G P G Q . Therefore, G R is also the set of all girls, and R is a matching. Next, we argue by contradiction that R is stable. Suppose not. Then some boy, say A , prefers some girl, say 1, to his current partner in R , say 2. Also say that 1 is matched with some boy B in R . Without loss of generality, we can assume that A was paired with 2 in P . Then, 1 must be paired with B in Q (otherwise, A -

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern