There are $n(n \geqslant 2)$ people each writing a greeting card. First, the cards are collected, and then each person takes one card given by someone else. How many different ways can these $n$ people take the cards?
Let $n$ people be denoted as $A_{1}, A_{2}, \cdots, A_{n}$, and their corresponding greeting cards as $B_{1}, B_{2}, \cdots, B_{n}$. Let the number of different ways for $n$ people to take the cards be $a_{n}$.
It is easy to see that $a_{1}=0, a_{2}=1, a_{3}=2$.
When $n \geqslant 4$, the process of $n$ people taking greeting cards can be divided into two steps.
(1) $A_{1}$ has $n-1$ ways to choose.
(2) The person corresponding to the card chosen by $A_{1}$ then takes a card, while also considering the ways for the remaining $n-2$ people to take cards. Suppose $A_{1}$ takes card $B_{2}$, then consider the number of ways for $A_{2}$ to take a card, while also considering the ways for the remaining $n-2$ people to take cards.
This can be further divided into two categories.
(i) $A_{2}$ takes $B_{1}$, then $A_{2}, A_{3}, \cdots, A_{n}$ have $a_{n-2}$ ways to take cards;
(ii) $A_{2}$ does not take $B_{1}$, then $A_{2}, A_{3}, \cdots, A_{n}$ have $a_{n-1}$ ways to take cards.

In summary, by the principle of multiplication for step-by-step counting and the principle of addition for classification, the number of different ways for $n$ people to take cards is
$$
\begin{array}{l}
a_{n}=(n-1)\left(a_{n-1}+a_{n-2}\right) \\
\Rightarrow a_{n+1}=n\left(a_{n}+a_{n-1}\right) \\
\Rightarrow a_{n+1}-a_{n}=n a_{n}+a_{n-1}-(n-1) a_{n-2} \\
\Rightarrow a_{n+1}-(n+1) a_{n}=a_{n-1}-(n-1) a_{n-2} . \\
\text { Let } b_{n}=a_{n+1}-(n+1) a_{n} \text {. Then } b_{n}=b_{n-2} .
\end{array}
$$

When $n$ is even,
$$
\begin{array}{c}
a_{n+1}-(n+1) a_{n}=b_{n}=b_{n-2}=\cdots \\
=b_{2}=a_{3}-3 a_{2}=-1=(-1)^{n+1} .
\end{array}
$$

Then $a_{n+1}=(n+1) a_{n}+(-1)^{n+1}$.
When $n$ is odd,
$$
\begin{array}{l}
a_{n+1}-(n+1) a_{n}=b_{n}=b_{n-2}=\cdots \\
=b_{1}=a_{2}-2 a_{1}=1=(-1)^{n+1} .
\end{array}
$$

Then $a_{n+1}=(n+1) a_{n}+(-1)^{n+1}$.
Combining the cases for even and odd $n$, we have
$$
\begin{array}{l}
a_{n+1}=(n+1) a_{n}+(-1)^{n+1} \\
\Rightarrow \frac{a_{n+1}}{(n+1)!}=\frac{a_{n}}{n!}+\frac{(-1)^{n+1}}{(n+1)!} \\
\Rightarrow \frac{a_{n}}{n!}=\frac{a_{2}}{2!}+\sum_{k=3}^{n} \frac{(-1)^{k}}{k!} \\
\Rightarrow a_{n}=(n!) \sum_{k=2}^{n} \frac{(-1)^{k}}{k!} .
\end{array}
$$