% This is lecture no. 2 of MH1301/: Discrete Mathematics.

\chapter{Pigeonhole Principle, Permutations, \& Combinations}%
\label{cha:pigeonhole_principle_permutations_&_combinations}

\section{Pigeons \& Pigeonholes}%
\label{sec:pigeons_&_pigeonholes}

\begin{exmp}
	Suppose that a flock of 20 pigeons flies into a set of 19 pigeonholes to roost.
	Prove that at least one of these 19 pigeonholes must have at least two pigeons in it.
	\begin{sol}
		Prove the claim by contradiction.
		If each pigeonhole has at most one pigeon in it, then at most 19 pigeons, one per hole, could be accomodated, which is less that the total number of pigeons.
	\end{sol}
\end{exmp}

\begin{thrm}
	Pigeonhole Principle.
	For any two finite sets $X$ and $Y$ such that $|X|>|Y|$ and any function $f:X\mapsto Y$, there exists inputs $x\neq x^{\prime}$, such that $f(x)=f(x^{\prime})$.
\end{thrm}
\begin{proof}
	If for all inputs $x\neq x^{\prime}$, $f(x)\neq f(x^{\prime})$, then $f$ is injective, so $|Y|\geqslant |X|$, which goes against the assumptions.
\end{proof}
