Recap
- two nodes in a graph are called adjacent if there’s an edge between them.
- two nodes in a graph are called reachable if there’s a path between them.
Pigeonhole Principle
- Theorem: If $m$ objects are distributed into $n$ bins and $m > n$, then at least one bin will contain at least two objects.
- Seems easy, right?
Simple applications
- any group of 367 people must have a pair of people that share a birthday. since 366 possible birthdays (pigeonholes), 367 people (pigeons)
- Two people in San Francisco have the exact same number of hairs on their head.
- maximum number of hairs ever found on a human head is no greater than $500,000$
- there are over $800,000$ people in San Francisco
Let $A$ and $B$ be finite sets (cardinalities are natural numbers) and assume $|A| > |B|$. Think about the following statements: If $f:A \to B$, then…
- $f$ is injective. FALSE (in fact, must not be injective, as seen below)
- $f$ is not injective. TRUE, by pigeonhole principle. Technically, this works for infinite sets as well, as long as $|A| > |B|.$
- $f$ is surjective. FALSE (could be surjective, could be not surjective)
- $f$ is not surjective. FALSE (could be surjective, could be not surjective)
Proof of Pigeonhole Principle
Theorem: If $m$ objects are distributed into $n$ bins and $m > n,$ then there must be some bin that contains at least two objects.
Proof: Suppose for the sake of contradiction that, for some $m$ and $n$ where $m > n,$ there is a way to distribute $m$ objects into $n$ bins such that each bin contains at most one object.
Number the bins $1,2,\dots,n$ and let $x_i$ denote that number of objects in bin $i.$ There are $m$ objects in total, so we know that
$$
m = x_1 + x_2 + \cdots + x_n.
$$