2. On a basketball court, there are 5 people practicing. The tactic is for Player A to start the game (the 1st pass), and after 6 passes (with each person having an equal chance of passing and receiving the ball), it returns to Player A, who then attempts a 3-point shot. The number of different passing methods is ( ).
(A) 4100
(B) 1024
(C) 976
(D) $820 \longrightarrow$
2.D.

Let the positions of the ball correspond to points $A_{0}, A_{1}, \cdots, A_{5}$. If there is a passing relationship between two positions, a straight line is drawn between the corresponding two points. Since it finally returns to player A, the passing relationship corresponds to a hexagon $A_{0} A_{1} \cdots A_{5}$ (Figure 5).

Correspond the 5 people to 5 different colors. If the ball is passed to position $A_{i}$ for the $i$-th time, the color of the person holding the ball is used to color $A_{i}$. Thus, the problem is transformed into:

Using 5 colors to color the vertices of a hexagon, with each point colored with only one color, and adjacent points colored with different colors. If $A_{0}$ is restricted to be colored with the color of player A, how many different coloring methods are there?

More generally, consider the number of ways to color an $n$-sided polygon with $m$ colors, denoted as $a_{n}$. We have
$$
a_{3}=1 \times(m-1) \times(m-2)
$$

For $n>3$, as shown in Figure 6, $A_{0}$ has 1 way to be colored, $A_{1}$ has $(m-1)$ ways to be colored. $A_{2}$ to $A_{n-2}$ each have $(m-1)$ ways to be colored, and for $A_{n-1}$, if only considering being different from $A_{n-2}$, there are also $(m-1)$ ways to be colored. Multiplying these gives $(m-1)^{n-1}$. However, this calculation includes two scenarios: one is $A_{n-1}$ being a different color from $A_{0}$, which meets the condition, with $a_{n}$ ways; the other is $A_{n-1}$ being the same color as $A_{0}$, which does not meet the condition and needs to be excluded. If we merge $A_{n-1}$ and $A_{0}$ into one point, there are $a_{n-1}$ ways to color. Therefore,
$$
a_{n}+a_{n-1}=(m-1)^{n-1} \text {. }
$$

Rearranging and recursively,
$$
\begin{array}{l}
a_{n}-\frac{(m-1)^{n}}{m}=-\left[a_{n-1}-\frac{(m-1)^{n-1}}{m}\right] \\
=(-1)^{2}\left[a_{n-2}-\frac{(m-1)^{n-2}}{m}\right]=\cdots \\
=(-1)^{n-3}\left[a_{3}-\frac{(m-1)^{3}}{m}\right] \\
=(-1)^{n-3}\left[(m-1)(m-2)-\frac{(m-1)^{3}}{m}\right] \\
=(-1)^{n} \frac{(m-1)}{m} .
\end{array}
$$

Thus, $a_{n}=\frac{(m-1)\left[(m-1)^{n-1}+(-1)^{n}\right]}{m}$.
Taking $m=5, n=6$, we get $a_{6}=820$.