Competition mathematics and problem solving
Olympiad combinatorics
Competition problems on counting, coloring and combinatorial games, solved with clever constructions.
IntuitionCounting the same thing two ways
Imagine a school dance where every student either dances with a partner or stands alone. If you count "number of dancing pairs times two" you get the same total as counting "how many students are dancing" — because each pair contributes exactly one dancer to each side. This trick, counting one set of objects in two different ways and setting the two counts equal, is called double counting, and it is one of the sharpest tools in olympiad combinatorics: instead of building an explicit formula, you find two honest descriptions of the same quantity and read off an identity or an inequality for free.
SchoolDouble counting and the handshake lemma
Definition: Double counting
A double counting argument computes the size of one set (often a set of pairs, or incidences between two kinds of objects) in two different ways, then equates the two expressions. In a graph , the classic instance counts the set of "vertex-edge incidences" (pairs with an endpoint of ): each edge contributes exactly 2 incidences, while each vertex contributes incidences.
Here is the vertex set, the edge set, and the number of edges touching vertex . The left side counts incidences vertex-by-vertex; the right side counts the same incidences edge-by-edge (2 per edge). Because both sides count the exact same set, an immediate corollary is that the number of odd-degree vertices is always even — a fact used constantly in olympiad graph problems.
This second identity comes from counting, in two ways, the number of ways to choose people from a group of boys and girls (proved in full below): directly it is , and by splitting on how many boys are chosen it is . The same two-ways-of-counting mindset also drives extremal questions: instead of counting an exact quantity, we bound it from above by comparing two ways of counting a related structure, as in Turán-type theorems below.
| Technique | Core idea | Example use |
|---|---|---|
| Double counting | Count the same set two different ways and equate the results | |
| Turán-type extremal bound | Bound how many edges/sets can avoid a forbidden substructure | for triangle-free |
| Combinatorial Nullstellensatz | A nonzero coefficient in a cleverly built polynomial forces a nonzero point on a grid | Proving existence of a zero-sum or rainbow substructure |
UndergraduateTwo cornerstone theorems
If a graph on vertices contains no triangle (), then , and this bound is achieved exactly by the complete bipartite graph with parts of size and .
Why is it true?
A triangle-free graph cannot let two adjacent vertices share a common neighbor, so their combined degree is tightly capped by ; splitting the vertices into two roughly equal groups and connecting every cross pair saturates this cap everywhere at once, which is why the balanced complete bipartite graph is the extremal example.
Proof
We induct on . For the claim is trivial since and any graph on at most 2 vertices has at most 1 edge.
Suppose the statement holds for all triangle-free graphs on fewer than vertices, and let be triangle-free on vertices. If has no edges the bound holds trivially, so assume has an edge . Since is triangle-free, and have no common neighbor, i.e. .
Because and are disjoint subsets of the -vertex set, .
Remove and from to get a triangle-free graph on vertices. Every edge of is either the edge , an edge from or to the rest, or an edge of ; counting carefully, (the corrects for the edge being counted once inside but it is not an edge of ).
By the induction hypothesis , so . A direct computation gives , and checking the even/odd cases of separately shows exactly. Hence , completing the induction.
For the extremal case, the complete bipartite graph with parts of size and has no triangle (any triangle would need an edge inside one part, but there are none) and has exactly edges, so the bound is tight.
For every integer , .
Why is it true?
Both sides count the same thing — the number of ways to pick people out of — so no algebraic manipulation of binomial coefficients is needed at all, only a careful description of one selection process in two different orders.
Proof
Consider a set of people consisting of boys and girls. We count, in two ways, the number of ways to choose a committee of exactly people from this set of .
Directly, by definition, this number is , since we are simply choosing objects out of .
Alternatively, split every valid committee according to how many boys it contains. If the committee contains exactly boys for some with , then those boys can be chosen in ways, and the remaining committee members must be girls, chosen from the girls in ways. By the symmetry identity , the number of committees with exactly boys is .
Every valid committee of people has some well-defined number of boys between and , and no committee is counted twice across different values of , so summing over all gives the total number of committees as .
Since both expressions count exactly the same set of committees, they must be equal: .
UndergraduateReal-World Applications and Worked Examples
Double counting and extremal graph bounds are not just competition tricks: network engineers use handshake-lemma-style degree arguments to check the feasibility of a proposed connection topology before laying cable, and Turán-type triangle-free bounds appear in the design of interference-free wireless channel assignments (two transmitters that would create a triangle of mutual interference cannot all be simultaneously active). The two worked examples below show the double-counting and extremal-bound techniques in concrete competition settings.
Example: The handshake parity puzzle
At a conference of people, some pairs shake hands (each pair at most once). Prove that the number of people who shook hands an odd number of times is even.
Solution
Model the people as vertices of a graph , and draw an edge between two people exactly when they shook hands; then the number of handshakes person made is .
By the handshake lemma, , which is an even number regardless of how many handshakes occurred.
Split the sum into people with even degree and people with odd degree: . The first sum is a sum of even numbers, hence even.
Since the total sum is even and the first partial sum is even, the second partial sum (sum of odd degrees) must also be even. But a sum of odd numbers is even only if there is an even number of terms, so the number of people with odd degree — the number of people who shook hands an odd number of times — must be even.
Example: Maximum interference-free channel graph on 9 stations
A wireless network has stations; a link between two stations is allowed only if it creates no triangle of mutual interference (no stations pairwise linked). What is the maximum possible number of links, and which layout achieves it?
Solution
The condition "no triangle of mutual interference" is exactly the triangle-free condition of Mantel's theorem with stations, so the maximum number of links is .
To achieve this bound, split the stations into two groups of sizes and , and link every pair of stations that are in different groups (a complete bipartite layout ), while allowing no links within a group.
This layout has no triangle, because any triangle would require an edge between two stations in the same group, and there are none. The number of links is exactly , matching the bound from Mantel's theorem, so this is optimal.
By Mantel's theorem, a triangle-free graph on vertices has at most how many edges?
At a party of people, some pairs shake hands. By the handshake lemma, which of the following could NOT be the number of people who shook hands an odd number of times?
Using a double-counting argument (choosing people from boys and girls), the sum equals which closed form?
Combinatorial Nullstellensatz is most directly useful for competition problems that ask you to show a combinatorial structure exists by proving:
References
- Noga Alon (1999). Combinatorial Nullstellensatz
- Béla Bollobás (1998). Modern Graph Theory
- Titu Andreescu, Zuming Feng (2003). 102 Combinatorial Problems