Maths Olympiad Prep

Library / /5 of 6

Combinatorics Difficulty 6.5 National olympiad Prove it Brazil

There are nn boys B1,B2,,BnB_1, B_2, \dots, B_n and nn girls G1,G2,,GnG_1, G_2, \dots, G_n. 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 nn pairs so that we cannot find a boy and a girl who prefer each other to their partners. For example if (B1,G3)(B_1, G_3) and (B4,G7)(B_4, G_7) are two of the pairs, then it must not be the case that B4B_4 prefers G3G_3 to G7G_7 and G3G_3 prefers B4B_4 to B1B_1.

Solution

In round kk each unpaired boy BB in turn proposes to the girl GG he ranks highest amongst those he has not yet proposed to. If GG is not yet paired, or if she prefers BB to the boy she is currently paired with, then we pair BB and GG (and remove any existing pair for GG). 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 nn girls and in each round at least one boy must make a proposal, so it must terminate in n2n^2 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 GG ends up unpaired. Since there are equal numbers of boys and girls, a boy BB must also end up unpaired. By the end BB must have proposed to every girl, including GG. Hence GG 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 (B,G)(B, G) and (B,G)(B', G'), where BB prefers GG' to GG and GG' prefers BB to BB'. Since BB prefers GG' to GG he must have proposed to GG' before GG. At the end of that round either BB and GG' were paired, or GG' was paired to BB'' whom she preferred to BB. 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 BB' having earlier been paired to BB, then she must prefer BB' to BB. Contradiction. In the second case, GG' must prefer BB'' to BB and BB' to BB''. Again a contradiction. So the pairing is stable.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.