ConceptComplete

Pigeonhole and Inclusion-Exclusion - Examples and Constructions

Complex applications of the pigeonhole principle and inclusion-exclusion often require creative problem formulation. These examples illustrate sophisticated techniques for identifying appropriate "pigeons" and "holes" or for structuring inclusion-exclusion calculations.

ExampleErdΕ‘s-Szekeres Theorem Application

In any sequence of n2+1n^2 + 1 distinct real numbers, there exists either an increasing subsequence of length n+1n+1 or a decreasing subsequence of length n+1n+1.

Proof sketch: Label each element aia_i in the sequence with (xi,yi)(x_i, y_i) where xix_i is the length of the longest increasing subsequence ending at aia_i and yiy_i is the length of the longest decreasing subsequence ending at aia_i.

If no increasing or decreasing subsequence has length n+1n+1, then all labels (xi,yi)(x_i, y_i) satisfy 1≀xi≀n1 \leq x_i \leq n and 1≀yi≀n1 \leq y_i \leq n. This gives only n2n^2 possible labels. With n2+1n^2 + 1 elements, by the pigeonhole principle, two elements aia_i and aja_j (with i<ji < j) must have the same label.

But if ai<aja_i < a_j, then xj>xix_j > x_i (contradiction), and if ai>aja_i > a_j, then yj>yiy_j > y_i (contradiction). Therefore, some sequence must have length n+1n+1.

ExampleChromatic Number and Pigeonhole

In any graph with nn vertices and chromatic number Ο‡(G)\chi(G), there exists an independent set of size at least ⌈n/Ο‡(G)βŒ‰\lceil n/\chi(G) \rceil.

Proof: In a proper kk-coloring of GG (where k=Ο‡(G)k = \chi(G)), vertices are partitioned into kk color classes, each forming an independent set. By the pigeonhole principle, at least one color class contains at least ⌈n/kβŒ‰\lceil n/k \rceil vertices.

ExampleInclusion-Exclusion for Euler's Totient Function

Euler's totient function Ο•(n)\phi(n), which counts integers from 1 to nn that are coprime to nn, can be computed using inclusion-exclusion. If n=p1a1p2a2β‹―pkakn = p_1^{a_1} p_2^{a_2} \cdots p_k^{a_k}, then: Ο•(n)=n∏i=1k(1βˆ’1pi)\phi(n) = n \prod_{i=1}^{k} \left(1 - \frac{1}{p_i}\right)

This follows from inclusion-exclusion: let AiA_i be the set of integers from 1 to nn divisible by pip_i. Then: Ο•(n)=nβˆ’βˆ£β‹ƒi=1kAi∣\phi(n) = n - \left|\bigcup_{i=1}^{k} A_i\right|

Applying inclusion-exclusion: =nβˆ’βˆ‘inpi+βˆ‘i<jnpipjβˆ’βˆ‘i<j<β„“npipjpβ„“+β‹―= n - \sum_{i} \frac{n}{p_i} + \sum_{i<j} \frac{n}{p_i p_j} - \sum_{i<j<\ell} \frac{n}{p_i p_j p_\ell} + \cdots =n(1βˆ’βˆ‘i1pi+βˆ‘i<j1pipjβˆ’β‹―β€‰)=n∏i=1k(1βˆ’1pi)= n\left(1 - \sum_i \frac{1}{p_i} + \sum_{i<j} \frac{1}{p_i p_j} - \cdots\right) = n\prod_{i=1}^{k}\left(1 - \frac{1}{p_i}\right)

ExampleCounting Functions with Restrictions

How many functions f:{1,2,3,4,5}β†’{1,2,3}f: \{1,2,3,4,5\} \to \{1,2,3\} are there such that ff is onto (surjective)?

Using inclusion-exclusion, let AiA_i be the set of functions that do not map to ii. We want ∣A1c∩A2c∩A3c∣|A_1^c \cap A_2^c \cap A_3^c|, which by complement equals the total minus ∣A1βˆͺA2βˆͺA3∣|A_1 \cup A_2 \cup A_3|.

Total functions: 35=2433^5 = 243

∣A1∣=∣A2∣=∣A3∣=25=32|A_1| = |A_2| = |A_3| = 2^5 = 32 (functions using only 2 values)

∣A1∩A2∣=∣A1∩A3∣=∣A2∩A3∣=15=1|A_1 \cap A_2| = |A_1 \cap A_3| = |A_2 \cap A_3| = 1^5 = 1 (functions using only 1 value)

∣A1∩A2∩A3∣=0|A_1 \cap A_2 \cap A_3| = 0 (impossible to map to no values)

By inclusion-exclusion: ∣A1βˆͺA2βˆͺA3∣=3(32)βˆ’3(1)+0=96βˆ’3=93|A_1 \cup A_2 \cup A_3| = 3(32) - 3(1) + 0 = 96 - 3 = 93

Therefore, the number of onto functions is 243βˆ’93=150243 - 93 = 150.

Remark

A powerful technique called the "pigeonhole principle in continuous settings" applies to continuous domains. For example, if f:[0,1]β†’Rf: [0,1] \to \mathbb{R} is continuous with f(0)=f(1)f(0) = f(1), then for any positive integer nn, there exist x,y∈[0,1]x, y \in [0,1] with ∣xβˆ’y∣=1/n|x-y| = 1/n and f(x)=f(y)f(x) = f(y). This follows from considering the nn intervals [0,1/n],[1/n,2/n],…,[(nβˆ’1)/n,1][0, 1/n], [1/n, 2/n], \ldots, [(n-1)/n, 1] and applying the intermediate value theorem with pigeonhole reasoning.

These examples demonstrate the versatility and power of these principles in advanced problem-solving contexts.