Browse · MathNet
PrintXVIII OBM
Brazil counting and probability
Problem
There are boys and girls . Each boy ranks the girls in order of preference, and each girl ranks the boys in order of preference. Show that we can arrange the boys and girls into pairs so that we cannot find a boy and a girl who prefer each other to their partners. For example if and are two of the pairs, then it must not be the case that prefers to and prefers to .
Solution
In round each unpaired boy in turn proposes to the girl he ranks highest amongst those he has not yet proposed to. If is not yet paired, or if she prefers to the boy she is currently paired with, then we pair and (and remove any existing pair for ). We claim that this algorithm terminates and gives a stable pairing.
First we must establish that it terminates. Each boy can propose to at most girls and in each round at least one boy must make a proposal, so it must terminate in rounds or less.
Second we must establish that it results in every boy and girl being paired off. Once a girl is paired, she always remains paired, although not necessarily to the same boy. Suppose girl ends up unpaired. Since there are equal numbers of boys and girls, a boy must also end up unpaired. By the end must have proposed to every girl, including . Hence must have been paired at the end of that round. Contradiction.
Finally, we must establish that the pairing is stable. Suppose not, so that we end up with pairs and , where prefers to and prefers to . Since prefers to he must have proposed to before . At the end of that round either and were paired, or was paired to whom she preferred to . In the first case, we have a contradiction because a girl can only change her pairing in favor of someone she prefers. So if she ends up paired to having earlier been paired to , then she must prefer to . Contradiction. In the second case, must prefer to and to . Again a contradiction. So the pairing is stable.
First we must establish that it terminates. Each boy can propose to at most girls and in each round at least one boy must make a proposal, so it must terminate in rounds or less.
Second we must establish that it results in every boy and girl being paired off. Once a girl is paired, she always remains paired, although not necessarily to the same boy. Suppose girl ends up unpaired. Since there are equal numbers of boys and girls, a boy must also end up unpaired. By the end must have proposed to every girl, including . Hence must have been paired at the end of that round. Contradiction.
Finally, we must establish that the pairing is stable. Suppose not, so that we end up with pairs and , where prefers to and prefers to . Since prefers to he must have proposed to before . At the end of that round either and were paired, or was paired to whom she preferred to . In the first case, we have a contradiction because a girl can only change her pairing in favor of someone she prefers. So if she ends up paired to having earlier been paired to , then she must prefer to . Contradiction. In the second case, must prefer to and to . Again a contradiction. So the pairing is stable.
Techniques
Matchings, Marriage Lemma, Tutte's theoremAlgorithmsInvariants / monovariants