Example 2-54 $n$ ordered elements should have $n$! different permutations. If a permutation makes all elements not in their original positions, it is called a derangement, also known as a complete permutation.
The derangement of 12 is unique, which is 21.
The derangement of 123 has 312, 231. These two can be seen as the derangement of 12, with 3 swapping places with 1 and 2, respectively. That is,
$$
\begin{array}{l}
2 \overparen{213} \rightarrow 312 \\
2 \overparen{13} \rightarrow 231
\end{array}
$$
The derangement of 1234 has
$$
\begin{array}{lll}
4321, & 4123, & 4312 \\
3412, & 3421, & 2413 \\
2143, & 3142, & 2341
\end{array}
$$

The first column is generated by 4 swapping places with 1, 2, and 3, and the remaining two elements being deranged. The second column is obtained by 4 swapping places with each number in 312 (a derangement of 123). That is,
$$
\begin{array}{l}
3124 \rightarrow 4123 \\
3 \longdiv { 1 2 4 } \rightarrow 3 4 2 1 \\
31 \overparen{24} \rightarrow 3142
\end{array}
$$

The third column is obtained by 4 swapping places with each number in another derangement 231, that is,
$$
\begin{array}{l}
2314 \rightarrow 4312 \\
2314 \rightarrow 2413 \\
23 \overparen{14} \rightarrow 2341
\end{array}
$$

The above analysis describes the method of generating derangements.
Let $D_{n}$ be the number of derangements of $n$ numbers $1,2, \cdots, n$. By selecting any one of these numbers $i$, number $i$ can swap places with each of the other $n-1$ numbers, and the remaining $n-2$ numbers can be deranged, resulting in $(n-1) D_{n-2}$ derangements. Another part is obtained by deranging the $n-1$ numbers excluding $i$, and then $i$ swapping places with each of these numbers, resulting in $(n-1) D_{n-1}$ derangements.
Combining the above analysis, we get the recurrence relation:
$$
\begin{array}{c}
D_{n}=(n-1)\left(D_{n-1}+D_{n-2}\right), D_{1}=0, D_{2}=1 \\
D_{0}=1
\end{array}
$$
(2-12) is a recurrence relation with non-constant coefficients. Below is a solution method:
$$
\begin{aligned}
E_{n}= & \frac{D_{n}}{n!} \\
\frac{D_{n}}{n!}= & \frac{(n-1)}{n!} D_{n-1}+\frac{(n-1)}{n!} D_{n-2} \\
= & \frac{(n-1)}{n} \frac{D_{n-1}}{(n-1)!}+\frac{1}{n} \frac{D_{n-2}}{(n-2)!} \\
E_{n}= & \frac{n-1}{n} \frac{D_{n-1}}{(n-1)!}+\frac{n-1}{n(n-1)} \frac{D_{n-2}}{(n-2)!} \\
= & \left(1-\frac{1}{n}\right) E_{n-1}+\frac{1}{n} E_{n-2} \\
& E_{n}-E_{n-1}=\left(\frac{-1}{n}\right)\left(E_{n-1}-E_{n-2}\right)
\end{aligned}
$$

Let $F_{n}=E_{n}-E_{n-1}$, we get the recurrence relation for $F_{n}$: $F_{n}=\left(\frac{-1}{n}\right) F_{n-1}$, then
$$
\begin{array}{l}
F_{n}=\left(-\frac{1}{n}\right) F_{n-1}=\left(-\frac{1}{n}\right)\left(-\frac{1}{n-1}\right) F_{n-2}=\cdots=(-1)^{n-1} \frac{1}{n!} F_{1} \\
F_{1}=E_{1}-E_{0}=-1
\end{array}
$$

Therefore,
$$
F_{n}=(-1)^{n} \frac{1}{n!}, \text { i.e., } E_{n}-E_{n-1}=(-1)^{n} \frac{1}{n!}
$$
$$
\begin{aligned}
E_{n} & =\frac{(-1)^{n}}{n!}+E_{n-1}=\frac{(-1)^{n}}{n!}+\frac{(-1)^{n-1}}{(n-1)!}+E_{n-2} \\
& =\frac{(-1)^{n}}{n!}+\frac{(-1)^{n-1}}{(n-1)!}+\cdots+\frac{(-1)^{2}}{2!} \\
D_{n} & =n!E_{n}=n!\left(1-\frac{1}{1!}+\frac{1}{2!}-\frac{1}{3!}+\cdots+(-1)^{n} \frac{1}{n!}\right) \approx n!\mathrm{e}^{-1}
\end{aligned}
$$

Another method:
From $D_{n}=(n-1)\left(D_{n-1}+D_{n-2}\right)$, we get
$$
\begin{aligned}
D_{n}-n D_{n-1} & =-\left[D_{n-1}-(n-1) D_{n-2}\right] \\
& =(-1)^{2}\left[D_{n-2}-(n-2) D_{n-3}\right] \\
& =\cdots=(-1)^{n-1}\left(D_{1}-D_{0}\right)
\end{aligned}
$$

Since $D_{1}=0, D_{0}=1$, we have

Let
$$
D_{n}-n D_{n-1}=(-1)^{n}
$$

Let
$$
\begin{array}{l}
G_{\mathrm{e}}(x)=D_{0}+D_{1} x+\frac{1}{2} D_{2} x^{2}+\frac{1}{3!} D_{3}(x)+\cdots \\
x: D_{1}=D_{0}+(-1)^{1} \\
\frac{x^{2}}{2!}: D_{2}=2 D_{1}+(-1)^{2} \\
\frac{x^{3}}{3!}: D_{3}=3 D_{2}+(-1)^{3} \\
+) \quad \vdots \\
\hline G_{\mathrm{e}}(x)-1=x G_{\mathrm{e}}(x)+\mathrm{e}^{-x}-1 \\
(1-x) G_{\mathrm{e}}(x)=\mathrm{e}^{-x} \\
G_{\mathrm{e}}(x)=\frac{\mathrm{e}^{-x}}{1-x}
\end{array}
$$

Therefore,
$$
\begin{array}{l}
G_{\mathrm{e}}(x)-1=x G_{\mathrm{e}}(x)+\mathrm{e}^{x}-1 \\
(1-x) G_{\mathrm{e}}(x)=\mathrm{e}^{-x} \\
G_{\mathrm{e}}(x)=\frac{\mathrm{e}^{-x}}{1-x}
\end{array}
$$
So we have
$$
D_{n}=\left(1-1+\frac{1}{2!}-\cdots \pm \frac{1}{n!}\right) n!
$$