Which of the following statements is FALSE?
2023
Which of the following statements is FALSE?
- A.
The intersection of a regular language and a context-free language is context-free
- B.
The intersection of a regular language and a context-free language is regular
- C.
The union of two context-free languages is context-free
- D.
The union of two regular languages is regular
Attempted by 29 students.
Show answer & explanation
Correct answer: B
Closure properties tell us whether combining languages from a class using an operation (union, intersection, complement, concatenation, Kleene star) always yields another language of that same class. Regular languages (REG) are closed under union, intersection, and complement. Context-free languages (CFL) are closed under union, concatenation, and Kleene star — and, as an extended fact, a context-free language intersected with any regular language is always guaranteed to remain context-free, but this intersection is NOT guaranteed to be regular.
Checking each of the four statements against these closure facts:
The intersection of a regular language and a context-free language is context-free — TRUE, directly from the closure property that a context-free language intersected with a regular language stays context-free.
The intersection of a regular language and a context-free language is regular — this claims the stronger property of regularity, which closure only guarantees as context-freeness, not regularity.
The union of two context-free languages is context-free — TRUE, since context-free languages are closed under union (their grammars/PDAs combine into one for the union).
The union of two regular languages is regular — TRUE, since regular languages are closed under union (a product construction on their automata, or combining regular expressions, gives a single automaton/regex for the union).
Cross-check with a concrete counterexample: let R = Σ* (trivially regular) and L = {aⁿbⁿ : n ≥ 0}, a standard context-free language that is provably NOT regular (via the pumping lemma for regular languages). Then R ∩ L = L, which is context-free but not regular — directly disproving the claim that a regular-language/context-free-language intersection is always regular.
So the false statement is the one claiming that intersecting a regular language with a context-free language always gives a regular language.