Question:medium

Suppose that \(L_1\) is a regular language and \(L_2\) is a context-free language. Which one of the following languages is NOT necessarily context-free?

Show Hint

Always remember key closure properties: CFLs are not closed under complementation or general set difference.
Updated On: Jan 30, 2026
  • \(L_1 \cap L_2\)
  • \(L_1 \cdot L_2\)
  • \(L_1 - L_2\)
  • \(L_1 \cup L_2\)
Show Solution

The Correct Option is C

Solution and Explanation

Step 1: Recall closure properties of context-free languages.
Context-free languages (CFLs) are closed under:

• Union
• Concatenation
• Intersection with regular languages


Step 2: Analyze the given operations.

Intersection (L1 ∩ L2):
Since one of the languages involved is regular, the intersection remains context-free.

Concatenation (L1 · L2):
CFLs are closed under concatenation, so the resulting language is context-free.

Union (L1 ∪ L2):
CFLs are closed under union, hence the result is context-free.


Step 3: Examine set difference.
The set difference can be written as:

L1 − L2 = L1 ∩ ̅L2

Context-free languages are not closed under complementation. Therefore, ̅L2 may not be context-free, and the intersection does not guarantee a CFL.


Final Conclusion:
The operation that does not necessarily preserve context-freeness is:

Final Answer: (C)

Was this answer helpful?
0