Example: $4 m$ white balls are arranged in a row, and $n$ balls are chosen from them to be painted black. If no two black balls can be adjacent, how many different ways are there to paint them?



Translating the above text into English, keeping the original text's line breaks and format, the translation result is directly output as above.
Given that the balls are already painted, imagine these $n$ black balls, except for the last one, each "eat" the white ball immediately following them. The result is the remaining $m-(n-1)=m-n+1$ balls, among which $n$ are black. This generates a mapping $f$ from the set $A=\{$ ways to select $n$ black balls from a row of $m$ white balls, with no two black balls adjacent $\}$ to the set $B=\{$ ways to select $n$ black balls from a row of $m-n+1$ balls $\}$. This mapping is clearly injective. Conversely, for $y \in B$, let the $n$ black balls in $B$, except for the last one, each "spit out" a white ball as its right neighbor, which generates an element $x \in A$. Clearly, the image of $x$ is $y$. Therefore, $f$ is also surjective.
Hence, $f$ is a bijection, so $|A|=|B|=C_{m-n}^{m}$