Amount of combinations of sets summing to number

120 Views Asked by At

(Apologies for the confused arbitrariness here; I don't have experience in formal maths to make abstract my lay-person thoughts, but I've tried my best.)

I have $x$ identical but order-important sets of $0$ to $y$, and would like to make a selection from each set returning $\{N_1, N_2, … N_y\}$. Basic logic tells me there are $y^x$ different selections I can make. However, I am confused at how I may restrict the amount of possible selections so that the sum of these results – $\sum\limits_{i=1}^x N_i$ – is equal to arbitrary number $z$. I know how to determine $f(x,y,z)$ using basic list scripting, but despite this cannot figure out how to define function $f$ itself.

Confused googling has turned me to the subjects of partitions (which I understand works for unordered sets, but can be multiplied by $x!$ for order-important sets) and subsequently compositions (which returns the amount of possible permutations but does not factor in ordering of these and residual zeroes for other values). How do I reconcile my knowledge such that I can come to a formula which is easiest computable en masse rather than having to sum each possible set for each value?