regexregular-languagedfapumping-lemma

{w is in {a,b}*|w contains b only in some odds position}


I need the DFA and the regular expression for this language. My dfa

I think the DFA is this but the Regular expression I get is this ((aUb)a)* and I think it's not correct.


Solution

  • Using the DFA to regex conversion now and I think I got it:

    ((aa|ba)*a)|((aa|ba)*b)|(aa|ba)*

    Simplified as @Bergi said:

    (aa|ba)*|(a|b|ε)