Let's say I have a sequence of numbers of length $k$ with $n$ distinct objects in that sequence. Since $k\geq n,$ I know that there will be some objects in the sequence that get repeated. I have two questions:
1) How do I calculate the total number of possible sequences in the situation above?
2) Let's say now that I know the number of repetitions, e.g. "I have a 6 digit code with 3 distinct elements. One element is present once, one is present twice, and the third has three instances." This question gets a little more tricky because now it matters which element has only one instance, which has 2, etc. How, then, do you now calculate the total number of possible sequences given this information?
My question seems to be related to composition, but I can't quite figure out how to make it all work.