I'm working on a probability problem which involves several dice that must add up to a certain number. I'm trying to generalize the problem:
Problem: Given a value $t \in \mathbb{N}$, how many ways do we have to pick $k$ numbers of the set $\{1, 2, \dots, n\}$ such that its sum adds up to $t$. That is to say, I want to find an expression of the cardinal of the set $$\left\lbrace(x_1, x_2, ..., x_k) \in \{1, 2, \dots, n\}^k : \sum_{i=1}^k x_i = t \right\rbrace.$$
I write it this way so it is clear that we can repeat numbers and that the order matters, (i.e., $1 + 2$ and $2 + 1$ would count as different ways of addint up to $3$).
My approach: I'm considering the polynomial $$(x + x^2 + \dots + x^n)^k$$ and I'm trying to find an expression for the coefficient of $x^t$ in the expansion of the above expression.
I've tried to rewrite the polynomial as $$\left( \frac{x-x^{n+1}}{1-x} \right)^k,$$ but I don't know how to continue.
There is a way of determine this ammount?