<s>[INST] Counting words with specific requirements How many words of length exactly 6 can be created from letters A,B,C,D,E,F, so that each word has not more than one A, not more than one B, not less than one C and not less than one D?
I've tried using simple binomial coefficient, but it is clear that using this method one would count the same word multiple times.
 [/INST] We can break this up into 4 cases:
1) If the word has 0 A's and 0 B's, then there are $4^6$ possible words, and subtracting the words with no C's and no D's gives $4^6-2(3^6)+2^6=2702$ possibilities.
2) If the word has 1 A and 1 B, then there are 6 choices for the A, 5 choices for the B, and then $[4^4-2(3^4)+2^4]$ ways to complete the word so it contains at least one C and at least one D; so there are $6(5)[4^4-2(3^4)+2^4]=3300$ possibilities.
3) If the word contains 1 A and 0 B's, there are 6 choices for the A, and then
$[4^5-2(3^5)+2^5]$ ways to complete the word; so there are $6[4^5-2(3^5)+2^5]=3420$ possibilities.
4) If the word contains 1 B and 0 A's, then there are $6[4^5-2(3^5)+2^5]=3420$ possibilities as in case 3.
Thus there are $12,842$ possible words.

An alternate approach would be to use exponential generating functions:
Since $g_{e}(x)=(1+x)^{2}(e^{x}-1)^2e^{2x}=(1+2x+x^2)(e^{4x}-2e^{3x}+e^{2x})$, 
the coefficient of $x^6$ in $g_{e}(x)$ is given by
$\displaystyle\frac{a_{6}}{6!}=\frac{4^6}{6!}-2\cdot\frac{3^6}{6!}+\frac{2^6}{6!}+2\cdot\frac{4^5}{5!}-4\cdot\frac{3^5}{5!}+2\cdot\frac{2^5}{5!}+\frac{4^4}{4!}-2\cdot\frac{3^4}{4!}+\frac{2^4}{4!}$; 
so the number of possible words is given by
$a_{6}=4^6-2(3^6)+2^6+2(6)(4^5)-6(4)(3^5)+6(2)(2^5)+6(5)(4^4)-6(5)(2)(3^4)+6(5)(2^4)$.
</s>