Maths WorkshopMaths problems with full solutions
Exercise 1626Combinatorics › Counting principlesOlympiadAdded 3 Nov 2026

Pigeonhole in a graph

#pigeonhole#graph#vertex degree

Statement

In any group of n≥2n\ge2 people, show that two have the same number of friends in the group.

Hint

Each person can have 00 to n−1n-1 friends, but 00 and n−1n-1 cannot both occur.

Show solutionHide solution

Solution

Degrees. Each degree is in {0,…,n−1}\{0,\ldots,n-1\}. But 00 (no friends) and n−1n-1 (everyone else) cannot both occur: if one person has n−1n-1 friends, everyone else has ≥1\ge1; if someone has 00 friends, no one has n−1n-1.

Pigeonhole. So there are at most n−1n-1 possible degree values for nn people: two have the same degree.

Conclusion. Two people have the same number of friends.