17. (12 points) The rules of the Chinese Men's Basketball Premier League stipulate: Each game, the winner gets 2 points, the loser gets 1 point (each game, even if it goes to overtime, must have a winner). A certain men's premier basketball team is very strong, with a probability of winning each game being $\frac{3}{4}$ and a probability of losing being $\frac{1}{4}$. Find the probability that the team will score $n$ points through several games in the middle of the season (assuming the total number of games in the season for the team is $S$, here 0 $<n \leqslant S$).
17. Let the probability of the team scoring $n$ points after several matches be $p_{n}$, then we have
$$
p_{1}=\frac{1}{4}, p_{2}=p_{1}^{2}+\frac{3}{4}=\frac{13}{16} .
$$

When $n>2$, we have
$$
\begin{array}{l}
p_{n}=\frac{1}{4} p_{n-1}+\frac{3}{4} p_{n-2}(2S$, then due to the limitation to $S$ matches, the cases where more than $S$ matches are played to score $n$ points should be excluded. Therefore, the above relationship no longer reflects the true probability of scoring $n$ points. Thus, only under the condition $n \leqslant S$, the probability of scoring $n$ points calculated by the above relationship is correct.