Search code examples
regular-languagefinite-automataautomatadfa

How to determine which language is simpler


The following language is the complement of a simpler language. Construct a DFA for the simpler language and then use it to give the state diagram of a DFA for the given language where Σ = {a,b}.

L={ w : w does not contain the substring baba}.

I don't know which is the simpler language, can anybody please explain?


Solution

  • The automata accepting any word containing the substring 'baba' is:

    enter image description here

    (it's the simpler language. A regexp for it is : (a|b)*baba(a|b)* )

    And we can build the complement DFA by turning accepting states into non-accepting and vice-versa as you mentionned it:

    enter image description here

    (it has to completed)