This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 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...
View Full Document
This note was uploaded on 02/17/2011 for the course CS 577 taught by Professor Joseph during the Spring '08 term at Wisconsin.
- Spring '08