Example 2-47 A circular region is divided into $n$ parts equally centered as shown in Figure 2-14. Using $k$ colors to paint these $n$ regions, with the requirement that adjacent regions must be of different colors, how many coloring schemes are there?
Let $a_{n}$ denote the number of coloring schemes for $n$ regions. There are only two possibilities: (1) $D_{1}$ and $D_{n-1}$ are colored the same; (2) $D_{1}$ and $D_{n-1}$ are colored differently. In the first case, $D_{n}$ has $k-1$ coloring schemes; that is, excluding the colors of $D_{1}$ and $D_{n}$, and the coloring schemes from $D_{1}$ to $D_{n-2}$ correspond one-to-one with the coloring schemes for $n-2$ regions. In the latter case, the $D_{n}$ region has $k-2$ colors available; and each coloring scheme from $D_{1}$ to $D_{n-1}$ corresponds one-to-one with the coloring schemes for $n-1$ regions.

Then
$$
\begin{array}{l}
a_{n}=(k-2) a_{n-1}+(k-1) a_{n-2} \\
a_{2}=k(k-1), a_{3}=k(k-1)(k-2)
\end{array}
$$

Using equation (2-6) we get $a_{0}=0, a_{1}=k$
The characteristic equation of equation (2-6) is
$$
\begin{array}{l}
x^{2}-(k-2) x-(k-1)=0 \\
x_{1}=k-1, x_{2}=-1 \\
a_{n}=A(k-1)^{n}+B(-1)^{n}
\end{array}
$$

Solving the equations
$$
\left\{\begin{array}{l}
A+B=k \\
(k-1) A-B=0
\end{array}\right.
$$

We get
$$
\left\{\begin{array}{l}
A=1 \\
B=k-1
\end{array}\right.
$$

Thus
$$
\begin{array}{l}
a_{n}=(k-1)^{n}+(k-1)(-1)^{n}, n \geqslant 2 \\
a_{1}=k
\end{array}
$$

Example 2-48 Find the value of the following determinant,
$$
d_{n}=\left\{\left.\begin{array}{lllllll}
1 & 1 & 0 & 0 & \cdots & 0 & 0 \\
1 & 1 & 1 & 0 & \cdots & 0 & 0 \\
0 & 1 & 1 & 1 & \cdots & 0 & 0 \\
& & & \vdots & & & \\
0 & 0 & 0 & 0 & \cdots & 1 & 1
\end{array} \right\rvert\,\right\} n \text { rows }
$$

Using the method of determinant expansion, expanding along the first row we get
$$
\begin{array}{c}
d_{n}=d_{n-1}-d_{n-2}, d_{1}=1, d_{2}=0 \\
d_{0}=1
\end{array}
$$

Using equation (2-7) we get
its characteristic equation is

Assume
$$
\begin{array}{l}
x^{2}-x+1=0 \\
x=\frac{1}{2}(1 \pm \sqrt{3} i)=\mathrm{e}^{ \pm \frac{\pi}{3} i} \\
d_{n}=k_{1} \cos \frac{n \pi}{3}+k_{2} \sin \frac{n \pi}{3}
\end{array}
$$

According to the initial conditions $d_{0}=1$ and $d_{1}=1$ we get
$$
\begin{array}{l}
k_{1}=1 \\
k_{1}\left(\frac{1}{2}\right)+k_{2}\left(\frac{\sqrt{3}}{2}\right)=1 \\
k_{2}=\frac{1}{\sqrt{3}} \\
d_{n}=\cos \frac{n \pi}{3}+\frac{1}{\sqrt{3}} \sin \frac{n \pi}{3}, \quad n \geqslant 1
\end{array}
$$

Thus we have