I have an alphabet of N letters {A,B,C,D...N} and would like to count how many L-length words do not contain the pattern AA.
I've been going at this all day, but continue to stumble on the same problem.
My first approach was to count all possible combinations, (N^L) and subtract the words that contain the pattern.
I tried to count the number of ways in which I can place 'AA' in L boxes, but I realized early on that I was double counting, since some words can contain the pattern more than once.
I figured that if I had a defined length for the words and the set, I could do it by inclusion/exclusion, but I would like to arrive at a general answer to the problem.
My gut feeling is that somehow I could overcount, and then find a common factor to weed out the duplicates, but I can't quite see how.
Any help would be appreciated!
AA
may start, and $(L-2)^N$ ways to fill the rest; then you have $\frac{(L-3)(L-2)}{2}$ ways to put two copies ofAA
, and $(L-4)^N$ ways to fill out the rest; etc. $\endgroup$ – Arturo Magidin Mar 29 '12 at 15:39