Practice free →
HomeGATE CSEcomputerscienceTheory of Computation › If $L$ is regular and $L'$ is its complement (ov…

If $L$ is regular and $L'$ is its complement (over the same alphabet), then

A$L'$ is also regular (closed under complement)
B$L'$ is never regular
C$L'$ is context-free but not regular
DClosure under complement is undecidable
Answer & Solution
Correct answer: A. $L'$ is also regular (closed under complement)
1. Closure under complement is one of the key properties of regular languages. 2. Construction: take the DFA for $L$. Compute its complement DFA by SWAPPING accepting and non-accepting states (i.e. $F' = Q \setminus F$). 3. This DFA accepts exactly the strings the original rejected — which is the complement language. 4. Note: this construction works for DFAs but NOT directly for NFAs (an NFA with $F'$ instead of $F$ accepts a DIFFERENT language because of nondeterminism). So convert NFA to DFA first if needed. 5. Option B contradicts closure. Option C is wrong (regular is a SUBSET of context-free). Option D conflates with Turing-machine settings. _Source: Jeff Erickson, "Models of Computation", §2.9 (Closure under complement)._
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions