Problem: A derangement of $1,2,3,4,\ldots, n$ is a rearrangement such that no number in the arrangement is equal to its index (assuming indexing starts from $1$ and goes up to $n$). How many derangements of $1,2,3,4,\ldots, n$ are there? Solution: Let $A_i$ be the set of all permutations where $i$ is in the right place. We want to count $\left|\bigcup_{i=1}^{n} A_i\right|$. We can deploy PIE! We notice that the sum of the cardinalities is $\binom{n}{1}(n-1)!$. The sum of the cardinalities of the pairwise intersections is $\binom{n}{2}(n-2)!$. We continue this pattern until we see that the cardinality of the intersection of all $A_i$ is $\binom{n}{n} (n-n)!$. We get that $ \left|\bigcup_{i=1}^{n} A_i\right| = \binom{n}{1}(n-1)! - \binom{n}{2}(n-2)! + \ldots \pm \binom{n}{n}(n-n)! = n!-\frac{n!}{2}+\frac{n!}{3}-\frac{n!}{4}+\ldots + \pm \frac{n!}{n!} = n! \left\{\frac{1}{1!}-\frac{1}{2!}+\frac{1}{3!}+\ldots \pm \frac{1}{n!}\right\} .$ So, the number of derrangements is $n!(\frac{1}{0!}-\frac{1}{1!}+\frac{1}{2!}-\ldots \pm \frac{1}{n!})$. We can see that what is inside of the paranthesis is very close to $e^{-1}$ since $e^{x} = \frac{1}{0!}+\frac{x}{1!}+\frac{x^2}{2!}+\frac{x^{3}}{3!}$ The probability that a permutation is a derangement is about $\frac{1}{e}$ ! It turns out, this is related to another problem. It turns out that $\left[ \frac{n!}{e} \right] \to 0$ as $n \to \infty$. We can go further to claim the number of derangements of $1,2,3,\ldots, n$ is the result of rounding $\frac{n!}{e}$. To prove this, notice that the number of derangements is an integer and so is $r \left(\frac{n!}{e}\right)$ where $r$ is the rounding function. The crux is to prove that the distance between them is lt; \frac{1}{2}$ (which means they are the same). So we ask, what is the distance? Let $R_n :=\frac{n!}{e}$ and let $D_n$ be the number of derangements of $1,2,3,\ldots, n$. Note that $ R_n-D_n = \frac{n! \left(\frac{1}{0!}-\frac{1}{1!} + \frac{1}{2!} - \ldots \mp \frac{1}{n!} \pm \frac{1}{(n+1)!} \mp \ldots \right)}{n!(\frac{1}{0!}-\frac{1}{1!}+\frac{1}{2!} - \ldots \pm \frac{1}{n!})} = n! \left(\mp \frac{1}{(n+1)!} \pm \frac{1}{(n+2)!} \mp \ldots\right) .$Then, using the triangle inequality, we find that $ |R_n - D_n| \le \left|\mp\frac{1}{(n+1)!}\right| + \left|\pm \frac{n!}{(n+2)!}\right| + \left|\mp \frac{n!}{(n+3)!}\right| = \frac{1}{n+1}+\frac{1}{(n+1)(n+2)}+\ldots .$We can bound this further by saying $R_n-D_n \le \frac{1}{n+1}+\frac{1}{(n+1)^2}+\frac{1}{(n+1)^3}+\ldots = \frac{1}{n}$ This tells us that $R_n-D_n$ is always within distance $\frac{1}{n}$ (specifically the number of derangements of $1,2,\ldots, n$).