3. (One of the more listed problems) There are $n$ people, each labeled with numbers from 1 to $n$, and there are $n$ chairs, also labeled with numbers from 1 to $n$. Question: How many different ways can these $n$ people sit on these $n$ chairs such that the $i$-th person ($i=1,2, \cdots, n$) does not sit on the $i$-th chair?
3. Solution: Let $a_{1}, a_{2}, \cdots, a_{n}$ be a permutation of the $n$ natural numbers $1,2, \cdots, n$, and satisfy
$$a_{i} \neq i \quad(i=1,2, \cdots, n)$$

Then, the permutation $a_{1}, a_{2}, \cdots, a_{n}$ clearly gives a seating arrangement for these $n$ people that meets the problem's requirements. Thus, the problem is reduced to finding the number of permutations $a_{1}, a_{2}, \cdots, a_{n}$ that satisfy condition (1). This special type of permutation without repetition is called a derangement of $1,2, \cdots, n$. Generally, $D_{n}$ denotes the number of all possible derangements of the set $\{1,2, \cdots, n\}$. The problem is to find the value of $D_{n}$.

Let $S$ be the set of all permutations of the set $\{1,2, \cdots, n\}$, then $|S|=n!$. For $j=1,2, \cdots, n$, let $P_{j}$ be the property that "in a permutation, the number $j$ is still in the $j$-th position". Let $A_{j}(j=1,2, \cdots, n)$ be the subset of $S$ consisting of all permutations that have property $P_{j}$. By definition, a derangement of $\{1,2, \cdots, n\}$ is a permutation in $S$ that does not have any of the properties $P_{1}, P_{2}, \ldots, P_{n}$. Thus, by Theorem 1 of this chapter, we have
$$\begin{aligned}
D_{n}= & |S|-\sum\left|A_{j}\right|+\sum\left|A_{i} \cap A_{j}\right|-+\cdots+(-1)^{n} \\
& \left|A_{1} \cap A_{2} \cap \cdots \cap A_{n}\right|
\end{aligned}$$

Since the set $A_{j}(j=1,2, \cdots, n)$ consists of all permutations that keep the number $j$ in the $j$-th position, $\left|A_{j}\right|$ is the number of permutations of the remaining $n-1$ elements, i.e.,
$$\left|A_{j}\right|=(n-1)!\quad(j=1,2, \cdots, n)$$

Similarly, we have
$$\begin{array}{l}
\left|A_{i} \cap A_{j}\right|=(n-2)!\quad(1<i<j<n) \\
\cdots \cdots \cdots \\
\left|A_{1} \cap A_{2} \cap \cdots \cap A_{n}\right|=0!=1
\end{array}$$

Thus, from (2), we have
$$\begin{aligned}
D_{n}= & n!-\binom{n}{1}(n-1)!+\binom{n}{2}(n-2)!-+\cdots \\
& +(-1)^{n}\binom{n}{n} 0!=n!\left(1-\frac{1}{1!}+\frac{1}{2!}-+\cdots\right. \\
& \left.+(-1)^{n} \frac{1}{n!}\right) .
\end{aligned}$$