Quantcast
Channel: Algorithm Soup
Viewing all articles
Browse latest Browse all 10

My favorite example of: the pigeonhole principle

$
0
0

This is part of a new sequence of posts titled,

My favorite example of: {x},

for different values of {x}. Today, {x} is the pigeonhole principle.

The Erdös-Szekeres Theorem: Consider any sequence of {n} distinct numbers. There must exist a subsequence {S} of {\sqrt{n}} numbers such that {S} is either entirely increasing or entirely decreasing.

The Erdös-Szekeres Theorem is a classic result in permutation combinatorics. Although the theorem was first presented in 1935, the proof I’m going to describe appears in the 1959 paper “A simple proof of a theorem of Erdös and Szekeres”, written by Abraham Seidenberg. Seidenberg’s proof is arguably one of the slickest applications of the pigeonhole principle ever.

The Proof.

Consider a sequence {x = x_1, x_2, \ldots, x_n} of {n} distinct numbers. For each number {x_i}, define

\displaystyle a_i = \text{ length of longest increasing subsequence ending in }x_i

and define

\displaystyle b_i = \text{ length of longest decreasing subsequence ending in }x_i.

For example, if {x = 1, 4, 5, 3, 2}, then {a_5 = 2} is the length of the longest increasing subsequence ending in {x_5 = 2} and {b_5 = 3} is the length of the longest decreasing subsequence ending in {x_5 = 2}.

In order to prove the theorem, Seidenberg made one crucial observation:

Observation: If {i < j} then either {a_i \neq a_j} or {b_i \neq b_j}.

To see why the observation holds, consider the case where {x_i < x_j}. Then for any increasing subsequence {S} that ends in {x_i}, the longer subsequence {S \cup \{x_j\}} is an increasing subsequence that ends in {x_j}. This implies that {a_j \ge a_i + 1} and thus that {a_i \neq a_j}.  A similar argument can be used in the case where {x_i > x_j} to show that  {b_j \ge b_i + 1}, and thus that {b_i \neq b_j}. In both cases, the observation holds.

In order to prove the theorem, our goal is to show that there is some {i} for which either {a_i \ge \sqrt{n}} or {b_i \ge \sqrt{n}}. Seidenberg realized that he could prove this with a simple application of the pigeonhole principle.

Suppose for conradiction that {a_i < \sqrt{n}} and {b_i < \sqrt{n}} for all {i}. Then there are fewer than {\sqrt{n} \cdot \sqrt{n} = n} possibilities for each pair {(a_i, b_i)}. It follows by the pigeonhole principle that at least two of the pairs

\displaystyle (a_1, b_1), (a_2, b_2), (a_3, b_3), \ldots, (a_n, b_n)

are equal to one-another. That is, there exists i \neq j such that (a_i, b_i) = (a_j, b_j). But this contradicts Seidenberg’s observation, and thus completes the proof.


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles



Latest Images