# Flipping accept states DFA vs. NFA [duplicate]

I realized that if a language L is recognized by a DFA, then flipping its accept and reject states (aka switching all the accept to reject states and all the reject states to accept) works to recognize the complement of L (which wold be L^c).

I was curious if that worked also with NFAs (flipping the accept and reject states to go from L to L complement), but with their additional paths it doesn't seem like it would work..Definitely seems like it would have too many accept states that aren't correct.

Is this correct? Is there more to it? Thank you!

• You're right. Flipping the states doesn't work in nondeterministic machines (and automata in particular). Try to think of an example! (hint: there is an example with two states) – Shaull Feb 1 '16 at 14:17
• Thank you! I worked it though and I came up with an example now :) – user3295674 Feb 1 '16 at 14:23
• Indeed. In fact it is "twice wrong" for nondeterministic machines. By this I mean that (1) there might be strings accepted both by the machine and by its flipped version, and (2) at the same time there might be strings accepted by neither of them. – Hendrik Jan Feb 1 '16 at 14:25
• Note that flipping the states does provide one direction of the containments: if $A$ is an NFA, and $B$ is the "flipped" NFA, then $\overline{L(A)}\subseteq L(B)$. That is, $B$ accepts everything that $A$ doesn't, but might accept additional strings (assuming $A$ is complete - every word has at least one run). – Shaull Feb 1 '16 at 14:35
• I wish I could upvote all of you, thank you! – user3295674 Feb 1 '16 at 14:42

q0 -> 0 -> q1