Consider the given situation:
We're given an array of numbers from 1 to $n$. Now, we want to find the number of ways to select $k$ numbers from the $n$ numbers, such that these are in non-decreasing order. Plus repetition is allowed.
Therefore, all items are not identical.
Example: Say $n=4$, and $k=3$, then we have $\{1,2,3,4\}$, from which we have to select $3$ numbers which must be in non-decreasing order. So, we can have: $\{1,1,1\},...,\{1,1,2\},...,\{1,2,3\},...,\{2,2,4\},...,\{4,4,4\}$ et cetera.
So the crux here is that we have ordering of elements at play too.
Assuming we don't have any ordering, then we simply would have $d^k$ as the answer. But when we have ordering, we would have to consider each sequence on it's own. That is where I am confused. I can't check each sequence.
So what should be done here?
I am not looking for a single formula. I just need to know what is the most efficient way of solving this.