Olympiad combinatorics replaces messy casework with structural bijections: instead of counting a complicated set A A directly, construct a 1-to-1 correspondence f: A approaches Bf:A→B onto a clean set \( B \) of binary strings, lattice paths, or subset choices. Paired with Stars and Bars, the Principle of Inclusion–Exclusion (PIE), and Dirichlet’s Pigeonhole Principle, these tools form the backbone of NSMO, KAUST KMC, AMC/AIME, and IMO combinatorics.
1. Principle of Inclusion–Exclusion (PIE): For finite subsets \( A_1, \dots, A_m \subseteq U \), the number of elements in NONE of the \( A_i \) is:
\[ \left|U \setminus \bigcup_{i=1}^m A_i\right| = |U| - \sum_{i} |A_i| + \sum_{iIn particular, the number of derangements \( D_n \) (permutations of \( \{1,\dots,n\} \) with \( \pi(i) \ne i \) for all \( i \)) is \( D_n = n! \sum_{k=0}^n \frac{(-1)^k}{k!} \) (\( D_1=0, D_2=1, D_3=2, D_4=9, D_5=44 \)).
2. Generalized Pigeonhole Principle: Placing \( N \) objects into \( k \) boxes forces at least one box to contain at least \( \lceil N / k \rceil \) objects.
◆ Proof — Combinatorial Proof of the Hockey-Stick Identity by Last Element
How many \( (r + 1) \)-element subsets can be chosen from \( S = \{1, 2, \dots, n + 1\} \)? On the right-hand side, by definition, there are \( \binom{n+1}{r+1} \) such subsets. On the left-hand side, partition those subsets according to their largest element \( m = i + 1 \), which must satisfy \( r + 1 \le i + 1 \le n + 1 \) (so \( r \le i \le n \)). Once the largest element \( i + 1 \) is fixed, the remaining \( r \) elements can be chosen freely from \( \{1, 2, \dots, i\} \) in \( \binom{i}{r} \) ways. Summing over disjoint cases \( i = r, r+1, \dots, n \) yields \( \sum_{i=r}^n \binom{i}{r} = \binom{n+1}{r+1} \). \( \blacksquare \)
Exact binomial coefficients \(\binom{n}{k}\), Stars & Bars, and derangement counts
Parameter / Invariant
Computed Value
Binomial \(\binom{n}{k}\)C(8, 3) = 56
Stars & Bars \(\binom{n+k-1}{k-1}\)C(10, 2) = 45
Non-Adjacent \(\binom{n-k+1}{k}\)C(6, 3) = 20
Vary \(n\) and \(k\) to compare standard subset choices \(\binom{n}{k}\), weak compositions \(\binom{n+k-1}{k-1}\), and non-adjacent selections \(\binom{n-k+1}{k}\).
Ramsey number \(R(3,3) = 6\) via Pigeonhole: vertex \(v_1\) has \(5\) incident edges in \(2\) colors, so by Pigeonhole \(\lceil 5/2 \rceil = 3\) edges share a color (say to \(v_2, v_3, v_4\)); either one edge among \(\{v_2,v_3,v_4\}\) matches that color (triangle with \(v_1\)) or all \(3\) have the opposite color (triangle \(v_2 v_3 v_4\))!
Worked Example 4.A — Stars and Bars with Parity & Lower Bounds (AMC 10/12 & NSMO)
Problem. How many ordered quadruples \( (w, x, y, z) \) of positive ODD integers satisfy \( w + x + y + z = 24 \)?
▸ Show step-by-step solution
Parameterize every positive odd integer cleanly as \( 2a + 1 \) with non-negative integer \( a \ge 0 \): Set \( w = 2a + 1,\; x = 2b + 1,\; y = 2c + 1,\; z = 2d + 1 \) where \( a, b, c, d \in \mathbb{Z}_{\ge 0} \). Substituting into the sum: \[ (2a + 1) + (2b + 1) + (2c + 1) + (2d + 1) = 24 \iff 2(a + b + c + d) = 20 \iff a + b + c + d = 10. \] Now apply non-negative Stars and Bars with \( n = 10 \) stars and \( k = 4 \) variables: \[ \binom{10 + 4 - 1}{4 - 1} = \binom{13}{3} = \frac{13 \times 12 \times 11}{6} = 286. \]
Worked Example 4.B — Stars and Bars + PIE for Upper Bounds (AIME / KAUST KMC)
Problem. How many integers between \( 0 \) and \( 9999 \) inclusive have a sum of decimal digits equal to \( 14 \)?
▸ Show step-by-step solution
Write a 4-digit padded string \( d_1 d_2 d_3 d_4 \) with \( 0 \le d_i \le 9 \) and \( d_1 + d_2 + d_3 + d_4 = 14 \). 1. Unrestricted non-negative solutions (\( d_i \ge 0 \)): \( \binom{14 + 4 - 1}{3} = \binom{17}{3} = 680 \). 2. Let \( A_i \) be the bad set where \( d_i \ge 10 \). Since \( 10 + 10 = 20 > 14 \), at most ONE digit can be \( \ge 10 \) (all pairwise intersections \( A_i \cap A_j = \emptyset \)!). 3. For \( A_1 \), set \( d_1' = d_1 - 10 \ge 0 \), giving \( d_1' + d_2 + d_3 + d_4 = 4 \), which has \( \binom{4 + 4 - 1}{3} = \binom{7}{3} = 35 \) solutions. 4. By PIE across the \( 4 \) digits: \[ 680 - \binom{4}{1} \cdot 35 = 680 - 140 = 540. \]
Worked Example 4.C — Geometric Pigeonhole on Lattice Midpoints & Unit Squares (NSMO)
Problem. (a) What is the minimum number of lattice points \( (x_i, y_i) \in \mathbb{Z}^3 \) in 3D space that MUST be chosen to guarantee at least two chosen points have a midpoint that is ALSO an integer lattice point? (b) If \( 10 \) points are placed inside a \( 3 \times 3 \) square, prove two lie at distance \( \le \sqrt{2} \).
▸ Show step-by-step solution
(a) The midpoint \( \left(\frac{x_1+x_2}{2}, \frac{y_1+y_2}{2}, \frac{z_1+z_2}{2}\right) \) is in \( \mathbb{Z}^3 \) iff \( x_1 \equiv x_2 \), \( y_1 \equiv y_2 \), and \( z_1 \equiv z_2 \pmod 2 \). Each coordinate has \( 2 \) parities (Even/Odd), creating \( 2^3 = 8 \) parity classes (pigeonholes). Choosing \( 8 \) points can place one in each parity class, whereas choosing \( 8 + 1 = 9 \) points guarantees by Pigeonhole that two share identical parity in all three coordinates! (b) Partition the \( 3 \times 3 \) square into \( 9 \) unit \( 1 \times 1 \) subsquares. With \( 10 \) points in \( 9 \) boxes, one \( 1 \times 1 \) box contains at least \( 2 \) points, and the maximum distance inside a \( 1 \times 1 \) square is its diagonal \( \sqrt{1^2 + 1^2} = \sqrt{2} \)!
Worked Example 4.D — Partial Derangements (KAUST Finals / Olympiad Classic)
Problem. Six research fellows at KAUST submit 6 distinct lab notebooks for blind peer review. How many ways can the 6 notebooks be redistributed so that exactly 2 fellows receive their own notebook and the remaining 4 fellows each receive someone else's notebook?
▸ Show step-by-step solution
Decompose into two independent decisions: 1. Choose WHICH \( 2 \) of the \( 6 \) fellows are fixed points: \( \binom{6}{2} = 15 \) ways. 2. Derange the remaining \( 4 \) notebooks so NONE of those \( 4 \) fellows receives their own notebook: the number of derangements of \( 4 \) items is: \[ D_4 = 4!\left(1 - 1 + \frac{1}{2!} - \frac{1}{3!} + \frac{1}{4!}\right) = 24 - 24 + 12 - 4 + 1 = 9. \] By the multiplication rule, total valid redistributions \( = 15 \times 9 = 135 \).
Never count "at least one from each category" by picking 1 from each first and multiplying by the rest! For example, choosing \( 5 \) balls from \( 3 \) distinct colors so every color appears is NOT \( \binom{n_1}{1}\binom{n_2}{1}\binom{n_3}{1}\binom{N-3}{2} \) — that counts a configuration with \( 3 \) red balls three separate times! Always use PIE (total minus missing \( \ge 1 \) color plus missing \( \ge 2 \) colors).
▲ Contest Strategy — Small-n Sanity Verification on Combinatorial Formulas
Before committing to a combinatorial expression like \( \binom{n-k+1}{k} \) vs \( \binom{n-k}{k} \), plug in \( n = 4, k = 2 \) by hand in 5 seconds! For non-adjacent pairs from \( \{1,2,3,4\} \), the valid pairs are \( \{1,3\}, \{1,4\}, \{2,4\} \) (\( 3 \) ways), immediately confirming \( \binom{4-2+1}{2} = \binom{3}{2} = 3 \) rather than \( \binom{2}{2} = 1 \)!
[Practice 4.1 · NSMO Stage 1 / Easy] In how many ways can 4 books be chosen from a shelf of 11 distinct books arranged in a row so that NO two chosen books were adjacent on the shelf?
💡 Hint 1 of 3
There are \( 11 - 4 = 7 \) unchosen books remaining on the shelf.
💡 Hint 2 of 3
Those 7 unchosen books create \( 7 + 1 = 8 \) gaps (including the two ends).
💡 Hint 3 of 3
Choose \( 4 \) of those \( 8 \) gaps to place the chosen books: \( \binom{8}{4} \).
Using the gap bijection \( \binom{n - k + 1}{k} \) with \( n = 11, k = 4 \), we obtain \( \binom{11 - 4 + 1}{4} = \binom{8}{4} = \frac{8 \times 7 \times 6 \times 5}{24} = 70 \) ways.
[Practice 4.4 · AIME / KAUST KMC / Hard] How many ordered pairs of subsets \( (A, B) \) of \( S = \{1, 2, 3, 4, 5\} \) satisfy \( A \cap B = \emptyset \) and \( A \cup B \ne S \)?
💡 Hint 1 of 3
For \( A \cap B = \emptyset \), each element \( x \in S \) has independently \( 3 \) valid states: \( x \in A \) only, \( x \in B \) only, or \( x \notin A \cup B \).
💡 Hint 2 of 3
Thus there are \( 3^5 = 243 \) disjoint pairs \( (A, B) \) in total.
💡 Hint 3 of 3
Subtract the pairs where \( A \cup B = S \) (each element has only \( 2 \) states: \( x \in A \) or \( x \in B \), giving \( 2^5 = 32 \)).
Each element of \( S \) has \( 3 \) disjoint-subset states, giving \( 3^5 = 243 \) pairs with \( A \cap B = \emptyset \). Subtracting the \( 2^5 = 32 \) partitions where \( A \cup B = S \) leaves \( 243 - 32 = 211 \).
[Practice 4.5 · NSMO National Finals / Pigeonhole] What is the minimum number of distinct integers that must be selected from \( \{1, 2, \dots, 50\} \) to guarantee that at least two selected integers sum to \( 51 \)?
💡 Hint 1 of 3
Pair up the elements of \( \{1, \dots, 50\} \) into disjoint boxes that sum to \( 51 \): \( \{1,50\}, \{2,49\}, \dots, \{25,26\} \).
💡 Hint 2 of 3
How many such two-element pigeonholes are formed?
💡 Hint 3 of 3
With \( 25 \) boxes, \( 25 \) numbers could take \( \{1, 2, \dots, 25\} \) with no sum \( 51 \); adding \( 1 \) more triggers Pigeonhole!
Partition \( \{1, \dots, 50\} \) into \( 25 \) pairs \( \{k, 51 - k\} \) for \( k = 1, \dots, 25 \). Choosing \( 25 \) integers (e.g., \( 1, 2, \dots, 25 \)) avoids any pair, whereas by the Pigeonhole Principle, selecting \( 25 + 1 = 26 \) integers forces two to fall into the same pair \( \{k, 51-k\} \) and sum to \( 51 \).