Example 2. Rearrange $1,2,3,4,5,6,7,8$.
(1) such that the even numbers are in their original positions, and the odd numbers are not in their original positions, how many different arrangements are there?
(2) such that the prime numbers are in the odd positions, and the composite numbers are in the even positions, how many different arrangements are there?
(3) such that the even numbers are in the even positions but not in their original positions; the odd numbers are in the odd positions but also not in their original positions, how many different arrangements are there?
(4) if at least one number is in its original position, how many different arrangements are there? How many different arrangements are there?
(6) if at least 4 numbers are in their original positions, how many different arrangements are there?
(7) such that the even numbers are in the even positions but exactly two are not in their original positions; the odd numbers are in the odd positions but exactly two are not in their original positions, how many different arrangements are there?
(8) such that the even numbers are in the even positions and at least two are not in their original positions; the odd numbers are in the odd positions and at least two are not in their original positions, how many different arrangements are there?
Solution: (1) In essence, it is the Bernoulli-Euler letter misplacement problem for $n=4$, the number of different arrangements is
$$
u_{1}=9 \text { (ways). }
$$
(2) The different arrangements of even numbers in odd positions and odd numbers in even positions are 4! ways each. By the multiplication principle, the number of different arrangements for this problem is
$(4!)^{2}=576$ (ways).
(3) Similar to the 7th question of Example 1, the number of different arrangements is
$$
\left(u_{4}\right)^{2}=81 \text { (ways). }
$$
(4) Using the exclusion method. For a full permutation of 8 numbers, there are
8! ways of arrangement, minus the arrangements where no number is in its original position, which should be
$$
\begin{aligned}
& 8!-u_{8} \\
= & 8!-8!\quad\left(\frac{1}{2!}-\frac{1}{3!}+\frac{1}{4!}-\frac{1}{5!}+\frac{1}{6!}-\frac{1}{7!}\right. \\
& \left.+\frac{1}{8!}\right) \\
= & 40320-14833=25487 \text { (ways). }
\end{aligned}
$$
(5) From the numbers $1,2,3,4,5,6,7,8$, select 4 numbers, and they are in their original positions, there are $C_{8}^{4}$ ways of selection, the remaining 4 numbers are not in their original positions, there are $u_{4}$ ways of arrangement. Therefore, by the multiplication principle, the number of different arrangements is
$$
C_{8}^{4} \cdot u_{4}=70 \times 9=630 \text { (ways). }
$$
(6) Using the exclusion method. First, perform a full permutation of 8 numbers, there are 8! ways of arrangement, then subtract the arrangements where $i$ numbers are in their original positions (i=0,1,2,3), hence the number of different arrangements is:
$$
\begin{array}{l}
8!-u_{8}-C_{8}^{1} \cdot u_{7}-C_{8}^{2} \cdot u_{6}-C_{8}^{3} \cdot u_{5} \\
=8!-8!\left(\frac{1}{2!}-\frac{1}{3!}+\frac{1}{4!}-\frac{1}{5!}+\frac{1}{6!}-\frac{1}{7!}\right. \\
\left.+\frac{1}{8!}\right)-8!\left(\frac{1}{2!}-\frac{1}{3!}+\frac{1}{4!}-\frac{1}{5!}+\frac{1}{6!}\right. \\
\left.-\frac{1}{7!}\right)-\frac{8!}{2!}\left(\frac{1}{2!}-\frac{1}{3!}+\frac{1}{4!}-\frac{1}{5!}+\frac{1}{6!}\right) \\
-\frac{8!}{3!}\left(\frac{1}{2!}-\frac{1}{3!}+\frac{1}{4!}-\frac{1}{5!}\right) \text {. } \\
=40320-14833-14832-7420-2464 \\
=771 \text { (ways). } \\
\end{array}
$$
Using the classification method. At least 4 numbers are in their original positions, which can be divided into exactly $i$ numbers in their original positions: $(i=4,5,6, 8$. Note: It is impossible to have exactly 7 numbers in their original positions), hence the number of different arrangements is
$$
\begin{array}{l}
C_{8}^{4} \cdot u_{4}+C_{8}^{5} \cdot u_{3}+C_{8}^{6} \cdot u_{2}+C_{8}^{8} \\
=630+112+28+1 \\
=771 \text { (ways). }
\end{array}
$$
(7) First arrange the even numbers, similar to question (5), the number of different arrangements is $C_{4}^{2} \cdot u_{2}$ ways; then arrange the odd numbers, the number of different arrangements is also $C_{4}^{2} \cdot u_{2}$ ways. By the multiplication principle, the total number of different arrangements is
$$
\left(C_{4}^{2} \cdot u_{2}\right)^{2}=36 \text { (ways). }
$$
(8) Still first arrange the even numbers, at least two numbers are not in their original positions, which includes two cases: exactly two numbers are not in their original positions and all 4 numbers are not in their original positions. For the first case, there are $C_{4}^{2} \cdot u_{2}$ ways of arrangement; for the second case, there are $u_{4}$ ways of arrangement. Therefore, the number of arrangements that meet the condition for even numbers is $\left(C_{4}^{2} \cdot u_{2}\right.$ $\left.+u_{4}\right)$ ways. Similarly, for the odd numbers, the number of arrangements that meet the condition is also $\left(C_{4}^{2} \cdot u_{2}\right.$ $\left.+u_{4}\right)$ ways. By the multiplication principle, the total number of different arrangements is
$$
\left(C_{4}^{2} \cdot u_{2}+u_{4}\right)^{2}=(6+9)^{2}=225 \text { (ways). }
$$