0

Having a set of n letters {A, B, C, ...} how it's possible to calculate the number of different combinations of k elements , if the number of repetitions allowed for each letter is limited to a number, different for each letter?

E.g.

  • Letters => {A, B, C, D}
  • k = 10
  • A can be repeated up to 2 times, B can be repeated up to 4 times, C can be repeated up to 5 times, D can be repeated 3 times?

Thanks in advance

  • Welcome to MSE. Please use MathJax. – José Carlos Santos Dec 19 '17 at 18:37
  • Give a few examples of the specific objects themselves that you are trying to count. Given your setup in your post, are you counting things like (AA)(BBB)(CCCCC) where all letters must appear in alphabetical order or are you counting ABACCCCCBB as being "different" than AABBBCCCCC? – JMoravitz Dec 19 '17 at 18:46
  • @JMoravitz the alphabetical order is not important, but ABACCCCCBB it's considered different from AABBBCCCCC – Matteo C Dec 19 '17 at 19:02
  • Why are they considered different? They both have two A's, three B's, and five C's? The word "combinations" has some implications that you seem to not be aware of. So then, your question seems to actually be about the number of strings of length $k$ using $n$ available characters with maximum amounts $a_1,a_2,\dots,a_n$ respectively. – JMoravitz Dec 19 '17 at 20:03
  • Sorry @JMoravitz, you're right and I was wrong in my last comment, so ABACCCCCBB is equivalent to AABBBCCCCC (they're considered equal) – Matteo C Dec 19 '17 at 20:10
  • In that case then it is an exact duplicate of the earlier linked question, the only differences being flavor and labels. The question of counting strings is much more tedious, and many approaches will feel almost like brute force. One such approach being breaking down based on the exact number of each letter used. – JMoravitz Dec 19 '17 at 20:13

0 Answers0