Maths WorkshopMaths problems with full solutions
Exercise 1974Combinatorics › Graph theoryOlympiadAdded 5 Nov 2026

Hall's marriage theorem and a deck of cards

#Hall's theorem#matchings#bipartite graphs#induction

Statement

  1. (Hall) Let XX and YY be the two sides of a bipartite graph. Suppose that for every subset A⊆XA\subseteq X, ∣N(A)∣≥∣A∣|N(A)|\ge|A|. Prove that there is a matching that covers all of XX.
  2. The 5252 cards of a deck (13 ranks, four cards of each rank) are dealt into 1313 piles of 44 cards. Prove that one can choose one card from each pile so that the 1313 chosen cards have 1313 different ranks.
Hint

For 1, induct on ∣X∣|X|. Distinguish whether every proper non-empty AA has ∣N(A)∣>∣A∣|N(A)|>|A| or whether some AA has ∣N(A)∣=∣A∣|N(A)|=|A|. For 2, let XX be the set of piles and YY the set of ranks.

Show solutionHide solution

Solution

1. Induction on ∣X∣|X|. If ∣X∣=1|X|=1, the single vertex has a neighbour.

Let ∣X∣≥2|X|\ge2.

*Case 1: ∣N(A)∣≥∣A∣+1|N(A)|\ge|A|+1 for every non-empty proper subset A⊂XA\subset X.* Pick x∈Xx\in X and y∈N(x)y\in N(x); match them and delete both. For any non-empty A⊆X∖{x}A\subseteq X\setminus\{x\}, ∣N′(A)∣≥∣N(A)∣−1≥∣A∣|N'(A)|\ge|N(A)|-1\ge|A|, so Hall's condition still holds and induction gives a matching of the rest.

*Case 2: some non-empty proper A⊂XA\subset X has ∣N(A)∣=∣A∣|N(A)|=|A|.* By induction AA can be matched into N(A)N(A). In the remaining graph, for B⊆X∖AB\subseteq X\setminus A,
∣N(B)∖N(A)∣=∣N(A∪B)∣−∣N(A)∣≥∣B∣,|N(B)\setminus N(A)|=|N(A\cup B)|-|N(A)|\ge|B|,
so Hall's condition holds and induction matches X∖AX\setminus A. The two matchings together cover XX. ∎

2. The cards. Let XX be the piles, YY the ranks, and join a pile to a rank if the pile contains a card of that rank. Take any kk piles: they contain 4k4k cards, and each rank has exactly 44 cards, so these piles contain cards of at least kk distinct ranks. By Hall there is a matching assigning to each pile a distinct rank present in it. ∎

Lesson. When you need a system of distinct representatives, check Hall's condition.