# GATE | Gate IT 2005 | Question 4

Let L be a regular language and M be a context-free language, both over the alphabet Σ. Let Lc and Mc denote the complements of L and M respectively. Which of the following statements about the language Lc∪ Mc is TRUE
(A) It is necessarily regular but not necessarily context-free
(B) It is necessarily context-free.
(C) It is necessarily non-regular.
(D) None of the above

Explanation:

Proposition:
L is a regular language
M is a context free language
Derivation:
L_c  union M_c = complement{L intersection M}
Now, L intersection M is a CFL according to closure laws of CFLs, i.e. intersection of a CFL with RL is always a CFL.
But, complement{L intersection M} might not be a CFL because complement over CFL doesn’t guarantee a CFL. It can even be a RL or it might even lie outside the CFL circle. It will be a context-sensitive language certainly, but nothing else can be said about it.
Conclusion:
Considering the above derivation, none of the statements are true. Hence correct answer would be (D) None of the above.

Related article :

http://quiz.geeksforgeeks.org/theory-of-computation-closure-properties-of-context-free-languages/

This solution is contributed by Vineet Purswani.

Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.