Example 4 (1) Find the number of positive integer solutions to the equation $x_{1}+x_{2}+x_{3}+\cdots+x_{m}=n(m, n \in \mathrm{N}, m<n)$.
(2) Find the number of integer solutions to the equation $x_{1}+x_{2}+x_{3}+\cdots+x_{m}=n(m, n \in \mathrm{N}, n \geqslant(m-2) r+$ $1, r \in \mathbb{Z})$ satisfying $x_{1} \geqslant 1, x_{i} \geqslant r,(i=2,3 \cdots, m-1), x_{m} \geqslant 0$.
Solution: (1) Consider $n$ identical balls arranged in a row, and choose $m-1$ gaps from the $n-1$ gaps formed, and insert “a board” into each gap. It is obvious that the solutions of the original equation and the insertion methods of the $m-1$ “boards” form a $1-1$ correspondence. The number of ways to insert $m-1$ “boards” is $C_{n-1}^{m-1}$, so the original equation has $C_{n-1}^{m-1}$ positive integer solutions.
(2) Let $x^{\prime}{ }_{1}=x_{1} \geqslant 1, x^{\prime}{ }_{i}=x_{i}-r+1 \geqslant 1 (i=2,3 \cdots m-1), x^{\prime}{ }_{m}=$ $x_{m}+1 \geqslant 1$, then we have $x^{\prime}{ }_{1}+x^{\prime}{ }_{2}+x^{\prime}{ }_{3}+\cdots \cdots+x^{\prime}{ }_{m}=n+(r-1)(2-m)+1$. Therefore, the set of integer solutions of the equation $x_{1}+x_{2}+x_{3}+\cdots \cdots+x_{m}=n$ that satisfy $x_{1} \geqslant 1, x_{i} \geqslant r (i=2,3 \cdots \cdots \cdot m-1), x_{m} \geqslant 0$ is in a $1-1$ correspondence with the set of positive integer solutions of $x^{\prime}{ }_{1}+x^{\prime}{ }_{2}+x^{\prime}{ }_{3}+\cdots \cdots+x^{\prime}{ }_{m}=n+(r-1)(2-m)+1$. From (1), we know that the number of positive integer solutions of $x^{\prime}{ }_{1}+x^{\prime}{ }_{2}+x^{\prime}{ }_{3}+\cdots \cdots+x^{\prime}{ }_{m}=n+(r-1)(2-m)+1$ is $C_{n+(r-1)(2-m)}^{m-1}$, so the number of integer solutions of the equation that satisfy the conditions is $C_{n+(r-1)(2-m)}^{m-1}$.