Search code examples
automata

NFA or DFA for strings the contain exactly twice substring ab?


Given the language with alphabet: {a, b, c} Draw an NFA or DFA for all the strings that have exactly twice substrings "ab" and at least on "c". I'm stuck with "exactly twice "ab"". Can somebody give me some ideas. It's also very good if you can suggest me the regular expression of this statement.


Solution

  • I believe this covers it, but you should verify. DFA picture