In class we've learned about using transition diagrams to help come up with transition matrices that are composed of either zeroes or ones and which document number of ways to get from state j to i; this info is places at the ij-th entry of the transition matrix.
Now, I mostly get how to find the transition matrix excluding a certain substring, such as the TM of $\{a, b\}$ excluding the string abba; it would be a 5 by 5 matrix with 1s in the ij-th entries in which a transition is allowed from the jth to ith state in one step; for example, one can make the transition $a \implies ab$ so there would be a 1 in that row/column pair, however one can't go from $ab \implies ab$ or $abb \implies a$ in the first case because it would require two steps (or none!) and in the second because that would lead to an "illegal" string. As such, there would be zeroes in those entries.
Now, what if we have to exclude the string $abba$ but each block of $a$s must have length at least 3, and each block of $b$s must have even length? How would one take this into account? Clearly, new states must be introduced. How would I take into account that fact that for the a's, I must add 3 a's in the first step, then continue with one each time; similarly, I can only add b's two at a time in the transition matrix, since I can only do things one step at a time? Would using the fact that the matrix leads to a generating series where one gets matrices denoting number of ways in which one can get from state j to i in n steps help? That is, I could have columns/rows in the transition matrix corresponding to the states $aaa$ and $bb$ but only have ones in them when $n \ge 3$ and $n \ge 2$, respectively?
Any help clearing this up would be appreciated!
How about
\begin{eqnarray} b&\implies&b'\;,\\ b'&\implies&b\;,\\ b&\implies&ba\;,\\ ba&\implies&baa\;,\\ baa&\implies&aaa\;,\\ aaa&\implies&aaa\;,\\ aaa&\implies&b'\;,\\ baa&\implies&b'\;,\\ ba&\implies&b'\;? \end{eqnarray}
If you can allow for more than one letter being added per step, that would simplify things a lot, but if you need to do it one letter at a time, you could do it like this.