Open In App

GATE | GATE IT 2006 | Question 32

Last Updated : 16 Sep, 2021
Like Article
Like
Save
Share
Report

Let L be a context-free language and M a regular language. Then the language L ∩ M is
(A) always regular
(B) never regular
(C) always a deterministic context-free language
(D) always a context-free language


Answer: (D)

Explanation:  

L is a context free language and M is a regular language, hence context free as well. Therefore, L ∩ M is context free for sure, according to closure laws of context free languages. We need to check whether it would be regular or non-regular always. We can prove that by giving examples s.t. L ∩ M can be regular and non-regular both.
• L = {anbn |n ≥ 0} and M = a*b*, in this case L ∩ M will be L itself, hence context free but not regular. L ∩ M won’t be deterministic CFL everytime either, like in this example.
• L = {anbn |n ≥ 0} and M = a, in this case L ∩ M will be M itself, hence regular.

Considering the above statement, correct answer would be (D) always a context-free language.

Reference: https://www.wikipedia.org/wiki/Theory_of_computation

This solution is contributed by vineet purswani .

Quiz of this Question


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads