Which of the following statements are correct?
a) The union of two context-free languages is a context-free language.
b) The intersection of a context-free language and a regular language is a regular language.
c) The concatenation of a regular language and a context-free language is a context-free language.
d) The complement of a regular language is a context-free language.

Respuesta :

Explanation:

The correct statements are:

b) The intersection of a context-free language and a regular language is a regular language.

c) The concatenation of a regular language and a context-free language is a context-free language.

Explanation:

a) The union of two context-free languages is not necessarily a context-free language. The union of two context-free languages can be context-sensitive or even recursively enumerable, which are more powerful than context-free languages.

b) The intersection of a context-free language and a regular language is always a regular language. Regular languages are closed under intersection, so the result of the intersection will be a regular language.

c) The concatenation of a regular language and a context-free language is always a context-free language. Context-free languages are closed under concatenation with regular languages, so the result of the concatenation will be a context-free language.

d) The complement of a regular language is not necessarily a context-free language. The complement of a regular language can be context-sensitive or recursively enumerable, depending on the language.