Say I have two elements (0, 1) and I want to find the number of permutations of sequences of, say, length 10. However, I want to limit it so that "1" can never appear more than twice in a row, with no limits on "0." So, 0110110110 is ok, but 0111000000 is not. How can I figure that out? I am interested in the general case, but I thought the example might help.
EDIT: I'm looking for the number of permutations of (in this case) of two elements for sequences (in this case) of length 10, clearly with repetition. 2^10 if not for the limitation I am placing above, that is, I want to remove all sequences that have 3 or more 1's in a row.