Let be any two context-free languages and be any regular language. Then which of the following is/are CORRECT?
- is context-free
- is context-free
- is context-free
- is context-free
View worked solution
Answer: B
To determine which statements are correct, let us analyze the closure properties of Context-Free Languages (CFLs):
-
Statement I: is context-free.
CORRECT. Context-free languages are closed under union. If and are the start symbols of the grammars generating and respectively, we can define a new start symbol to generate . -
Statement II: is context-free.
INCORRECT. CFLs are not closed under complementation. For example, the language is not context-free, but its complement is context-free. -
Statement III: is context-free.
CORRECT. We can rewrite the set difference as: Since is a regular language, its complement is also regular. CFLs are closed under intersection with regular languages. Since is a CFL and is regular, their intersection is guaranteed to be a CFL. -
Statement IV: is context-free.
INCORRECT. CFLs are not closed under intersection. For example, and are both CFLs, but their intersection: is a well-known non-CFL.
Thus, only statements I and III are correct.
Free practice · Your answers on this page are not saved.
