# Thread: seemingly basic combinations problem

1. ## seemingly basic combinations problem

There are M letters. N>M. How many N letter "words" include all M letters?

2. Originally Posted by lightbeam
There are M letters. N>M. How many N letter "words" include all M letters?
A nice solution provided by my neighbor relies on the "inclusion-exclusion" principle. Apply it to the intersection of the M sets $\displaystyle A_i$={words that include the i'th letter}.

$\displaystyle M^{N}$ - $\displaystyle \binom{M}{1}$$\displaystyle (M-1)^N + \displaystyle \binom{M}{2}$$\displaystyle (M-2)^N$ - ... $\displaystyle \binom{M}{M-1}$$\displaystyle (M-(M-1))^N$