Let $n, k \in \mathbb{N}^{*}$, calculate the number of solutions $\left(a_{1}, \ldots a_{k}\right) \in\left(\mathbb{N}^{*}\right)^{k}$ of $a_{1}+\cdots+a_{k}=n$. Calculate the number of solutions $\left(a_{1}, \ldots a_{k}\right) \in \mathbb{N}^{k}$ of $a_{1}+\cdots+a_{k}=n$.
1. We have $n$ objects arranged in a line. We want to cut this line into $k$ parts, each containing at least one element. Indeed, if the sizes of each part (from left to right) are $a_{1}, \ldots, a_{k}$, this is equivalent to choosing a $k$-tuple of strictly positive integers that sum to $n$. However, we can also look for the number of cuts by noting that such a cut is equivalent to placing $k-1$ "bars" between some of the $n$ objects that define the boundary between two parts. We cannot place two bars in the same place since the parts must contain at least one element. But there are $n-1$ possible positions for the bars (between two consecutive elements among the $n$), which gives a total of $\binom{n-1}{k-1}$ solutions.
2. This time, the argument from the previous question does not work as well since we can place two "bars" in the same place. But this question actually reduces to the previous one: if we add 1 to each of the $a_{i}$, then the statement reduces to finding the number of solutions $\left(a_{1}, \ldots, a_{k}\right) \in\left(\mathbb{N}^{*}\right)^{k}$ such that $a_{1}+\ldots+a_{k}=n+k$. Thus, by the previous question, the number of solutions is $\binom{n+k-1}{k-1}$.