49 49 votes Let $P$ be a regular language and $Q$ be a 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 $\{p^nq^n \mid n \in N\})$. Then which of the following is ALWAYS regular? $P \cap Q$ $P-Q$ $\Sigma^*-P$ $\Sigma^*-Q$ Theory of Computation gatecse-2011 theory-of-computation easy regular-language + – akash 16.9k views answer comment Share Follow Print See all 6 Comments 6 6 Comments reply Show 3 previous comments Kiyoshi commented Jan 17, 2022 reply Follow flag yup, because you’re checking the closure after all. 1 1 replyShare 2e10nee1024 commented Aug 5, 2025 reply Follow flag for those confused for option b a counter example is p = ∑* is a regular language since ∑* contains all possible string over ∑ and thus ∑* - P may be CFL may be CSL may be Regular we are not exactly sure thus P - Q is regular is incorrect 0 0 replyShare Omkar_Shelke commented Nov 6, 2025 reply Follow flag P - Q = P ^ Q^C (sigma)* - P = (sigma)* ^ P = regular are closed under intersection (sigma)* - Q = (sigma)* ^ Q = CFL are not closed in intersection 0 0 replyShare Please log in or register to add a comment.
Best answer 69 69 votes Correct Option: C complement of regular Language is regular VOOTLA SRINIVAS answered Oct 30, 2014 • edited May 6, 2021 by soujanyareddy13 VOOTLA SRINIVAS comment Share Follow See all 23 Comments 23 23 Comments reply Show 20 previous comments ankit3009 commented Nov 20, 2021 reply Follow flag Beautifully explained @Shailendra. Thanks :) 0 0 replyShare Rana-G commented Oct 15, 2024 reply Follow flag CFl are closed under Intersection with regular set means that CFL intersection reg language are CFLs 0 0 replyShare DΛΞMON commented Jul 27 reply Follow flag Regular - CFL is always CSL. 1 1 replyShare Please log in or register to add a comment.
19 19 votes The expression ∑* – P represents complement of P which is a regular language. Complement of Regular languages is also regular. Then a DFA that accepts the complement of L, i.e. ∑* – L, can be obtained by swapping its accepting states with its non-accepting states. Paras Nath answered Nov 21, 2016 Paras Nath comment Share Follow See 1 comment 1 1 comment reply ankit3009 commented Nov 20, 2021 reply Follow flag Is it only for regular languages exclusively to follow that ∑* – P = P` (where P is a regular language and P` is the complement of P)? OR 1] ∑* – P = P` (where P is a CFL and P` is the complement of P)? 2] ∑* – P = P` (where P is a CSL and P` is the complement of P)? Are assumptions 1 and 2 also correct? 1 1 replyShare Please log in or register to add a comment.