Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE CS 2011 | Question 24

  • Last Updated : 28 Jun, 2021

1) Let P be a regular language and Q be context-free language such that Q     \subseteq P. (For example, let P be the language represented by the regular expression p*q* and Q be {pnqn|n \in N}). Then which of the following is ALWAYS regular?
(A) P \cap Q
(B) P – Q
(C) \sum* – P
(D) \sum* – Q

(A) A
(B) B
(C) C
(D) D

Answer: (C)


1. P ∩ Q would be Q, due to the given fact that Q ⊆ P, hence context free but not regular.
2. P − Q = P ∩ Q might not even be a context free language, due to the closure properties of context free languages.
3. Σ∗ − P is equivalently complement of P, hence regular. Refer to closure laws of regular languages.
4. Σ∗ − Q is equivalently complement of Q, hence it might not even be a context free language.

Refer to closure laws of CFLs.



This solution is contributed by Vineet Purswani.

Quiz of this Question

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :