Example 7.17 Use red, blue, and yellow to paint the 6 faces of a cube, so that 2 faces are painted red, 2 faces are painted blue, and 2 faces are painted yellow. Find the number of distinct colored cubes that can be formed.
Solution: Let the number of differently styled colored cubes be $N$. Let $A$ denote the set of the 6 faces of the cube, and let $b_{1}, b_{1}^{\prime}, b_{2}, b_{2}^{\prime}, b_{3}, b_{3}^{\prime}$ denote 6 different colors, and let $B=\left\{b_{1}, b_{1}^{\prime}, b_{2}, b_{2}^{\prime}, b_{3}, b_{3}^{\prime}\right\}$. Let $(D, *)$ denote the rotation group of the cube, and $(\boldsymbol{G}, \circ)$ be the face permutation group induced by $(D, *)$; let $(H, \cdot)$ denote the permutation group on the set $B$ as follows: $H=\left\{h_{1}, h_{2}, \cdots, h_{8}\right\}$, where
$$
\begin{aligned}
h_{1}= & \left(b_{1}\right)\left(b_{1}^{\prime}\right)\left(b_{2}\right)\left(b_{2}^{\prime}\right)\left(b_{3}\right)\left(b_{3}^{\prime}\right) ; \\
h_{2}= & \left(b_{1}\right)\left(b_{1}^{\prime}\right)\left(b_{2} b_{2}^{\prime}\right)\left(b_{3}\right)\left(b_{3}^{\prime}\right) ; \\
h_{3}= & \left(b_{1}\right)\left(b_{1}^{\prime}\right)\left(b_{2}\right)\left(b_{2}^{\prime}\right)\left(b_{3} b_{3}^{\prime}\right) ; \\
h_{4}= & \left(b_{1}\right)\left(b_{1}^{\prime}\right)\left(b_{2} b_{2}^{\prime}\right)\left(b_{3} b_{3}^{\prime}\right) ; \\
h_{5}= & \left(b_{1} b_{1}^{\prime}\right)\left(b_{2}\right)\left(b_{2}^{\prime}\right)\left(b_{3}\right)\left(b_{3}^{\prime}\right) ; \\
h_{6}= & \left(b_{1} b_{1}^{\prime}\right)\left(b_{2} b_{2}^{\prime}\right)\left(b_{3}\right)\left(b_{3}^{\prime}\right) ; \\
& h_{7}=\left(b_{1} b_{1}^{\prime}\right)\left(b_{2}\right)\left(b_{2}^{\prime}\right)\left(b_{3} b_{3}^{\prime}\right) ; \\
& h_{8}=\left(b_{1} b_{1}^{\prime}\right)\left(b_{2} b_{2}^{\prime}\right)\left(b_{3} b_{3}^{\prime}\right),
\end{aligned}
$$

Then the cycle index of $\left(G,{ }^{\circ}\right)$ is
$$
P_{G}\left(x_{1}, x_{2}, \cdots, x_{6}\right)=\frac{1}{24}\left(x_{1}^{6}+8 x_{3}^{2}+6 x_{2}^{3}+3 x_{1}^{2} x_{2}^{2}+6 x_{1}^{2} x_{4}\right),
$$
and the cycle index of $(H, \cdot)$ is
$$
P_{H}\left(x_{1}, x_{2}, \cdots, x_{6}\right)=\frac{1}{8}\left(x_{1}^{6}+3 x_{1}^{4} x_{2}+3 x_{1}^{2} x_{2}^{2}+x_{2}^{3}\right).
$$

Let $a_{1}, a_{2}, a_{3}$ represent red, blue, and yellow, respectively. Using red, blue, and yellow to paint the 6 faces of the cube, each face painted with one color, and the number of faces painted red, blue, and yellow are all 2, the resulting colored cube is denoted as $W_{6}$. The construction of $W_{6}$ can be achieved through the following two steps: First, use 6 different colors $b_{1}, b_{1}^{\prime}, b_{2}, b_{2}^{\prime}, b_{3}, b_{3}^{\prime}$ to paint the 6 faces of the cube, each face painted with one color and ensuring that the colors of each face are distinct; then, change the color of the faces painted with $b_{i}$ or $b_{i}^{\prime}(i=1,2,3)$ to $a_{i}$. Let $K_{6}$ and $K_{6}^{\prime}$ be the colored cubes obtained from the first step, which can be seen as two one-to-one mappings $f$ and $f^{\prime}$ from $A$ to $B$. Let the two colored cubes obtained from the second step for $K_{6}$ and $K_{6}^{\prime}$ be $W_{6}$ and $W_{6}^{\prime}$, respectively. Then $W_{6}$ and $W_{6}^{\prime}$ have the same style if and only if $f$ and $f^{\prime}$ have a $(G, H)$-relation. Therefore, the number of differently styled colored cubes $N$ is equal to the number of $(G, H)$-orbits of one-to-one mappings from $B^{A}$. By Theorem 7.35, we have
$$
\begin{aligned}
N= & \left[P_{G}\left(\frac{\partial}{\partial y_{1}}, \frac{\partial}{\partial y_{2}}, \cdots, \frac{\partial}{\partial y_{6}}\right) P_{H}\left(y_{1}, 2 y_{2}, \cdots, 6 y_{6}\right)\right] y_{1}=y_{2}=\cdots=y_{6}=0 \\
= & \frac{1}{24 \times 8}\left[\left(\left(\frac{\partial}{\partial y_{1}}\right)^{6}+8\left(\frac{\partial}{\partial y_{3}}\right)^{2}+6\left(\frac{\partial}{\partial y_{2}}\right)^{3}+3\left(\frac{\partial}{\partial y_{1}}\right)^{2}\left(\frac{\partial}{\partial y_{2}}\right)^{2}+\right.\right. \\
& \left.6\left(\frac{\partial}{\partial y_{1}}\right)^{2}\left(\frac{\partial}{\partial y_{4}}\right)\right)\left(y_{1}^{6}+3 y_{1}^{4}\left(2 y_{2}\right)+\right. \\
& \left.\left.3 y_{1}^{2}\left(2 y_{2}\right)^{2}+\left(2 y_{2}\right)^{3}\right)\right] y_{1}=y_{2}=\cdots=y_{6}=0 \\
= & \frac{1}{192}\left(6!+6 \times 2^{3} \times 3!+3 \times 3 \times 2!\times 2^{2} \times 2!\right)=6
\end{aligned}
$$