The reverse can be either a DFA or an NFA.

If has more than one accept state, is guaranteed to become a NFA. Else, it can be a DFA (if was originally a DFA).

Procedure

Let be an finite state automata. To reverse (to produce ) , we:

  1. Check if has only one accept state, . If it does, do nothing. If has more than one accept state, create a new state and connect all previous accept states to via epsilon transitions That is, for each state in , add an -transition from that state to . Then, make this the only accept state.
  2. Reverse every transition. That is, if we had , it now becomes .
  3. Finally, make the initial state and make the initial state the accept state. I.e. swap the accept and initial states.

|600 %%🖋 Edit in Excalidraw, and the dark exported image%%