0
$\begingroup$

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.

$\endgroup$
0
$\begingroup$

For $(1)$ you have $n$ choices at each of $k$ locations, so $n^k$ choices in total. For $(2)$ you have $3$ choices for the element that is represented $3$ times, then $6 \choose 3$ ways to pick where they are, $2$ ways to choose the element that appears twice, then $3 \choose 2$ ways to choose where they go. This was easier because you didn't have the same number of any pair of characters, so don't need to worry about swapping the sets.

$\endgroup$
  • $\begingroup$ Well, that was just an example. I am interested in a full general solution to part (2). How does your solution change if we look at say a five digit code with 3 elements such that one element is present once and the other two both have two instances? $\endgroup$ – MW4444 Sep 13 '16 at 3:41
  • $\begingroup$ The process is the same for any particular arrangement. If you understand the answer for this one, you should be able to do others. If you have $n$ groups of the same size, you have to divide by $n!$ because you can choose the groups in any order. $\endgroup$ – Ross Millikan Sep 13 '16 at 4:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.