I am asked to show DFA diagram and RegEx for the complement of the RegEx (00 + 1)*
. In the previous problem I had to prove that the complement of a DFA is close
I didn't take the time to read all of Grijesh's answer, but here's the simple way to get a DFA accepting the complement of a language, given a DFA accepting the language: use the same DFA, but change accepting states to non-accepting, and vice-versa.
Strings previously accepted will be rejected, and strings previously rejected will be accepted. Since all transitions must be defined in any valid DFA, and since all input strings lead to exactly one state, this always works.
To get a DFA for the reversal, you can first construct an NFA by adding a new initial state that branches non-deterministically to all of the accepting states of the original DFA. Reverse all the transitions of the original DFA, and make the only accepting state be the initial state of the original DFA.