I am trying to figure out a problem from Richard Stanley's $\textit{Enumerative Combinatorics}$, which has to do with weak compositions of $n$ (sequence of nonnegative integers whose sum adds up to $n$). The problem is as follows:
Let $\kappa(n,j,k)$ be the number of weak compositions of $n$ into $k$ parts, each part less than $j$. Give a generating function proof that $$\kappa(n,j,k)=\displaystyle \sum_{r+sj=n}(-1)^s\binom{k+r-1}{r}\binom{k}{s},$$
where the sum is over all pairs $(r,s)\in \mathbb{N}^2$ satisfying $r+sj=n$.
I see an alternating sum, so naturally I think about the Principle of Inclusion-Exclusion. I thought to consider the number of all weak compositions of $n$, which is $\binom{n+k-1}{k-1}$ and then remove all weak compositions whose largest part is $n$, $n-1$, $\ldots$, or $j$. I have made one observation, which is that
$$ \text{the number of weak compositions with largest part $j$}=\kappa(n,j+1,k)-\kappa(n,j,k),$$
unless somehow I am mistaken (in that case, please let me know). However, this led me to some ridiculous computations. Perhaps someone else has a suggestion?
Thank you for any help offered!