The words cannot have a repetition of letters and each character of the type is distinct i.e. the first 'B' is distinct from the second 'B', and both the 'B's can not be in a word simultaneously.
I need an algorithm/formula that answers for any word(provided as count of each letter).
for a smaller word: AABBC answers are permutations of these letters:
- A1B1C
- A1B2C
- A2B1C
- A2B2C
These are all the combinations.
So count of all words is = 4 * 3P3 = 4 * 6 = 24
In your question, the total number of 3 letter groupings which do not repeat a letter will be
{11 /choose 3} - {5/choose2}x(11-3) - {2/choose2}x(11-2) = G (say)
where the second term takes care of excluding the words having atleast 2 A’s and the third term for words having atleast 2 B’s. So, the total words will be G x 3!
You can follow a similar procedure for any word, wherein you’ll have to subtract a term for each repeated letter.