Example 2-34 Suppose there are two red, two blue, and two white balls. Try to list all possible combinations, assuming balls of the same color are indistinguishable.
Let $r$ represent red, $b$ represent blue, and $w$ represent white.
$$
\begin{aligned}
& \left(1+r+r^{2}\right)\left(1+b+b^{2}\right)\left(1+w+w^{2}\right) \\
= & {\left[1+(r+b)+\left(r^{2}+b^{2}+r b\right)+\left(r^{2} b+r b^{2}\right)+r^{2} b^{2}\right] \cdot\left(1+w+w^{2}\right) } \\
= & 1+(r+b+w)+\left(r^{2}+b^{2}+r b+r w+b w+w^{2}\right) \\
& +\left(r^{2} b+r b^{3}+r^{2} w+w^{2} b+r b w+r w^{2}+w b^{2}\right) \\
& +\left(r^{2} w^{2}+r^{2} w b+r w^{2} b+r^{2} b^{2}+w^{2} b^{2}+r w b\right) \\
& +\left(r^{2} w^{2} b+r^{2} w b^{2}+r w^{2} b^{2}\right)+r^{2} w^{2} b^{2}
\end{aligned}
$$

The terms on the right side of the equation are the results of multiplying one term from each bracket on the left side, where 1 represents not taking any. $r$ or $r^{2}$ represents taking one or two red balls, respectively. Therefore, the enumeration of various combinations becomes a formal algebraic operation. For example, taking 5 balls, we have:
$$
r^{2} w^{2} b, \quad r^{2} w b, \quad r w^{2} b^{2}
$$
$r^{2} w^{2} b$ represents 2 red balls, 2 white balls, and 1 blue ball.
If we only ask how many ways there are to form a group of 4 balls, we can perform the following formal algebraic operation. Find
$$
\left(1+x+x^{2}\right)\left(1+x+x^{2}\right)\left(1+x+x^{2}\right)=\left(1+x+x^{2}\right)^{3}
$$

The coefficient of the $x^{4}$ term in the expanded form is 7, which can be estimated directly without fully expanding.
If we want to enumerate the schemes for 4 balls, we have:
$$
r^{2} w^{2}, \quad r^{2} w b, \quad r w^{2} b, \quad r^{2} b^{2}, \quad w^{2} b^{2}, \quad r^{2} b, \quad r b^{3} .
$$