I'm struggling to come up with the method to find the number of ways to take $k$ objects from $n$ groups which at least one object from each group is taken and order matters.
More specifically, I'm trying to order $8$ digits from the digit pool of $5-10$ ($6$ digits) and each digit must appear at least once and the order matters, e.g. $5,6,7,8,9,10,5,5$ is fine and different from $5,5,6,7,5,8,9,10$ which is also acceptable.
I'd like to know the method of finding this, something like a generating function or other combinatorics calculation and why it actually true.
We need to consider the following different sets of digits
which are $21$ ($6$ with one triple of repeated digits and $15$ with $2$ pairs of repeated digits) and we can permutate each one taking into account the repeated digits, therefore the number of different groups is
$$\frac{15\cdot 8!}{2!2!}+\frac{6\cdot 8!}{3!}=191\,520$$